Google Pay
Last updated: August 14, 2024
Information
Google Pay is also available through Flow. Flow enables you to accept payments on your website using Checkout.com's global network of payment methods with a single integration.
Google Pay enables customers to securely perform one-touch payments on your website or Android app, using any credit or debit card connected to their Google account.
Information
To enable Google Pay in the UAE or Saudi Arabia, contact your Account Manager or [email protected].
To start processing Google Pay payments, you must first integrate directly with Google. Once integration is complete, you can add the Google Pay button to your checkout page and start requesting your customers' encrypted payment information.
Google Pay integration and payments can be simplified into a three-step method:
Information
CRYPTOGRAM_3DS
credentials receive liability shift by default. Applying 3DS for Google Pay enables liability shift for PAN_ONLY
transactions.
Note
Before going live, you are required to register with Google Pay & Wallet Console and select Checkout.com as your payment processor. You will also need to set up an allowlist for your domain. Note that you must be signed in as a Google Developer to do this. If not, you will be redirected to Google Pay's support page.
Information
For information on integrating with Google Pay, first, refer to the Google Pay API guide.
When you submit a payment data request to the Google API, be sure to include the following parameters:
'gateway': 'checkoutltd'
'gatewayMerchantId': '<your public key>'
1{2"type": "CARD",3"parameters": {4"allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"],5"allowedCardNetworks": ["AMEX", "DISCOVER", "MASTERCARD", "VISA"]6},7"tokenizationSpecification": {8"type": "PAYMENT_GATEWAY",9"parameters": {10"gateway": "checkoutltd",11"gatewayMerchantId": "<YOUR_PUBLIC_KEY>"12}13}14}
Information
You will need to specify which card types and card schemes to support in your payment data request.
Once you have received the payment data from Google, you then need to call Checkout.com’s endpoint for tokenizing the encrypted payment data; you can find this payment data in the paymentMethodToken
property of the Google Pay payment data request's response.
To find out more about Google Pay payment requests, read the Google Pay object reference.
Use the details below to set up your request. To get a detailed view of all required and optional fields, see our API reference.
post
https://api.checkout.com/tokens
1{2"type": "googlepay",3"token_data": {4"protocolVersion": "ECv1",5"signature": "TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ",6"signedMessage": "{\"encryptedMessage\": \"ZW5jcnlwdGVkTWVzc2FnZQ==\", \"ephemeralPublicKey\": \"ZXBoZW1lcmFsUHVibGljS2V5\", \"tag\": \"c2lnbmF0dXJl\"}"7}8}
1{2"type": "googlepay",3"token": "tok_ubfj2q76miwundwlk72vxt2i7q",4"expires_on": "2018-10-22T15:44:03Z"5}
Now you have the token, it's time to authorize the payment. Take the token, and use it in the body of a card token payment request from your application or website's back-end server.
Google Pay offers two authentication modes:
PAN_ONLY
- the card is stored on file with your customer's Google account. Thus, the payment credentials are not bound to an Android device (for example, desktop or non-Android mobile web).CRYPTOGRAM_3DS
- Google Pay offers SCA compliance by binding payment credentials to an Android device and allowing issuers to delegate the authentication to Google for all subsequent payments on that device.
Find out below how you can comply with SCA requirements for PAN_ONLY
scenarios.
Google Pay transactions authenticated with 3DS can benefit from liability shift in the following scenarios:
- the cardholder added their card directly to Google Chrome or a Google product: the card will be saved as a Funding Primary Account Number (FPAN) and will support liability shift for transactions explicitly authenticated with 3DS
- the cardholder added their card to the native Google Pay app using their Android device: the card will be saved as a Device Primary Account Number (DPAN) and will support liability shift, as authentication happened when the card was added
Card networks may downgrade a transaction's liability shift during the authorization stage, despite the ECI value indicating the downgrade occurred during authentication. The liability shift outcome is determined after authorization.
Information
To benefit from liability shift for Visa transactions processed using Google Pay, Visa requires you to opt in to Fraud liability protection for Visa device tokens.
Once you have received the payment data from Google, you first need to get the Checkout.com token to encrypt the payment data. You then receive a new token_format
in the response to help you identify whether or not subsequent payments using this token already meet SCA requirements.
token_format | SCA compliance |
---|---|
| Google handles the authentication and provides a payload that meets the SCA requirements. |
Note
In cases where the Google Pay payment does not require a 3D Secure setup (for example, payments using a CRYPTOGRAM_3DS
token), we will handle the non-3DS authorization request.
token_format | SCA compliance |
---|---|
| For in-scope transactions, the payment should use a 3D Secure exemption or be processed as 3D Secure. |
1{2"type": "googlepay",3"token": "tok_xac73j6l7rue7freatxtonf3pi",4"expires_on": "2021-09-15T11:14:15Z",5"expiry_month": 12,6"expiry_year": 2026,7"last4": "1111",8"bin": "411111",9"token_format": "pan_only"10}
After receiving your token, you can authenticate the transaction as follows:
- Include the Google Pay token in the payment request body.
- To process this transaction as a 3D Secure payment, set the
3ds.enabled
field totrue
as in the request example below.
1{2"source": {3"type": "token",4"token": "tok_lrn2umaznynuvkcjc6unno663u"5},6"amount": 1234,7"currency": "GBP",8"3ds": {9"enabled": true10}11}
If the card is enrolled in 3D Secure, you will receive a 202 Success
response. This response contains a redirect link for your customer.
1{2"id": "pay_hl4k4b5n6pfklmfayflhzw3ovq",3"status": "Pending",4"customer": {5"id": "cus_rtr7qq37wzhujcp5iv36qys43i"6},7"3ds": {8"downgraded": false,9"enrolled": "Y"10},11"_links": {12"self": {13"href": "https://api.sandbox.checkout.com/payments/pay_hl4k4b5n6pfklmfayflhzw3ovq"14},15"redirect": {16"href": "https://3ds2-sandbox.ckotech.co/interceptor/3ds_bicq62vdvrbuznjzcmcfrhtswy"17}18}19}
We also support the ability to make payments using Google Pay tokens that you have decrypted. To make use of this feature, use the network_token
source type and specify the token_type
as googlepay
. This source type allows you to provide the details about the token, as well as the cryptogram and ECI value obtained from the Google Pay token.
Use the details below to set up your request.
You can find the full list, as well as complete request and response examples, in our API reference.
post
https://api.checkout.com/payments
1{2"source": {3"type": "network_token",4"token": "4242424242424242",5"token_type": "googlepay",6"expiry_month": "10",7"expiry_year": "2025",8"eci": "06",9"cryptogram": "AgAAAAAAAIR8CQrXcIhbQAAAAAA="10},11"amount": 1000,12"currency": "USD"13}
If the approved
field is true
, your authorization was successful. If your authorization was not successful, it's possible the payment used an invalid/expired card, or a valid card with an insufficient available balance.
Information
A successful response will include a payment_account_reference
value, which is a unique reference to the underlying card for network tokens. If the card scheme provided us with an eci
value, it will be included in the response. The value indicates the security level that the card scheme decided to request the payment with.
To test Google Pay payments, you must first create a test Checkout.com account.
You'll then be able to simulate different payment flows using our test cards in your sandbox environment. Google also offers mock test cards, which you can add to your wallet.
If you perform a payment with a real card in Google's test environment, Google Pay provides a test card in the encrypted payment data. This ensures that no actual transaction takes place.
Note
This automatic payment data encryption for testing is unique to Google Pay. Do not perform tests for any other payment method using real card numbers or card details in your sandbox environment.