Confirms a Google Pay payment with PayPal
Payment confirmation options
Promise resolving to the approved payment response
Transforms Google Pay eligibility config into the format required by Google's PaymentsClient
Configuration from getDetails("googlepay").config
Formatted configuration ready for Google Pay SDK
Performs field renames required by Google's API:
supportedNetworks becomes allowedCardNetworksmerchantCountry becomes countryCodeauthJwt in sandbox environmentsThis must be called before passing config to isReadyToPay() or loadPaymentData().
const details = paymentMethods.getDetails("googlepay");
const googlePayConfig = session.formatConfigForPaymentRequest(details.config);
const isReady = await paymentsClient.isReadyToPay({
allowedPaymentMethods: googlePayConfig.allowedPaymentMethods,
apiVersion: googlePayConfig.apiVersion,
apiVersionMinor: googlePayConfig.apiVersionMinor,
});
Fetches Google Pay configuration from PayPal
Promise resolving to Google Pay configuration
Google Pay one-time payment session
Remarks
This session object manages the Google Pay payment flow. Unlike other payment methods, Google Pay does not use a start() callback pattern. Instead, merchants control the flow via Google's PaymentsClient and call confirmOrder() when payment data is received.