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
Launches the 3DS (Strong Customer Authentication) flow for an order.
Object containing the PayPal orderId
Promise resolving with the 3DS liabilityShift outcome on success,
and rejecting on cancel or failure
Call this after confirmOrder returns a status of
"PAYER_ACTION_REQUIRED". It opens PayPal's 3DS iframe modal and resolves
once the buyer completes authentication, with the resulting liabilityShift.
If the buyer cancels the modal or authentication fails, the promise rejects so the merchant does not capture an unauthenticated order.
Note for Google Pay: the 3DS modal can only open after Google's payment
sheet has closed, and that sheet stays open until the onPaymentAuthorized
callback resolves. Do not await this method inside
onPaymentAuthorized — return { transactionState: "SUCCESS" } to close the
sheet first, then handle this promise out-of-band.
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.