Skip to main content

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 NameStateData TypeDescription
paymentMethodMandatoryStringThis must be set to googlepay
cardDetailsMandatoryObjectSee the cardDetails table.

cardDetails

Card Details
Field NameStateData TypeDescription
cryptogramMandatoryObjectThe 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.
cardholderNameOptionalStringThe 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.

Google Pay Direct Response example

{
"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 NameData TypeDescription
accountIdStringUnique reference for the store processing the transaction, as passed in the request.
amountDecimalTotal amount of the order including decimal places where applicable. 'Whole' amounts (e.g. '1') on a GBP account represents £1.00.
authCodeStringAuthorisation code issued for the transaction.
authDateTimeUTCStringDate and time of when the transaction was authorised with the acquirer.
avsHouseNumberResultStringConfirms the result of the Address Verification System (AVS) house number check.
Not SetHouse Number check was not requested.
Not CheckedHouse Number could not be checked.
MatchedHouse Number matched.
Not MatchedHouse Number did not match.
Partial MatchHouse Number partially matched.
avsPostcodeResultStringConfirms the result of the Address Verification System (AVS) post code check.
Not SetPost Code check was not requested.
Not CheckedPost Code could not be checked.
MatchedPost Code matched.
Not MatchedPost Code did not match.
Partial MatchPost Code partially matched.
cardExpiryDateStringExpiry date for the card used in the transaction. Provided in the “MM/YY” format.
cardholderNameStringCardholder name as entered on the payment form.
cardIssuingCountryString

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.

cardPanStarredStringStarred PAN for the card used in the transaction - for example ************9909.
cardSchemeIdIntegerOptomany Card Scheme ID for the card used in the transaction.
cardSchemeNameStringName of the Card scheme for the card used in the transaction.
cardTokenIdStringOptomany Token ID for the card presented.
charitableDonationDecimalAmount of any charitable donation awarded by the consumer during the transaction process.
cscResultStringConfirms the result of the Card Security Code (CSC) validation check.
Not SetCSC check was not requested.
Not CheckedCSC could not be checked.
MatchedCSC matched.
Not MatchedCSC did not match.
currencyString

Currency of the transaction.

GBPPound Sterling
errorCodeIntegerProvides additional detail should an error have occurred with the transaction.
0No error occurred.
A full list of Error Codes can be found here.
idString

Unique transaction ID.

This ID should be stored as it is required for later transaction actions.

invoiceIdStringOrder/invoice/transaction/basket number generated by the host website, as passed in the request.
messageStringMessage confirming the processing result of the transaction request.
optomanyTerminalIdStringOptomany 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.

EnrollmentAuthentication
Y

Successful.

Y

Successful.

N

Not enrolled.

N

Not authenticated.

A

Attempted.

A

Attempted.

U

Unable to check.

U

Unable to authenticate.

C

Challenge Required*

R

Authentication Rejected*

X

Not Attempted

X

Not Attempted

* 3D Secure v2 Only

As an example an enrolled card which has been fully authenticated will be returned as Y/Y

paymentMethodString

Payment method used for the transaction.

googlepayGoogle Pay
responseCodeStringReturned by the acquirer detailing the result of the transaction. A full list of Response Codes can be found here.
rrnStringUnique reference allocated by Optomany to the authorisation.
schemeReferenceDataStringReference data from the card scheme, returned in the authorisation response.

This data may not always be present.
settledBooleanConfirms whether the transaction has been submitted for overnight settlement.
trueTransaction settled.
falseTransaction not settled.
signatureStringSignature generated for the transaction, for more information on this see Validating the Signature.
successBooleanConfirms whether the transaction has been successful.
trueTransaction approved.
falseTransaction not approved.