//#region src/payment-methods/airwallex-google-pay-adapter.d.ts /** * Airwallex Google Pay Adapter * * Uses Google Pay API directly (not Stripe.js) to show the payment sheet * and extract the encrypted payment token for Airwallex processing. * * Flow: * 1. initialize() - Checks if Google Pay API is available * 2. createPaymentDataRequest() - Configures the payment request * 3. canMakePayment() - Checks if user can pay with Google Pay * 4. showPaymentSheet() - Shows Google Pay sheet and returns encrypted token * * Mock scenarios are supported for E2E testing without real Google Pay. */ declare enum AirwallexGooglePayMockScenario { None = "none", Success = "success", Cancelled = "cancelled", } declare global { interface Window { google?: { payments: { api: { PaymentsClient: new (config: GooglePayClientConfig) => GooglePaymentsClient; }; }; }; } } interface GooglePayClientConfig { environment: "TEST" | "PRODUCTION"; } interface GooglePaymentsClient { isReadyToPay(request: IsReadyToPayRequest): Promise; loadPaymentData(request: PaymentDataRequest): Promise; } interface IsReadyToPayRequest { apiVersion: number; apiVersionMinor: number; allowedPaymentMethods: AllowedPaymentMethod[]; } interface IsReadyToPayResponse { result: boolean; } interface AllowedPaymentMethod { type: "CARD"; parameters: { allowedAuthMethods: ("PAN_ONLY" | "CRYPTOGRAM_3DS")[]; allowedCardNetworks: ("VISA" | "MASTERCARD" | "AMEX" | "DISCOVER" | "JCB")[]; }; tokenizationSpecification?: TokenizationSpecification; } interface TokenizationSpecification { type: "PAYMENT_GATEWAY"; parameters: { gateway: string; gatewayMerchantId: string; }; } interface PaymentDataRequest extends IsReadyToPayRequest { merchantInfo: { merchantId?: string; merchantName: string; }; transactionInfo: { totalPriceStatus: "FINAL" | "ESTIMATED"; totalPrice: string; currencyCode: string; countryCode: string; }; emailRequired?: boolean; } interface PaymentData { email?: string; paymentMethodData: { type: string; tokenizationData: { type: string; token: string; }; info?: { cardNetwork: string; cardDetails: string; }; }; } interface GooglePayEncryptedToken { protocolVersion: string; signature: string; intermediateSigningKey: { signedKey: string; signatures: string[]; }; signedMessage: string; } interface AirwallexGooglePayConfig { merchantId: string; gatewayMerchantId: string; amountDisplay: string; currency: string; country: string; isProduction?: boolean; googleMerchantId?: string; } type AirwallexShowPaymentResult = { success: true; token: GooglePayEncryptedToken; payerEmail?: string; } | { success: false; cancelled: true; } | { success: false; error: string; }; declare class AirwallexGooglePayAdapter { private client; private config; private mockScenario; constructor(mockScenario?: AirwallexGooglePayMockScenario); /** * Initialize the Google Pay client. * Returns true if Google Pay API is available. */ initialize(config: AirwallexGooglePayConfig): boolean; /** * Build the allowed payment methods configuration for Google Pay. */ private getAllowedPaymentMethods; /** * Check if the user can make a payment with Google Pay. */ canMakePayment(): Promise; /** * Show the Google Pay payment sheet and return the encrypted token. */ showPaymentSheet(): Promise; } //#endregion export { GooglePayEncryptedToken as a, AirwallexShowPaymentResult as i, AirwallexGooglePayConfig as n, AirwallexGooglePayMockScenario as r, AirwallexGooglePayAdapter as t }; //# sourceMappingURL=airwallex-google-pay-adapter-D-AxVLLq.d.mts.map