import type { AxiosInstance } from 'axios'; export interface PaypalWebhookEvent { event_type?: string; resource?: any; } export interface EventOrderKeys { paypalOrderId?: string; invoiceNumber?: string; captureId?: string; } /** * Pull every key usable to find the local order out of a webhook event. * Capture events carry the PayPal order id in supplementary_data and our * order number in invoice_id (set at create). Refund events carry invoice_id * plus an "up" link pointing at the refunded capture. */ export declare function extractEventOrderKeys(event: PaypalWebhookEvent): EventOrderKeys; /** * Apply one verified webhook event. Unknown events and unknown orders are * ignored (the endpoint still answers 200 — PayPal retries anything else). * Guards are ordering-safe: a late/duplicate event never downgrades a settled * order. */ export declare function handlePaypalWebhookEvent(event: PaypalWebhookEvent, axiosInstance: AxiosInstance): Promise; /** * Verify the transmission against PayPal's verify-webhook-signature API. * Returns false on FAILURE; throws on transport errors so the caller can 500 * (PayPal will retry). */ export declare function verifyPaypalWebhookSignature(axiosInstance: AxiosInstance, headers: Record, event: PaypalWebhookEvent, webhookId: string): Promise;