/**
 * PayPal Webhook Idempotency
 *
 * Prevents duplicate processing of PayPal webhook events.
 * Uses the PayPalEvent table with a unique constraint on paypal_event_id.
 * Race conditions are handled by catching Prisma P2002 (unique violation).
 */
/**
 * Execute a webhook handler with idempotency protection.
 *
 * @param eventId - PayPal event ID (from event.id)
 * @param eventType - PayPal event type (e.g., 'BILLING.SUBSCRIPTION.ACTIVATED')
 * @param resourceId - PayPal resource ID (e.g., subscription or payment ID)
 * @param payload - Full webhook payload (stored for debugging)
 * @param handler - The actual webhook processing function
 * @returns true if the event was a duplicate (already processed), false if it was new and processed
 */
export declare function withIdempotency(eventId: string, eventType: string, resourceId: string | undefined, payload: any, handler: () => Promise<void>): Promise<boolean>;
//# sourceMappingURL=webhookIdempotency.d.ts.map