Google Pay™ gateway integration
Google Pay lets your customers pay with the cards in their Google Account.
Armaghast is a payment processor for the Google Pay API. This page explains how to add Google Pay to your website by integrating the Google Pay API into your checkout. Armaghast decrypts the payment token, so your systems never receive card data.
Before you start
You need:
- An Armaghast requestor with Google Pay enabled, its requestor ID and Bearer token. To get them, contact your account manager.
- A business profile in the Google Pay & Wallet Console, with the Google Pay API Terms of Service accepted. The profile gives you the Google merchant ID that you need for production. You can test without it.
Google Pay documentation
- Google Pay Web developer documentation
- Google Pay Web integration checklist
- Google Pay Web Brand Guidelines
Use only the official Google Pay logo and button assets, as described in the Google Pay Web Brand Guidelines, without changing their colors, proportions, or appearance.
Configure the Google Pay request
Set these values in your Google Pay API request.
Gateway and merchant ID
Set the tokenization type to PAYMENT_GATEWAY with these parameters:
| Parameter | Value |
|---|---|
gateway | armaghast |
gatewayMerchantId | Your Armaghast requestor ID |
"tokenizationSpecification": { "type": "PAYMENT_GATEWAY", "parameters": { "gateway": "armaghast", "gatewayMerchantId": "YOUR_REQUESTOR_ID" }}The requestor ID is the {requestorId} value in the API paths, for example
/payments/sale/{requestorId}. Your test and live requestor IDs are different. Find them in the
test console and the live console, or get them
from Armaghast support.
Card networks
Armaghast accepts the card networks that you can set in the allowedCardNetworks parameter,
such as VISA and MASTERCARD. For the full list of networks available to you, contact
Armaghast support.
Armaghast does not limit Google Pay to specific countries or currencies. The countries and currencies that you can accept depend on your Armaghast account configuration and on where Google Pay is available.
Authentication methods
Set the credential types that you accept in the allowedAuthMethods parameter. Armaghast
supports both:
| Value | Credential | 3-D Secure |
|---|---|---|
PAN_ONLY | A card saved in the customer’s Google Account | Risk-based, see below |
CRYPTOGRAM_3DS | A virtual card number with a cryptogram, issued by Google Pay for a card that the customer added to a mobile device | Not required. Google Pay™ authenticates the customer on the device. |
Our existing criteria to selectively trigger 3D Secure (step-up authentication) for normal card transactions based on risk are also applied to Google Pay PAN_ONLY transactions.
You do not need to enable 3-D Secure. When 3-D Secure is required, the API response includes what you need to complete it.
Billing address
Armaghast does not require a billing address for Google Pay payments. If you need the address
for your own purposes, request it with
BillingAddressParameters
and send it in customer.address, as for card payments.
Send the token to Armaghast
When the customer confirms the payment, Google Pay returns a PaymentData object to your
website. The encrypted token is in paymentMethodData.tokenizationData.token.
-
Send the token from your website to your server. Do not parse, change, or store the token. The token is already a JSON string, so do not encode it again.
-
From your server, send a
saleorauthrequest with:paymentMethod:GOOGLE_PAY_TOKENgooglePayToken: the token stringurls.resultUrl: the page where the customer returns after 3-D Secure
Do not include the
cardobject. Armaghast rejects requests that contain both card data and a Google Pay token. -
Handle the response as for a card payment, including 3-D Secure.
{ "paymentMethod": "GOOGLE_PAY_TOKEN", "googlePayToken": "{\"signature\":\"MEYCIQ...\",\"intermediateSigningKey\":{...},\"protocolVersion\":\"ECv2\",\"signedMessage\":\"...\"}", "order": { "...": "..." }, "browser": { "...": "..." }, "urls": { "resultUrl": "...", "webhookUrl": "..." }}The token has a limited lifetime. Send it to Armaghast right away.
The API reference describes the full request and response schemas, error codes, and authentication.
Test your integration
- In the Google Pay
PaymentsClient, setenvironmenttoTEST. - Send requests to the Armaghast test environment:
https://SERVER_NAME/api.
Go live
- In the Google Pay & Wallet Console, submit your website for review. Select Gateway as the integration type. See Publish your integration.
- After Google approves your website, set
environmenttoPRODUCTIONandmerchantInfo.merchantIdto your Google merchant ID. - Send requests to the Armaghast live environment. Use your live requestor ID in the API
paths and in
gatewayMerchantId.
FAQ
How do I test before going live?
Set environment to TEST in the Google Pay PaymentsClient and send requests to the
Armaghast test environment with your test requestor ID. In the TEST environment, you do not
need a Google merchant ID.
My integration works in TEST but fails in PRODUCTION. What should I check?
Check that Google approved your website in the Google Pay & Wallet Console, that
merchantInfo.merchantId is your Google merchant ID, that environment is PRODUCTION, and
that you use your live requestor ID in the API paths and in gatewayMerchantId.
Who approves my website for Google Pay?
Google. Submit your website in the Google Pay & Wallet Console, as described in Publish your integration. Armaghast does not approve your website for Google Pay.