When the shopper selects Google Pay, the Android Component shows the Google Pay payment form where the shopper selects the card they want to use.
This page is for v5.0.0, released in October 2023. If you are using an earlier version, use the guide for earlier versions instead.
Requirements
Choose which server-side flow your integration uses.
API reference
Set up the Component
1: Check if Google Pay is available
If Google Pay isn't available, do not launch the Component or show the Google Pay button.
2: Show the Google Pay button
If Google Pay is available, show the Google Pay button.
Launch Google Pay
When the shopper selects the Google Pay button, launch Google Pay and start the payment flow.
Pass your activity and the request code. The request code is a constant integer value that you need to handle the activity result in the next step.
Handle the activity result
Implement onActivityResult
in your activity:
The Component completes the payment flow.
Test and go live
To start testing Google Pay, log in to a Google account and create a Google Pay wallet.
There are two approaches to using this wallet for testing:
You can check the status of a Google Pay test payment in your Customer Area > Transactions > Payments, whether you used a card from the test card suite or or not. Remember that cards outside the test card suite are mapped to an Adyen test card of the same brand.
For more information, see Google Pay's test environment for Android.
Before you go live
We recommend that you test the scenarios described in Google Pay’s API reference for Android in your live environment.
- Make sure that your API credential has the API Clientside Encryption Payments role. Check this in your live Customer Area or ask your Admin user to verify.
- Go to your live Customer Area to configure your Google Merchant ID.
- Complete all the steps in the Google Pay API deploy to production documentation for Android.
In the live environment, note that Google Pay will only be available if:
- The shopper is logged in to their Google account.
- The shopper has at least one valid payment method on their Google Pay account.