Google Pay Control Object

window.ckGooglePay object - controls initialization of Google Pay button.

Method

Call Required

Description

enableGooglePay

Yes

Initializes and enables Google Pay Button. Takes EnableGooglePayParams object

updateAmount

Conditional

Updates amount on Google Sheet.

You can provide either All, One or None of the parameters for enableGooglePay call.

  • amountField specified - in this case Google Pay total amount will be automatically updated whenever amount has changed

  • amountField is not specified - in this case it’s up to you to provide the correct amount for Google Pay. One of the ways to do it is to call window.ckGooglePay.updateAmount manually.

  • iframeField specified - this value will be used to communicate with Google Pay button. This option is especially helpful for Angular clients using shadow DOM.

  • iframeField is not specified - it’s value will be calculated based on data-ifields-id attribute. In this case it must be set to β€œigpβ€œ: data-ifields-id="igp".

EnableGooglePayParams Object

Name

Type

Required

Description

amountField

String|Object

No

Field containing amount. Could be either name of the field (String) or field itself (Object)

iframeField

String|Object

No

Field containing iframe with Google Pay button. Could be either name of the field (String) or field itself (Object)

Enable Google Pay example

ckGooglePay.enableGooglePay({amountField: 'amount'});

Last updated