//#region src/payment-methods/airwallex-apple-pay-adapter.d.ts /** * Airwallex Apple Pay Adapter * * Uses native ApplePaySession API directly (not Stripe.js) to show the payment sheet * and extract the encrypted payment token for Airwallex processing. * * Flow: * 1. initialize() - Checks if ApplePaySession is available * 2. canMakePayment() - Checks if user can pay with Apple Pay * 3. showPaymentSheet() - Shows Apple Pay sheet with merchant validation callback * * The key difference from Stripe's approach is that we use the native * ApplePaySession API and handle merchant validation via Airwallex's * payment_session/start API which validates with Apple. * * Mock scenarios are supported for E2E testing without real Apple Pay. */ declare enum AirwallexApplePayMockScenario { None = "none", Success = "success", Cancelled = "cancelled", } interface ApplePayEncryptedToken { paymentData: { version?: string; data: string; signature: string; header: { ephemeralPublicKey: string; publicKeyHash: string; transactionId: string; }; }; paymentMethod: { displayName: string; network: string; type: string; }; transactionIdentifier: string; } interface AirwallexApplePayConfig { amount: number; currency: string; country: string; merchantName?: string; } type AirwallexApplePayShowResult = { success: true; token: ApplePayEncryptedToken; payerEmail?: string; payerFirstName?: string; payerLastName?: string; complete: (status: "success" | "fail") => void; } | { success: false; cancelled: true; } | { success: false; error: string; }; type MerchantValidationCallback = (validationUrl: string) => Promise<{ merchantSession?: object; error?: string; }>; declare class AirwallexApplePayAdapter { private config; private mockScenario; constructor(mockScenario?: AirwallexApplePayMockScenario); /** * Initialize the adapter with payment configuration. * Returns true if Apple Pay is available on this device. */ initialize(config: AirwallexApplePayConfig): boolean; /** * Check if the user can make a payment with Apple Pay. * Returns true if Apple Pay is set up on this device. */ canMakePayment(): Promise; /** * Convert atomic units (cents) to display format for Apple Pay. * Apple Pay expects a string like "10.00" for $10.00. */ private formatAmount; /** * Show the Apple Pay payment sheet and return the encrypted token. * * This uses the native ApplePaySession API with a two-step flow: * 1. onvalidatemerchant - Called by Apple to validate the merchant * The callback should call our backend which calls Airwallex's payment_session/start * 2. onpaymentauthorized - Called when user authorizes with Face ID/Touch ID * Returns the encrypted token for processing * * @param onMerchantValidation - Callback to validate merchant with backend * @returns Promise with token or error */ showPaymentSheet(onMerchantValidation: MerchantValidationCallback): Promise; } //#endregion export { ApplePayEncryptedToken as a, AirwallexApplePayShowResult as i, AirwallexApplePayConfig as n, MerchantValidationCallback as o, AirwallexApplePayMockScenario as r, AirwallexApplePayAdapter as t }; //# sourceMappingURL=airwallex-apple-pay-adapter-CnnZ7VL6.d.mts.map