Learn how to accept Google Pay payments on POS terminals, on the web, and in Android apps.
Google Pay is a payment method that allows shoppers to make purchases using the card stored in their Google account. This provides them with a simpler checkout process whether they are buying from their Android devices, on the web, or in-store through POS terminals.
|Payment Type||Payment flow||Recurring||Refunds||Partial Refunds||Captures||Partial Captures||Chargebacks|
You can accept Google Pay payments with:
Before you start with your Google Pay implementation, make sure that you:
- Read and understand our Web SDK, Android SDK, or API integration guides.
- If you are using our API or have built your own UI for Android, read the Google Pay API Setup and Tutorials documentation for Web or Android.
Integrate with Web SDK
- Before you can start accepting live Google Pay payments, we need to configure your Google Pay
merchantID. Follow Google Pay's Deploy production environment guidelines then contact Support Team and provide your
merchantIDfrom your Google Pay Developer Profile.
Integrate with Android SDK
If you are using our drop-in Android Checkout SDK, there is no need for additional configuration.
If you have built your own UI for Android, you need to generate the Google Pay token then submit it to Adyen to complete the payment.
Generate Google Pay token. Follow the Google Pay documentation to integrate your Android application. Set adyen as your
gatewayand provide your merchant account name in the
tokenfrom Google Pay API response
Include the Google Pay
tokenwhen you submit the payment .
Integrate with API
To use our APIs for Google Pay transactions, you need to obtain a token from Google Pay and then pass the value to Adyen through a
Before you begin this section, make sure you read and understand our API Integration guide.
Step 1: Generate Google Pay token
You can get the Google Pay token from either:
Get the token from our Google Pay Component
To add the Google Pay Component to your payments form:
Create a DOM element, placing it where you want the Google Pay button to be rendered:
Create an instance of the Google Pay Component, specifying:
environment: Set to TEST. Change this to LIVE when you're ready to accept live Google Pay payments.
currencyCode: The three-character currency code.
configuration.gatewayMerchantId: Your Adyen merchant account name.
configuration.merchantIdentifier: Your Google Merchant ID. This is optional for TEST payments.
Check whether Google Pay is available to the shopper. If it is, mount the Component:
Do not mount the Component if Google Pay is not available to the shopper.
Create a function to listen to and handle the
onChangeevent triggered by the Component:
If there was an error during the authorization process an
onErrorevent is called.
For more information on the
paymentDataresponse object, see Google's PaymentData documentation.
state.isValidis true , collect the values passed in the
state.data. You'll use these to make the payment.
To configure how the Google Pay Component renders in your payment form, see Configuring the Component .
Get the token from your Google Pay API integration
Another option is to integrate directly with Google Pay directly to get your token. Follow the procedure on Google Pay documentation to integrate your Android application or your web application.
Set adyen as your
gateway and provide your merchant account name in the
After you have successfully completed the integration and handled the response object from Google Pay, get the
Step 2: Make a payment
/payments request, providing the:
reference: Your unique reference for this payment.
paywithgoogle.token: This is the
tokenthat you obtained from the Google Pay API response.
If the payment was successful, you'll receive an authorised
resultCode and a
pspReference, which is our unique identifier for this payment.
If the shopper used a card with 3D Secure enabled, you will get redirectShopper as
resultCode. Follow the steps for Cards with 3D Secure to redirect the shopper and to complete the redirect payment.
Step 3: Present payment result
resultCodeyou received from the
/paymentsendpoint to present the shopper with a the result of the payment via your website or app. Check our result codes documentation for information on what these mean, and what actions you should take.
Integrate with POS
Google Pay is supported out-of-the-box on our POS terminals without any additional integration effort.
Shoppers using an Android phone with NFC may use Google Pay when purchasing in-store in countries where POS is available.
Google Pay notifications
Accepting notifications is required for Google Pay. Know the status of the transaction through notifications.
Each notification has a
pspReference that you can use to identify the transaction and an
eventCode that indicates the transaction status.
Configuring the Component
Create an instance of the Google Pay Component, specifying:
configuration.merchantName: The merchant name you want to appear on the Google Pay payment sheet.
emailRequired: Set this to true if you want to collect the shopper's email address.
shippingAddressRequired: Set to true to request the shopper's full shipping address.
shippingAddressParameters: Used to set any shipping restrictions.
buttonType: Specify the type of button you want displayed on the payment form.
buttonColor: Specify the color of the button you want displayed on the payment form.
Testing Google Pay payments
To test Google Pay, you must:
- Login to a real Google account.
- Create a Google Pay wallet with valid card details. Google Pay does not accept test cards.
You can check the status of a Google Pay test payment in your Customer Area > Transactions > Payments.
Go live checklist
- Set up notifications for Google Pay.
- If you are using our Android Build your own UI, Web SDK, or API, you must complete all of the steps in the Google Pay deploy to production documentation for Web or for Android.
- If you are using our Web SDK, your
merchantIDmust be configured in Adyen as confirmed by our Support Team and the Google Pay script must be loaded before the Web Checkout SDK is initiated.
Google Pay will be available in production mode if:
- The shopper is logged in to their Google account.
- The shopper has at least one valid payment method on their Google Pay account.