Skip to main content
Google Pay is an express payment method that lets shoppers pay with fewer steps.

Requirements

Code samples

**

HTML

DOM element
**

JavaScript

Component implementation example
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. Create a DOM element

Step 2: Set the callback intents

When you create an instance of the Component, set the callback intents from Google Pay: Callback intents

Step 3: Set shipping configurations

Configure the options for shipping address and shipping options: Shipping configuration

Step 4: Pass the default shipping options

Configure the default shipping option parameters. Default shipping options

Step 5: Set the transaction information

Set up additional component configuration, and set the initial transaction information. For example: For v6.0.0 or later, you must include isExpress: true. Get transaction information

Step 6: (Optional) Add additional configuration

In your configuration object, you can include additional configuration supported by the Google Pay request object. For example, to require the shopper’s email and full billing address at checkout, include the following configuration: Add additional configuration

Step 7: 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 get the new shipping options and calculate the new total. You can do this by implementing your own functions like fetchNewShippingOptions and calculateNewTransactionInfo. For example: Get updated payment data from Google Pay
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. If the amount changes, update the amount and pass it to onSubmit to make the /payments request.

Step 8: 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 before onSubmit: Get the shopper information from Google Pay payment data
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 9: Mount the Component

Check that Google Pay is available and mount the Component: Check if available and mount the Component

See also