Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

Please go to Google Pay Payment Page to see how to load the Google pay button.

Google Pay may require a 3DS. The response will return an acsform, which is a HTML from used to perform the 3DS authentication.

A HTML page should be send to the user which include the acsform in the body and the following JS in the header:

Code Block
<script>
  onload = () => document.forms[0].submit();
</script>

The user will complete the 3DS form and submit.

After submission, the user will be returned to the predefined return URL with an encoded transaction ID.

Anchor
gp-process
gp-process
Process Google Pay

POST /pay/v1/googlepay

Headers

Content-Typestring
Content type.

Authorizationstring
Access token generated from create token request.

User-Agentstring
User agent.

Acceptstring
Accept

Accept-Encodingstring
Accept encoding.

Accept-Charsetstring
Accept charset.

Attributes

payment_intentstring
Payment intent token.

paymentTokenstring
Payment token generated from Create Google Payment Token request.

typestring (optional)
Type 1 is ECOM payment and type 2 is MOTO. For Google Pay, the value must be 1.

amountfloat (optional)
Payment amount. If not present, it will fetch value from Intent resource.

resourcestring
The resource value for google pay must be googlepay.
The resource value will be in the gpElement form.

customer_emailstring (optional)
Customer email. If not present, it will fetch value from the ccElement form.

customer_namestring (optional)
Customer name. If not present, it will fetch value from the ccElement form.

customer_addressstring (optional)
User’s address details. If not present, it will fetch value from the ccElement form.

customer_postcodestring (optional)
User’s postcode. If not present, it will fetch value from the ccElement form.

transaction_uniquestring
Transaction unique.

device_timezoneinteger
Device timezone value which can be fetched using javascript and assigned to the respective hosted input field. This value is required in 3DS.

device_capabilitiesstring
Device capabilities which can be fetched using javascript and assigned to the respective hosted input field. This value is required in 3DS.

device_accept_languagestring
Device accept language which can be fetched using javascript and assigned to the respective hosted input field. This value is required in 3DS.

device_screen_resolutionstring
Device accept language which can be fetched using javascript and assigned to the respective hosted input field. This value is required in 3DS.

remote_addressstring
Remote address which can be fetched using javascript and assigned to the respective hosted input field. This value is required in 3DS.

merchant_data json (optional)
The merchant can add custom key value pairs in JSON format, for example:

Code Block
{
  "my_order_id": 123,
  "fancy_note": "Order complete",
  "card_discount": false
}

Request

Code Block
POST https://secure.blinkpayment.co.uk/api/pay/v1/googlepay HTTP/1.1
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbG...
User-Agent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36",
Accept: "*/*"
Accept-Encoding: "gzip, deflate, br"
Accept-Charset: ""

{
    "payment_intent": "pi_Swhc84aSLtUGppvPARX...",
    "paymentToken": "eyJwYXltZW50VG9rZW4iOns...",
    "type": 1,
    "amount": 1.1,
    "resource": "googlepay",
    "customer_email": "random@email.com",
    "customer_name": "A Smith",
    "transaction_unique": "PHnRNzjUw...",
    "device_timezone" : "-330",
    "device_capabilities" : "javascript",
    "device_accept_language" : "en-GB",
    "device_screen_resolution" : "1366x768x24",
    "remote_address" : "123.123.123.123",
    "merchant_data": "{\"my_order_id\": \"cc-12345678\"}"
}

Response

Code Block
HTTP/1.1 200 OK
Content-Type: application/json

{
   "acsform": "<form id="form3ds22" method="post" action="https://acs.********"><input type="hidden" name="creq" value="********">
     <input type="hidden" name="threeDSPageSessions[427**************][bfreq]" value="*******">
     <input type="hidden" name="threeDSPageSessions[427**************][threeDSRef]" value="****">
     <input id="btnSubmit" type="submit" class="button expanded btn btn-primary" value="Process Payment">
     </form>"
}

HTML Page

Code Block
<!DOCTYPE html>
<html>
<head>
  <script>
    onload = () => document.forms[0].submit();
  </script>
</head>

<body>
  <form id="form3ds22" method="post" action="https://acs.********"><input type="hidden" name="creq" value="********">
    <input type="hidden" name="threeDSPageSessions[427**************][bfreq]" value="*******">
    <input type="hidden" name="threeDSPageSessions[427**************][threeDSRef]" value="****">
    <input id="btnSubmit" type="submit" class="button expanded btn btn-primary" value="Process Payment">
  </form>
</body>
</html>

Response

Code Block
HTTP/1.1 200 OK
Content-Type: application/json

{
    "url": "https://demo-app.blinkpayment.co.uk/return?transaction_id=BL-MYU12345&status=captured&note=Payment%2BSuccessful&merchant_data=%257B%2522order_id%2522%253A%2522cc-12345678%2522%257D"
}