Pay Button & Payment
After you have finished enabling Google Pay, you should use the Google Pay API to render the Google Pay payment button. The Google Pay API then calls the payment sheet where users can select their payment method.
You will need to refer to Google Pay's extensive tutorial on their API to configure and render this button correctly. The key steps are summarised below.
- Define your Google Pay API version.
- Choose a payment tokenization method.
- Define supported payment card networks.
- Describe your allowed payment methods.
- Load the Google Pay API JavaScript library.
- Determine readiness to pay with the Google Pay API.
- Add a Google Pay payment button.
- Create a PaymentDataRequest object.
- Register an event handler for user gestures.