Set up Adyen Google Pay through REST API
This task guides you through setting up an Adyen Google Pay payment method using the REST API, including obtaining a Google Pay token and enabling the payment method in Zuora.
This article describes how to create an Adyen Google Pay payment method through the REST API operation. The payment method created through this approach is shown as an Adyen Google Pay payment method type in Zuora and an Adyen token for Google Pay is saved. You need to implement your own UI and payment processing integration.
For an end-to-end solution, it is recommended to set up Google Pay through the JavaScript SDK integration. For more information, see Set up Google Pay with Zuora JavaScript SDK .
-
This implementation of Google Pay on Adyen does not support 3D Secure.
-
Adyen Google Pay payment methods created through the method in this article do not support non-referenced refunds.
-
See Adyen documentation for more information about Google Pay availability limitations on Adyen.
-
Enabled the Google Pay integration for your Adyen merchant account to be able to generate Google Pay tokens and process Google Pay transactions as described in Adyen documentation and the checklist before you go live .
-
In your Adyen merchant account, enable the following fields for the additional card data in the Adyen dashboard:
-
Card bin
-
Subvariant
-
Card summary
-
Expiry date
-
-
Ensure that an Adyen Integration v2.0 gateway instance is in active use in your Zuora tenant.
Take the following steps to set up Adyen Google Pay:
After Google Pay is enabled for your Adyen merchant account on the Adyen platform, obtain a Google Pay token from the Google Pay API PaymentData response. For more information about the fields this token contains, refer to Google Pay API documentation .
Take the following steps to enable Adyen Google Pay in Zuora:
- Obtain a Google Pay token.
- Enable Google Pay for Adyen in Zuora.
- Add a new Adyen Google Pay payment method in Zuora.
- In your Zuora tenant, navigate to Payments Settings > Payment Method .
- Click Edit and then select Adyen Google Pay .
- Click Save . The Google Pay payment method is then activated in your Zuora tenant.
Note that no update is required for your existing Adyen Integration v2.0 instance in Zuora to support Google Pay.
After you have enabled Google Pay in your Zuora tenant, you can create an Adyen Google Pay payment method and associate it with a customer account.
Adyen Google Pay payment methods can only be created through the Zuora REST APIs. You can use the Create a payment method API operation to create a new Adyen Google Pay payment method, and the following fields must be specified in the request:
-
accountKey: Specify the customer account ID. This field is required unless the Orphan Payment Method feature is enabled. -
type: SpecifyAdyenGooglePay. -
googlePaymentToken: Specify the stringified Google Pay token.
You can also pass the
shopperEmail
information to the gateway through any of the following methods:
-
Use the
emailfield in any of the following API operations:-
Create a payment method
-
Create an account
-
Create an order
-
Create an order asynchronously
-
-
Use the
gatewayOptionsfield in the Create a payment method API operation.
If
shopperEmail
is not provided through either the
email
or
gatewayOptions
field, the
shopperEmail
field in the payment request is set to the BillTo personal email if it is available. If BillTo personal email is not specified, the
shopperEmail
field is set to the BillTo work email.
The following code is a sample request for creating a new Google Pay payment method:
|
Method and endpoint |
POST https://rest.apisandbox.zuora.com/apps/v1/payment-methods |
|
Request body |
|
In addition to the Create a payment method operation, you can also use the following operations to create a Google Pay payment method together with other objects:
-
Create an account
-
Create an order
-
Create an order asynchronously
Once an Adyen Google Pay payment method is created, it cannot be edited.
After an Adyen Google Pay payment method is successfully created, you can view this payment method from the customer account details page in the Zuora UI or the response of the API operations for retrieving payment methods.
All related information about Adyen Google Pay payment methods can be exported using the
Method Specific Data
field for the Payment Method data source. If you are not familiar with Data Source Exports, see Create a Data Source Export
for instructions.
To filter only specific information about Adyen Google Pay payment methods, you can use several other Payment Method data source fields in combination. The following table provides the mapping relationship between Zuora data source fields and Adyen Google Pay fields.
|
Data source field |
Adyen Google Pay field |
Description |
|---|---|---|
|
Method Reference Id |
GoogleGatewayToken |
The recurringDetailReference returned from Adyen after a successful response. |
|
Sub-Type |
GoogleCardType |
The brand or type of the card. For example, Visa and Mastercard. |
|
User Reference Id |
GoogleCardNumber |
The last 4 digits of the DPAN returned from Adyen as the card summary. |
Note that in the
Credit Card Type
field in the UI and the
googleCardType
field in the API response, Zuora stores the first 100 characters of paymentMethodVariant
returned from Adyen.
After a Google Pay payment method for Adyen has been added to a customer account, it can be used to make payments and refunds through the Zuora UI and all Payments API operations except for CRUD operations.
Zuora's payment numbers are used as references when processing payments. When a payment method is created, a random string is generated and temporarily used as the payment number. It will be updated later with a real Zuora payment number in payment processing.
You can pass the shopperEmail information to the gateway by using the
gatewayOptions
field in the Create a payment
API operation. For more information about the logic of populating the
shopperEmail
field in the request, see Gateway Options fields supported by Adyen Integration v2.0
.
The following Adyen fields are supported for Adyen Google Pay through Zuora's Adyen Integration v2.0:
-
expiryDate
-
paymentMethodVariant
-
cardSummary
-
cardBin