- Guides
21 December 2023
Google Pay™ Integration
How it works
Customer clicks the Google Pay button. Using the Google API, your system initiates the Google Pay request identifying Till Payments as your payment gateway, passing your Till Payments merchant ID as the gateway merchant ID.
Customer confirms the payment. The Google API contacts Google Pay services to retrieve the consumer’s payment parameters.
Google creates encrypted payment data using the gateway-specific key that is supplied in the Wallet request and includes it in the Google API response. Google Pay callback returns the encrypted payment data.
Your system prepares the Google Pay response information for submission to the Till Payments service. Till Payments sends the authorization request to the Payment network. The payment network processes the request and creates the issuer authorization request.
The issuer processes the request from the payment network. The issuer looks up the payment information and returns an approved or declined authorization message to the payment network.
The payment network returns the authorization response to Till Payments. Till Payments returns the authorization response to your system.
Your system returns the authorization response to the payment application, so the Customer knows the transaction is either successful or unsuccessful.
Prepare
The following topics describes integrating Google Pay with a website or web application.
Sign up with Google PayTM
Before you begin, set up a Merchant account with the Google Pay and proceed integrating in reference to the below links:
· Google Pay Web developer documentation
· Google Pay Web integration checklist
· Google Pay Web brand guidelines
Set up Merchant account
To start accepting Google Pay payments, you will need to be registered with Till Payments as one of our merchants. Once you are registered, we will provide you with two values gateway and gatewayMerchantId for you to request a payment token from Google Pay. Set Till Payments as your gateway and use merchantId that we will provide you as your gatewayMerchantId. You may then pass the payment token information to Till Payments to process the payment.
Supported Google Pay Experiences
Card Schemes supported
Visa
Mastercard
Diners
Discover
Amex
JCB
Card authentication methods supported
PAN_ONLY
This is used for cards stored against your Google account. To get protection against chargebacks you
might need to consider enabling 3DSecure
CRYPTOGRAM_3DS
This authentication method is associated with cards stored as Android device tokens. Returned payment data includes a 3-D Secure (3DS) cryptogram generated on the device.
Transaction
High level flow
Tokenise
When a customer on your website presses the payment button, submit a payment data request to the Google API with the following parameters:
'gateway': 'tillpayments'
'gatewayMerchantID': '<your merchant id>'
For example:
'allowedPaymentMethods': ['CARD','TOKENIZED_CARD'], 'paymentMethodTokenizationParameters': {
'tokenizationType': 'PAYMENT_GATEWAY', 'parameters': {
'gateway': 'tillpayments' 'gatewayMerchantId': ''
}
}
The Google Pay API will return a Payment Method Token that contains the payment data of the customer. This is an example of the Payment Method Token structure that will be returned.
{
"protocolVersion":"ECv2", "signature":"MEQCIH6Q4OwQ0jAceFEkGF0JID6sJNXxOEi4r+mA7biRxqBQAiAondqoUpU/bdsrAOpZIsrHQS9nwiiNwOrr24Ry PeHA0Q\u003d\u003d",
"intermediateSigningKey":{ "signedKey":
"{\"keyExpiration\":\"1542323393147\",\"keyValue\":\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE/1+3HBVSbdv+j7NaAr dgMyoSAM43yRydzqdg1TxodSzA96Dj4Mc1EiKroxxunavVIvdxGnJeFViTzFvzFRxyCw\\u003d\\u003d\"}",
"signatures": ["MEYCIQCO2EIi48s8VTH+ilMEpoXLFfkxAwHjfPSCVED/QDSHmQIhALLJmrUlNAY8hDQRV/y1iKZGsWpeNmIP+z+tCQHQxP0v"
]
},
"signedMessage":"{\"tag\":\"jpGz1F1Bcoi/fCNxI9n7Qrsw7i7KHrGtTf3NrRclt+U\\u003d\",\"ephemeralPublicKey\":\"BJaty FvFPPD21l8/uLP46Ta1hsKHndf8Z+tAgk+DEPQgYTkhHy19cF3h/bXs0tWTmZtnNm+vlVrKbRU9K8+7cZs\\u003d\",\"encrypted Message\":\"mKOoXwi8OavZ\"}"
}
Transact
The resulting token from the Google Pay must be submitted in the tokenData element of the /payment endpoint, with the walletType GOOGLE_PAY
Example
Endpoint: https://api.tillpayments.com/payment
{
"merchantData": { "merchantTransactionId": "6545234",
"transactionUUID": "a7505e59-d5ce-429e-bfe1-a66f6cb6239a"
},
"amount": 8.25,
"currency": "AUD", "autoComplete": true, "description": "Garden", "register": false, "channel": "ECOMMERCE", "customer": {
"externalReferenceId": "", "firstName": "Hayden", "lastName": "Nader",
"dob": "1998-06-10",
"gender": "M",
"emailId": "Dedrick_Cruickshank@yahoo.com", "billingAddress": {
"addressLine1": "776 Axel Forks", "addressLine2": "929 Bergstrom Brook", "city": "East Ellie",
"state": "Barbados", "postcode": "7184947", "country": "NZ",
"phone": "814-839-8826"
},
"shippingFirstName": "Audreanne", "shippingLastName": "Schuppe", "shippingCompanyName": "Lang - Spinka", "shippingAddress": {
"addressLine1": "345 Quigley Dam", "addressLine2": "05312 Lester Turnpike", "city": "Juniusmouth",
"state": "Somalia", "postcode": "1437000", "country": "AW"
},
"createdDate": "2022-05-12T03:27:12.188Z",
"lastModifiedDate": "2022-05-12T03:27:12.188Z"
},
"paymentMethod": { "type": "WALLET",
"wallet": {
"type": "GOOGLE_PAY",
"tokenData": "{\"signature\":\"MEQCIFCfTskqeObdMr1kCMMLHPXVYGTuG0DpH7pwUTms4WlR AiBvRK4HPVd0b2N2xIWslQ3Ag/sivRlbAsRs5GOL+5zcVg\\u003d\\u003d\",\"intermediateSigningKey\":{
\"signedKey\":\"{\\\"keyValue\\\":\\\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEuOy1qZvvxvhuSpF+a Rn2xlF/VT7/8a1VwYkFT9vt56YLqQGeXleQ0116yjCtzFogZ+Ym3wLZBIpXg8+Uh6Vb4Q\\\\u003d\\\\u003d\\\"
,\\\"keyExpiration\\\":\\\"1695342001635\\\"}\",\"signatures\":[\"MEQCIDEy2ZPa8q6QnQn2B9XAl XMwr1pck41kt/mopmYwgEX1AiB/1Da0GeLjH9qYXmcU47xqYkHkDoXNKarcrw8g1U4vlw\\u003d\\u003d\"]},\"p rotocolVersion\":\"ECv2\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"LzXde4Uzflb7Peg 4dyuy+R96CH4nCVhWNLBCq/09hdoKcHhPD+zixrmYuXnNRoIxPj61LaLQJGtUc5IDpEuDsXdl83aluu4hP39dIOnY8t FVd4P0+T1U7SvSA5e1PcdjBH3PmAzm3YWPE3bTn8/3g8K0h3yliN7q1IyKni1Zms+kIQlQ3/KxZpkN3uTftoZ8WKxb2 HaEXl//pS8N5BEl7MBncQMeI/0qACSUd1CupVovOPOxqlXTIcK7aItsTGwBYjnawPEGg3AMbwqW0XOxT33vB/hqy3jd LPyI9p+X+PVHigNPNRNSTwRIkHBgfd+yi+ZGXTiTl5xQWVhCbSfOF8O2SzWXW0cEe/baGrQYFi30l7YW8eTYIVmPpn1 Codo24C3dBRJV4XeQxCuF8tIOctzIJciE/wFGFbVEpAso0fi4o8eFLk+4nKW/u+Rz3rLjNKGNMYaGiXWie2fpYJ5EBPCVhJK67jGuofl98rnXj84UMHgk0bqXDpciyokf9075OEPsoPIQQb2Pxuvn78qp0Ocv0EAm0nZZg5X+n8B1+ZIym9MkO qI9p1cUcYkVFBhuvj3dbk7WxT53CSJSr5/1pRGTn+kND2F/OT9abnCvxQ\\\\u003d\\\\u003d\\\",\\\"ephemer alPublicKey\\\":\\\"BFFbHAU/1smg1JV0cjD8w+Phm6hNQH3e9wTVYp0K6gS4FTS8b8Kw77y5jp+6buyE3JvxbzJ rjaXf8IBej2DuTSQ\\\\u003d\\\",\\\"tag\\\":\\\"Z7HsN2JuktjEZmTOI+BaFXVtFL+9Lbc7EWhHxQluLeQ\\
\\u003d\\\"}\"}"
}
}
}
Test
There are two final steps before your platform is fully approved for production.
· Test and Certify with Google
· Test with Till Payments
Certify with Google
Before your platform can fully integrate with Google, the Google Pay team must clear your final integration for production. After you have completed each part of the integration checklist, which includes testing your integration, navigate to your Google Pay Business console to get started.
Certify with Till Payments
To ensure that we can decrypt your Google Pay Token, test the flow from creating the Google Pay Token to using that token to create a payment with us.
Production
Upon successful completion of the certification with Google and Till Payments, Till will provide the Prod Merchant API key, gatewayId and gatewayMerchantId for transaction initiation in Prod.