GooglePay
#
Methods#
canMakePaymentsChecks if the user is able to make payments, based on their current device and the supplied parameters.
#
Usageconst options: GooglePayRequest = {...};const { canMakePayments } = await GooglePay.canMakePayments(options);
if (canMakePayments) { // continue the payment process...}
#
ParametersName | Type |
---|---|
request | GooglePayRequest |
Returns: Promise<GooglePayCanMakePaymentsResponse>
#
initGooglePayClientLoads 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... }
#
ParametersName | Type |
---|---|
request | GooglePayInitClientRequest |
Returns: Promise<GooglePayInitClientResponse>
#
makePaymentRequestRequests a payment by presenting the Google Pay payment sheet over the app.
#
Usageconst options: GooglePayPaymentRequest = {...};const res = await GooglePay.makePaymentRequest(options);
console.log('Payment Response: ', JSON.stringify(res));
#
ParametersName | Type |
---|---|
request | GooglePayPaymentRequest |
Returns: Promise<GooglePayMakePaymentRequestResponse>