Skip to main content

GooglePay

Methods#

canMakePayments#

Checks if the user is able to make payments, based on their current device and the supplied parameters.

Usage#

const options: GooglePayRequest = {...};const { canMakePayments } = await GooglePay.canMakePayments(options);
if (canMakePayments) { // continue the payment process...}

Parameters#

NameType
requestGooglePayRequest

Returns: Promise<GooglePayCanMakePaymentsResponse>

initGooglePayClient#

Loads and initializes the Google Pay API on the client.

Usage#

 const options: GooglePayInitClientRequest = {...}; const { isReady } = await GooglePay.initGooglePayClient(options);
 if (isReady) {  // continue the payment process... }

Parameters#

NameType
requestGooglePayInitClientRequest

Returns: Promise<GooglePayInitClientResponse>

makePaymentRequest#

Requests a payment by presenting the Google Pay payment sheet over the app.

Usage#

const options: GooglePayPaymentRequest = {...};const res = await GooglePay.makePaymentRequest(options);
console.log('Payment Response: ', JSON.stringify(res));

Parameters#

NameType
requestGooglePayPaymentRequest

Returns: Promise<GooglePayMakePaymentRequestResponse>