Google Pay
In order to use the google_pay
payment method with our Payments API, it is assumed that you, as a merchant, have completed your own integration with Google Pay.
We do not have the ability to decrypt the blob received from Google Pay as it should be encrypted for you, so we expect that you are decrypting the encrypted blob to obtain the payment token.
You then need to parse the payment token and provide the relevant payment details and cryptogram to complete the payment.
Attribute Translation
Once you have decrypted the Google token, the information you need is in the paymentMethodDetails
element.
Our Attributes | paymentMethodDetails Attributes |
---|---|
number | pan |
expiry_year | expirationYear |
expiry_month | expirationMonth |
cryptogram | cryptogram |
Notes
If the Google Payment Token's paymentMethodDetails
dictionary contains an eciIndicator
value, you MUST supply that using the ecommerce_flag
attribute. The payment will not be approved if this value is omitted.
Google's paymentMethodDetails
dictionary never contains the customer's name. You could obtain this either through your own checkout procedure, or through the billingAddress
element if that was returned from Google.
Examples
These values should not be taken to be representative of real-world values. These examples are merely to indicate the expected payload structure.
POST /payments
{
"amount": 100,
"terminal": {"gateway_id": "YOUR_GW_ID"},
"customer": {
"name": "Bob Jones"
},
"payment_method": {
"google_pay": {
"number": "4111111111111111",
"expiry_month": "05",
"expiry_year": "2024"
}
}
}
POST /payments
{
"amount": 100,
"terminal": {"gateway_id": "YOUR_GW_ID"},
"customer": {
"name": "Bob Jones"
},
"payment_method": {
"google_pay": {
"number": "4111111111111111",
"expiry_month": "05",
"expiry_year": "2024",
"cryptogram": "kiwewruhflkjsdfblaseufh"
}
},
"options": {
"ecommerce_flag": "07"
}
}
Updated over 3 years ago