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#
| Name | Type |
|---|---|
request | GooglePayRequest |
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#
| Name | Type |
|---|---|
request | GooglePayInitClientRequest |
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#
| Name | Type |
|---|---|
request | GooglePayPaymentRequest |
Returns: Promise<GooglePayMakePaymentRequestResponse>