Google Pay is an express payment method that lets shoppers pay with fewer steps.
Before you begin
Try it out!
Google Pay express checkout is supported only with the Advanced flow integration.
Before starting your Google Pay integration:
- Build a Components integration.
- Follow the setup steps in the Google Pay documentation.
- Add Google Pay in your Customer Area.
For more details about each step, continue to the step-by-step guide below.
Step 1: Create a DOM element
Create a Document Object Model (DOM) element where you want to implement express checkout.
Step 2: Set the callback intents
When you create an instance of the Component, set the callback intents from Google Pay:
Step 3: Set shipping configurations
Configure the options for shipping address and shipping options:
Step 4: Pass the default shipping options
Configure the default shipping option parameters.
Step 5: Set the transaction information
Set the initial transaction information. For example:
Step 6: Update the payment data
Implement the callback to get updated payment data from Google Pay, like if the shipping address changes. You must come up with the logic to calculate the new total and implement a function like
calculateNewTransactionInfo. For example:
When the payment amount changes, Adyen doesn't receive the updated amount from Google Pay. You must validate that the updated amount is correct before you send it in the /payments request.
Step 7: Configure the callback to get the shopper's information
Implement the event handler to get the shopper's information from Google Pay. This is triggered after
When the shopper checks out with Google Pay as an express payment method, the configurations you implemented give you updates on the shipping address, payment data, and shopper information.
Step 8: Mount the Component
Check that Google Pay is available and mount the Component: