Google Pay for API only
Last updated: August 28, 2024
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 following details 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.