Accept Google Pay payments using our APIs, and build your own payment form to have full control over the look and feel of your checkout page.
Requirements
Before starting your Google Pay integration:
- Add in your Customer Area.
- Make sure that you have integrated Checkout API v67 or later.
-
Integrate Google Pay API with Adyen as your gateway. Follow the procedure in the Google Pay documentation to integrate your web or Android application.
In the step where you choose a payment tokenization method, choose Gateway. Set adyen as your
gateway
and provide your merchant or company account name in thegatewayMerchantId
parameter.
Build your payment form for Google Pay
Show Google Pay as an available payment method in countries or regions where Google Pay is supported. When the shopper selects Google Pay, they are presented with the payment sheet.
We provide logos for Google Pay which you can use on your payment form. For more information, refer to Downloading logos.
You can also submit a /paymentMethods request specifying:
- countryCode: Country or region where Google Pay is supported. For example, NL.
- amount.currency: Any supported currency. For example, EUR.
- channel: Set this to Web if the payment is being initiated on the web, or Android for in-app payments.
In the response, you receive paymentMethod.type
: googlepay.
Make a payment
-
Get the
token
from thePaymentData
response from the Google Pay API. -
From your server, make a /payments request providing:
paymentMethod.type
: googlepaygooglePayToken
: Thetoken
you received from the Google Pay APIPaymentData
response.
For more information about the fields this token contains, refer to Google Pay API documentation.browserInfo
: Required if you want to trigger 3D Secure authentication.returnUrl
: URL where the shopper will be redirected after completing a 3D Secure authentication.
The response contains the result of the payment.
If the shopper used a card that requires 3D Secure authentication before the payment can be completed, you receive an
action.type
redirect in the response.
- If you received an
action
object, use the information in this object to redirect the shopper to another website to complete the 3D Secure authentication. Otherwise, proceed to presenting the payment result to your shopper.
Cards with 3D Secure: Handle the redirect
If the shopper used a card that requires 3D Secure authentication, you need to redirect the shopper to another website where they complete the authentication. To learn how to handle the redirect, follow our Handling redirects guide.
Present the payment result
Use the resultCode
that you received in the /payments or /payments/details response to present the payment result to your shopper.
The resultCode
values you can receive for Google Pay are: