Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 29 Next »

There are two ways to process a credit card:

1. ECOM (which usually requires 3DS)

ECOM payment is the default type and returns 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:

<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.

2. MOTO (without 3DS).

MOTO payment processes the payment without the 3DS check. Once the payment is processed the user will be returned to the predefined return URL with an encoded transaction ID.



Create Credit Card Payment for ECOM

POST /pay/v1/creditcards

Headers

Content-Type string
Content type.

Authorization string
Access token generated from create token request.

User-Agent string
User agent.

Accept string
Accept

Accept-Encoding string
Accept encoding.

Accept-Charset string
Accept charset.

Attributes

payment_intent string
Payment intent token.

paymentToken string
Payment token generated from Create Payment Token request.

type string
Type 1 is ECOM payment and type 2 is MOTO.

raw_amount float
Payment amount.

customer_email string
Customer email.

customer_name string
Customer name.

customer_address string (optional)
User’s address details.

customer_postcode string (optional)
User’s postcode.

transaction_unique string
Transaction unique.

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

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

device_accept_language string
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_resolution string
Device accept language which can be fetched using javascript and assigned to the respective hosted input field. This value is required in 3DS.

remote_address string
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:

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

Request

POST https://secure.blinkpayment.co.uk/api/pay/v1/creditcards 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,
    "raw_amount": 1.1,
    "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

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

<!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

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

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


Create Credit Card Payment for MOTO

POST /pay/v1/creditcards

Headers

Content-Type string
Content type.

Authorization string
Access token generated from create token request.

Attributes

payment_intent string
Payment intent token.

paymentToken string
Payment token generated from Create Payment Token request.

type string
Type 1 is ECOM payment and type 2 is MOTO.

raw_amount float
Payment amount.

customer_email string
Customer email.

customer_name string
Customer name.

customer_address string (optional)
User’s address details.

customer_postcode string (optional)
User’s postcode.

transaction_unique string
Transaction unique.

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

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

Request

POST https://secure.blinkpayment.co.uk/api/pay/v1/creditcards HTTP/1.1
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbG...

{
    "payment_intent": "pi_Swhc84aSLtUGppvPARX...",
    "paymentToken": "eyJwYXltZW50VG9rZW4iOns...",
    "type": 2,
    "raw_amount": 1.1,
    "customer_email": "random@email.com",
    "customer_name": "A Smith",
    "transaction_unique": "PHnRNzjUw...",
    "merchant_data": "{\"my_order_id\": \"cc-12345678\"}"
}

Response

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

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