Payment Request
The final step in Google Pay Direct is to send the Google Pay Token to DNA as part of a Payment Request. A full range of fields available in this request can be seen here however for an Google Pay only request, please see the following example:
Payment Request Code Example
{
"auth": {
"access_token": "S3zz29FZM!UN1OkArVpks89l7-nES0IW4QplhLcwuVJ9fstysIn6vwOa$7WDIHGV",
"expires_in": 7200,
"refresh_token": "tgIfmoulVaWsJia=Qzv-gt038p*JCWvTdaf8Dz9NOBBS8.2k79dG3j-5vJLbGGi_",
"scope": "payment integration_hosted integration_embedded integration_seamless",
"token_type": "Bearer"
},
"currency": "GBP",
"description": "Car Service",
"paymentSettings": {
"returnUrl": "https://test-pay.dnapayments.com/checkout/success.html",
"failureReturnUrl": "https://test-pay.dnapayments.com/checkout/failure.html",
"callbackUrl": "https://pay.dnapayments.com/checkout",
"failureCallbackUrl": "https://testmerchant/order/1123/fail",
"terminalId": "8911a14f-61a3-4449-a1c1-7a314ee5774c"
},
"customerDetails": {
"accountDetails": {
"accountId": "uuid000001"
},
"billingAddress": {
"firstName": "John",
"lastName": "Doe",
"addressLine1": "Fulham Rd",
"postalCode": "SW6 1HS",
"city": "London",
"country": "GB"
},
"email": "demo@dnapayments.com",
},
"invoiceId": "1639037527510",
"amount": 24,
"paymentMethod": "googlepay",
"cardDetails": {
"cryptogram": "{\"signature\":\"MEYCIQD+O+UV9ft619UUNoWvIWT4mLAgrgGQXYFK2IIGOmLLzgIhAJciGUvVI2eHadA44zR48LQqMFnN7t+sI3h67nqCj306\",\"intermediateSigningKey\":{\"signedKey\":\"{\\\"keyValue\\\":\\\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEIyLNgkZZbiiKMV7JEXlSC7y93PBSSPPqkICJv6dDRFcZQREvCwOn++1y7GAiTGA+DZHfi+KmaCiAaalEamipKw\\\\u003d\\\\u003d\\\",\\\"keyExpiration\\\":\\\"1639711023495\\\"}\",\"signatures\":[\"MEYCIQCXGvRFL9LidQD9YnrwyN9D7GUUbaKg7v9+U3KmDTyR/wIhANIkwo7qzKgR2V2F2gj5/1KByDRhAgle5Q2Lw/35iUkV\"]},\"protocolVersion\":\"ECv2\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"UbvBAK7r+aSGjsuncFTDESEoRtyoBGAvLfGNFyIhNYfCgDV7yhtnaFMNs6eXSh2medC1rWTtnn9geI33xvad4MePO/wJ2RswFwMTYPc1AosEO+mJ1eYUq6D9DR1Uf/ZZL5qaxVvk+xmIKhKcGv8IVbwzok+aFoHtaYkRrqbJDck+iCgRkFxjxvsUbpReBX8gu7hrYf2/n1/ebNjf0rvjkjfGBNelWCGVxJzgf7eJS5GGlRcvJl7IqDTw5XDEuRm4EBzkDgTpLMSVRRtyafaLf12BJa6qiMqKFEVRYnbCj2rnq9W9TpurCBbNNAQVsiF5QEfliV98DXbfRlO4JlnFy9WlE2rMzi4g2Vz2KLE4hSzO9EsL0UcUGvUEZYycnqNRCwg7FX8l0uw5qBx7izv1i1oIA3ywExNRjx6AXmYiow2nL1pAGFjzl2dCj4P/VZ5W/7g/9bjVIjUWOi1AFcbOGK2zLaiSF2C9QjN0z0a4iwFeDzQ93IPLJYlt+bEdQNw6LIGKtZWEE54J3IJvaLfKwFVwb7AtQDGyrKDmNTPOkOfNW+TfY8uesqu3JNDYL/wQv9Rk1wZiVtgzIuFxVHwsaM6w4BJ25P9Wz7FFcp3ZIY/mHkM\\\\u003d\\\",\\\"ephemeralPublicKey\\\":\\\"BPpWoZzgZ+meT+6dRs1yAdCwJg7Rh/JcktbNkUcncptxQOFcUXy83KCcp1/on3TJYolyD0hKgSLOMJQkAtblnZE\\\\u003d\\\",\\\"tag\\\":\\\"qD/WuLmyw3nTr8trLSA+lEQgum/e7SXOm1mEocfPxs8\\\\u003d\\\"}\"}",
"cardholderName": "John Doe"
}
}
Payment Request
Most of these fields are documented elsewhere, however the key new components of this request are in the table below.
Payment Request | |||
---|---|---|---|
Field Name | State | Data Type | Description |
paymentMethod | Mandatory | String | This must be set to googlepay |
cardDetails | Mandatory | Object | See the cardDetails table. |
cardDetails
Card Details | |||
---|---|---|---|
Field Name | State | Data Type | Description |
cryptogram | Mandatory | Object | The cryptogram contains the token Object ONLY. This contains the data received from Google in earlier steps. It should be passed in as shown in the example above. |
cardholderName | Optional | String | The name of the shopper. |
Payment Response Code Example
You will receive a response at the returnUrl
specified in the paymentSettings
block above and as documented in the Ecommerce section.
{
"accountId": "uuid000001",
"amount": 24,
"authCode": "802258",
"authDateTimeUTC": "2021-12-09T08:12:32.003851795Z",
"avsHouseNumberResult": "Not Checked",
"avsPostcodeResult": "Not Checked",
"cardExpiryDate": "12/26",
"cardPanStarred": "***************1111",
"cardSchemeId": 11,
"cardSchemeName": "VISA",
"cardTokenId": "3UGTOmzrP+Y8onM5wsQCc2eIjeZDpoBKqP3Mem80Re0fMQ==",
"cardholderName": "John Doe",
"cscResult": "Not Set",
"currency": "GBP",
"errorCode": 0,
"id": "96eec0f7-f95e-42c1-b8d0-261f7365b0b9",
"invoiceId": "1639037527510",
"message": "Completed successfully",
"payerAuthenticationResult": "-/-",
"paymentMethod": "googlepay",
"responseCode": "00",
"rrn": "e70f5f64-ed7b-42a6-9a9a-e6cfcc5b3a3b",
"settled": false,
"status": "succeeded",
"success": true
}
Payment Response Fields
These fields are documented below. None of these are specific to Google Pay.
paymentResult | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Field Name | Data Type | Description | ||||||||||||||||||||||||||||
accountId | String | Unique reference for the store processing the transaction, as passed in the request. | ||||||||||||||||||||||||||||
amount | Decimal | Total amount of the order including decimal places where applicable. 'Whole' amounts (e.g. '1') on a GBP account represents £1.00. | ||||||||||||||||||||||||||||
authCode | String | Authorisation code issued for the transaction. | ||||||||||||||||||||||||||||
authDateTimeUTC | String | Date and time of when the transaction was authorised with the acquirer. | ||||||||||||||||||||||||||||
avsHouseNumberResult | String | Confirms the result of the Address Verification System (AVS) house number check.
| ||||||||||||||||||||||||||||
avsPostcodeResult | String | Confirms the result of the Address Verification System (AVS) post code check.
| ||||||||||||||||||||||||||||
cardExpiryDate | String | Expiry date for the card used in the transaction. Provided in the “MM/YY” format. | ||||||||||||||||||||||||||||
cardholderName | String | Cardholder name as entered on the payment form. | ||||||||||||||||||||||||||||
cardIssuingCountry | String | Country where the card was issued. This information will only be returned when this can be determined. This information is subject to change and as such we recommend only using this data as a guide. | ||||||||||||||||||||||||||||
cardPanStarred | String | Starred PAN for the card used in the transaction - for example ************9909. | ||||||||||||||||||||||||||||
cardSchemeId | Integer | Optomany Card Scheme ID for the card used in the transaction. | ||||||||||||||||||||||||||||
cardSchemeName | String | Name of the Card scheme for the card used in the transaction. | ||||||||||||||||||||||||||||
cardTokenId | String | Optomany Token ID for the card presented. | ||||||||||||||||||||||||||||
charitableDonation | Decimal | Amount of any charitable donation awarded by the consumer during the transaction process. | ||||||||||||||||||||||||||||
cscResult | String | Confirms the result of the Card Security Code (CSC) validation check.
| ||||||||||||||||||||||||||||
currency | String | Currency of the transaction.
| ||||||||||||||||||||||||||||
errorCode | Integer | Provides additional detail should an error have occurred with the transaction.
| ||||||||||||||||||||||||||||
id | String | Unique transaction ID. This ID should be stored as it is required for later transaction actions. | ||||||||||||||||||||||||||||
invoiceId | String | Order/invoice/transaction/basket number generated by the host website, as passed in the request. | ||||||||||||||||||||||||||||
message | String | Message confirming the processing result of the transaction request. | ||||||||||||||||||||||||||||
optomanyTerminalId | String | Optomany Terminal ID used when authorising the transaction. | ||||||||||||||||||||||||||||
payerAuthenticationResult | String | Result of the Payer Authentication process provided in the following formatenrollment result/authentication result The possible results are detailed below.
* 3D Secure v2 Only As an example an enrolled card which has been fully authenticated will be returned as Y/Y | ||||||||||||||||||||||||||||
paymentMethod | String | Payment method used for the transaction.
| ||||||||||||||||||||||||||||
responseCode | String | Returned by the acquirer detailing the result of the transaction. A full list of Response Codes can be found here. | ||||||||||||||||||||||||||||
rrn | String | Unique reference allocated by Optomany to the authorisation. | ||||||||||||||||||||||||||||
schemeReferenceData | String | Reference data from the card scheme, returned in the authorisation response. This data may not always be present. | ||||||||||||||||||||||||||||
settled | Boolean | Confirms whether the transaction has been submitted for overnight settlement.
| ||||||||||||||||||||||||||||
signature | String | Signature generated for the transaction, for more information on this see Validating the Signature. | ||||||||||||||||||||||||||||
success | Boolean | Confirms whether the transaction has been successful.
|