import type { AxiosInstance } from 'axios'; /** * The buyer went through the PayPal flow but the payment was declined or * failed. Nothing was written locally; the order stays pending and the caller * decides what the buyer sees. */ export declare class PaypalPaymentDeclinedError extends Error { } export declare function mapCaptureStatus(status?: string): string | null; export declare function mapAuthorizationStatus(status?: string): string | null; interface FinalizeResult { paymentStatus: string; transactionId: string; firstFinalization: boolean; } /** * Record one settled/pending PayPal payment against a local order: update the * payment status, insert the transaction idempotently, log activity once per * transaction id, and mark the order placed (`markOrderPlaced`, which emits * `order_placed` once per order) — shared by the return page, the webhook, * and the reconciliation cron so every path uses the same guard. */ export declare function recordPaypalPayment(order: any, payment: { id: string; amount?: { value?: string; }; }, source: any, action: 'capture' | 'authorize', paymentStatus: string): Promise; /** * Complete the payment for a local order whose PayPal order the buyer has * approved: capture or authorize (the PayPal order's own `intent` decides — * the admin setting can change between create and return), record the * transaction idempotently, update the payment status, and emit * `order_placed` exactly once across every caller (return page now, webhook * and reconciliation cron later). */ export declare function finalizePaypalOrder(order: any, axiosInstance: AxiosInstance): Promise; /** * `finalizePaypalOrder` for callers with nobody left to show an error to * (webhook, reconciliation cron): a declined payment marks the order * `paypal_failed` for admin review instead of throwing. Everything else * still throws. */ export declare function finalizePaypalOrderOrFail(order: any, axiosInstance: AxiosInstance): Promise; export {};