Versions Compared

Key

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

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.

This

A HTML

form

page should be

added to a page and sent

send to the user

. 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.
MOTO (without 3DS).
MOTO payment is … Process the payment and return to the user defined URL with

which include the acsform in the body and the following JS in the header:

Code Block
<script src="https://code.jquery.com/jquery-3.6.3.min.js" ></script>
<script nonce="2020">
  $(document).ready(function(){
    $('#form3ds22').submit();
      setTimeout(function(){$('#btnSubmit').val('Process Payment');},5500);
  });
</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.


Anchor
cc-process-ecom
cc-process-ecom

Create Credit Card Payment for ECOM

POST /v1/pay/cc/process

Headers

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 Payment Token request.

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

raw_amountfloat
Payment amount.

customer_emailstring
Customer email.

customer_namestring
Customer name.

transaction_uniquestring
Transaction unique.

device_timezoneinteger
Device timezone value which can be fetched using javascript. This value is required in 3DS.

device_capabilitiesstring
Device capabilities which can be fetched using javascript. This value is required in 3DS.

device_accept_languagestring
Device accept language which can be fetched using javascript. This value is required in 3DS.

device_screen_resolutionstring
Device accept language which can be fetched using javascript. This value is required in 3DS.

remote_addressstring
Remote address which can be fetched using javascript. This value is required in 3DS.

Request

Code Block
POST https://secure.blinkpayment.co.uk/api/v1/pay/cc/process
Content-Type: application/json
Authentication: Bearer eyJ0eXAiOiJKV1QiLCJhbG...
User-Agent: ......
Accept: .....
Accept-Encoding: ....
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" : "-3**330",
    "device_capabilities" : "java**javascript",
    "device_accept_language" : "en-G*GB",
    "device_screen_resolution" : "1360x7****1366x768x24",
    "remote_address" : "10********123.123.123.123"
}

Response

Code Block
{
   "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>
  <title>Page Title</title>
  <input<script idsrc="btnSubmit" type="submit" class="button expanded btn btn-primary" value="Process Payment">
https://code.jquery.com/jquery-3.6.3.min.js" ></script>
  <script nonce="2020">
    $(document).ready(function(){
      $('#form3ds22').submit();
        </form>"
}

HTML Form

Code Block
<!DOCTYPE html>
<html>
<head>
  <title>Page Title</title>setTimeout(function(){$('#btnSubmit').val('Process Payment');},5500);
    });
  </script>
</head>

<body>
  <h1>3DS</h1>
  <div>
    <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>
  </div>
</body>
</html>

Response

Code Block
{
    "url": "https://api-demo-php.blinkpayment.co.uk/return?res=QkwtTVlV......%3D%3D"
}

Anchor
cc-process-moto
cc-process-moto

Create Credit Card Payment for MOTO

POST /v1/pay/cc/process

Attributes

payment_intentstring
Payment intent token.

paymentTokenstring
Payment token generated from Create Payment Token request.

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

raw_amountfloat
Payment amount.

customer_emailstring
Customer email.

customer_namestring
Customer name.

transaction_uniquestring
Transaction unique.

Request

Code Block
POST https://secure.blinkpayment.co.uk/api/v1/pay/cc/process
Content-Type: application/json
Authentication: 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..."
}

Response

Code Block
{
    "url": "https://api-demo-php.blinkpayment.co.uk/return?res=QktTVlV......%3D%3D"
}