Versions Compared

Key

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

Repeat payment schedules are those where the user chooses the required setup information, and the payments will be executed automatically on a recurring basis.

There are two types of repeat payment schedules.

  1. Fixed Scheduled Repeat Payment - In this scenario, each payment is taken at a regular frequency for a fixed amount.

  2. Variable Scheduled Repeat Payment - In this scenario, each payment’s date and amount set is completely different.

Both schedules can be created using ECOM or MOTO (see below)


There are two ways to create a repeat payment schedule.

  1. ECOM (which usually requires 3DS) - Customer initiated

ECOM payment uses 3DS 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:

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

The user will complete the 3DS form and submit.

After submission, the user will be redirected to the predefined return URL with an encoded repeat schedule ID.

  1. MOTO (without 3DS) - Merchant initiated

MOTO payment processes the payment without the 3DS check. Once the payment is processed the user will get json response with all the repeat schedule related data.


Each request is authenticated using HTTP Basic Auth by adding a bearer token to the header, e.g. Authentication: Bearer {{access_token}}. You can get the {{access_token}} from the create token request.

A Payment_intent needs to be generated before creating a repeat payment schedule from the create intent request. ccElement is passed as part of the response, which can be implemented to generate payment form and paymentToken ( tokenised card value) from there.

In a PHP implementation, payment page may look like this:

Code Block
<head>
  ...
  <script src="https://code.jquery.com/jquery-3.6.3.min.js"></script>
  <script src="https://gateway2.blinkpayment.co.uk/sdk/web/v1/js/hostedfields.min.js"></script>
  <script src="https://secure.blinkpayment.co.uk/assets/js/api/custom.js"></script>
  ...
</head>

<body>
    <form method="POST" action="update" id="payment">
        @csrf
        {!! $ccElement !!}
        <button type="submit">Submit</button>
    </form>
</body>

Anchor
moto-repeat-payments
moto-repeat-payments

Create Repeat Payment Using MOTO

POST /pay/v1/repeat-payments

Headers

Content-Typestring
Content type.

Authorizationstring
Access token generated from create token request.

Attributes

payment_typestring
Repeat payment type. It must be either of the following values.

  • fixed_schedule

  • variable_schedule

payment_intentstring
Payment intent generated from create intent request.

customer_namestring
Customer name.

customer_emailstring
Customer email.

referencestring
Reference value. Unique textual details of the schedule

customer_addressstring
Customer address.

customer_postcodestring
Customer postcode.

currencystring
Currency that the payments will be processed in

frequencystring
Payment cycle frequency. It is required when creating a Fixed Schedule.
Possible values are

  • days

  • weeks

  • months

frequency_durationinteger
Payment frequency duration. It is required when creating a Fixed Schedule.

start_payment_datedate
Date on which the first payment will be captured. It is required when creating a Fixed Schedule.
Default value set to today.

first_amountdecimal (optional)
First payment amount.
When creating a Fixed Schedule, the first amount value can be customised.

recurring_amountdecimal
Recurring amount for each instalment. It is required when creating a Fixed Schedule.

is_limited_installments boolean
When creating a Fixed Schedule, it is required to mention if the process has unlimited or limited instalments.
Possible values are

  • true

  • false

installmentsinteger
Number of instalments. It is required when creating a Fixed Schedule if the process has limited instalments.

final_amountdecimal (optional)
Final payment amount.
This can be used when creating a Fixed Schedule if there are limited instalments.
If there are unlimited instalments, this field should not be used.

final_payment_datedate (optional)
Date on which the final payment will be captured.
Final date can be customised along with the final amount when creating a Fixed Schedule.
This can only be used if there are limited instalments. If there are unlimited instalments, this field should not be used.
This date must be after the start payment date and also after the 2nd last recurring date.

paymentTokenstring
Tokenised card value. In create intent response, ccElement will be returned in element array if repeat payment is enabled for that merchant account. User can populate ccElement as a part of the create repeat request form to generate and pass paymentToken value. Please go through the process from payment page, to generate paymentToken. If, repeat payment request is created form a existing transaction, then this value is not required.

schedule_setarray
Schedule set is a array set of date and amount where date will be the key and amount will be its value. It is required for Variable Schedule payment. This array needs to have minimum 2 set of values.

Request for fixed schedule

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

{
    "payment_type": "fixed_schedule",
    "payment_intent": "pi_rj..........",
    "customer_name": "Test developer",
    "customer_email": "test@gmail.com",
    "reference": "schedule payment with limited installments",
    "customer_address": "Uk....",
    "customer_postcode": "119083",
    "frequency": "days",
    "frequency_duration": 1,
    "currency": "GBP",
    "first_amount": 20.03,
    "recurring_amount": 15.01,
    "final_amount": 10.08,
    "is_limited_installments": true,
    "installments": 3,
    "start_payment_date": "23-02-2023",
    "final_payment_date": "25-02-2023",
    "paymentToken": "ey............"
}

Response

Code Block
HTTP/1.1 201 Created
Content-Type: application/json
{
    "id": 123,
    "payment_type": "fixed_schedule",
    "status": "active",
    "customer_name": "Test developer",
    "customer_email": "test@gmail.com,
    "reference": "schedule payment with limited installments",
    "address": "Uk....",
    "postcode": "119083",
    "currency": "GBP",
    "start_payment_date": "23-02-2023",
    "final_payment_date": "25-02-2023",
    "recurring_amount": "15.01",
    "is_limited_installments": true,
    "installments": 3,
    "frequency": "days",
    "frequency_duration": 1,
    "is_active": "true",
    "recurring_data": 
      {
        "recurring_id": 1,
        "payment_date": "23-02-2023",
        "reference": "Payment 1"
        "processed_amount": 20.03,
        "is_processed": true,
        "status": "captured",
        "xref": "AKY........."
      },
      {
        "recurring_id": 2,
        "payment_date": "24-02-2023",
        "reference": "Payment 2"
        "processed_amount": 15.01,
        "is_processed": false,
        "status": "pending",
        "xref": "AKY........."
      },
      {
        "recurring_id": 3,
        "payment_date": "25-02-2023",
        "reference": "Payment 3"
        "processed_amount": 10.08,
        "is_processed": false,
        "status": "pending",
        "xref": "AKY........."
      }
}

Request for variable schedule

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

{
    "payment_type": "variable_schedule",
    "payment_intent": "pi_rj..........",
    "customer_name": "Test developer",
    "customer_email": "test@gmail.com",
    "reference": "variable schedule",
    "customer_address": "Uk....",
    "customer_postcode": "119083",
    "currency": "GBP",
    "paymentToken": "ey............",
    "schedule_set":
    {
		"13-02-2023": 20.02,
		"16-02-2023": 22.02,
		"25-02-2023": 26.02
	}
}

Response

Code Block
HTTP/1.1 201 Created
Content-Type: application/json
{
    "id": 123,
    "payment_type": "variable_schedule",
    "status": "active",
    "customer_name": "Test developer",
    "customer_email": "test@gmail.com,
    "reference": "variable schedule",
    "address": "Uk....",
    "postcode": "119083",
    "currency": "GBP",
    "start_payment_date": "13-02-2023",
    "final_payment_date": "25-02-2023",
    "recurring_amount": null,
    "is_limited_installments": false,
    "installments": null,
    "frequency": "N/A"
    "frequency_duration": "N/A"
    "is_active": true,
    "recurring_data": 
      {
        "recurring_id": 1,
        "payment_date": "13-02-2023",
        "reference": "Payment 1"
        "processed_amount": 20.02,
        "is_processed": true,
        "status": "captured",
        "xref": "AKY........."
      },
      {
        "recurring_id": 2,
        "payment_date": "16-02-2023",
        "reference": "Payment 2"
        "processed_amount": 22.02,
        "is_processed": false,
        "status": "pending",
        "xref": "AKY........."
      },
      {
        "recurring_id": 3,
        "payment_date": "25-02-2023",
        "reference": "Payment 3"
        "processed_amount": 26.02,
        "is_processed": false,
        "status": "pending",
        "xref": "AKY........."
      }
}


Anchor
ecom-repeat-payments
ecom-repeat-payments

Create Repeat Payment Using ECOM

POST /pay/v1/repeat-payments

Headers

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_typestring
Repeat payment type. It must be either of the following values.

  • fixed_schedule

  • variable_schedule

payment_intentstring
Payment intent generated from create intent request.

customer_namestring
Customer name.

customer_emailstring
Customer email.

referencestring
Reference value. Unique textual details of the schedule

customer_addressstring
Customer address.

customer_postcodestring
Customer postcode.

currencystring
Currency that the payments will be processed in

frequencystring
Payment cycle frequency. It is required when creating a Fixed Schedule.
Possible values are

  • days

  • weeks

  • months

frequency_durationinteger
Payment frequency duration. It is required when creating a Fixed Schedule.

start_payment_datedate
Date on which the first payment will be captured. It is required when creating a Fixed Schedule.
Default value set to today.

first_amountdecimal (optional)
First payment amount.
When creating a Fixed Schedule, the first amount value can be customised.

recurring_amountdecimal
Recurring amount for each instalment. It is required when creating a Fixed Schedule.

is_limited_installments boolean
When creating a Fixed Schedule, it is required to mention if the process has unlimited or limited instalments.
Possible values are

  • true

  • false

installmentsinteger
Number of instalments. It is required when creating a Fixed Schedule if the process has limited instalments.

final_amountdecimal (optional)
Final payment amount.
This can be used when creating a Fixed Schedule if there are limited instalments.
If there are unlimited instalments, this field should not be used.

final_payment_datedate (optional)
Date on which the final payment will be captured.
Final date can be customised along with the final amount when creating a Fixed Schedule.
This can only be used if there are limited instalments. If there are unlimited instalments, this field should not be used.
This date must be after the start payment date and also after the 2nd last recurring date.

paymentTokenstring
Tokenised card value. In create intent response, ccElement will be returned in element array if repeat payment is enabled for that merchant account. User can populate ccElement as a part of the create repeat request form to generate and pass paymentToken value. Please go through the process from payment page, to generate paymentToken. If, repeat payment request is created form a existing transaction, then this value is not required.

schedule_setarray
Schedule set is a array set of date and amount where date will be the key and amount will be its value. It is required for Variable Schedule payment. This array needs to have minimum 2 set of values.

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.

Request for fixed schedule

Code Block
POST https://secure.blinkpayment.co.uk/api/pay/v1/repeat-payments 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_type": "fixed_schedule",
    "payment_intent": "pi_rj..........",
    "customer_name": "Test developer",
    "customer_email": "test@gmail.com",
    "reference": "fixed schedule payment with unlimited installments",
    "customer_address": "Uk....",
    "customer_postcode": "119083",
    "frequency": "days",
    "frequency_duration": 1,
    "currency": "GBP",
    "recurring_amount": 15.01,
    "is_limited_installments": false,
    "start_payment_date": "23-02-2023",
    "paymentToken": "ey............",
    "device_timezone" : "-330",
    "device_capabilities" : "javascript",
    "device_accept_language" : "en-GB",
    "device_screen_resolution" : "1366x768x24",
    "remote_address" : "123.123.123.123"
    
}

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>

Request for variable schedule

Code Block
POST https://secure.blinkpayment.co.uk/api/pay/v1/repeat-payments 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_type": "variable_schedule",
    "payment_intent": "pi_rj..........",
    "customer_name": "Test developer",
    "customer_email": "test@gmail.com",
    "reference": "variable schedule payment with 3ds",
    "customer_address": "Uk....",
    "customer_postcode": "119083",
    "currency": "GBP",
    "paymentToken": "ey............",
	"device_timezone" : "-330",
    "device_capabilities" : "javascript",
    "device_accept_language" : "en-GB",
    "device_screen_resolution" : "1366x768x24",
    "remote_address" : "123.123.123.123",
    "schedule_set":
    {
		"13-02-2023": 20.02,
		"16-02-2023": 22.02,
		"25-02-2023": 26.02
	}
}

Response

Code Block
HTTP/1.1 201 Created
Content-Type: application/json
{
    "id": 123,
    "payment_type": "variable_schedule",
    "status": "active",
    "customer_name": "Test developer",
    "customer_email": "test@gmail.com,
    "reference": "variable schedule payment with 3ds",
    "address": "Uk....",
    "Postcode": "119083",
    "currency": "GBP",
    "start_payment_date": "13-02-2023",
    "final_payment_date": "25-03-2023",
    "recurring_amount": 20.02,
    "is_limited_installments": true,
    "installments": 12,
    "frequency": "N/A"
    "frequency_duration": "N/A"
    "is_active": true,
    "recurring_data": 
      {
        "recurring_id": 1,
        "payment_date": "13-02-2023",
        "reference": "Payment 1"
        "processed_amount": 20.02,
        "is_processed": true,
        "status": "accepted",
        "xref": "AKY........."
      },
      {
        "recurring_id": 2,
        "payment_date": "16-03-2023",
        "reference": "Payment 2"
        "processed_amount": 22.02,
        "is_processed": true,
        "status": "declined",
        "xref": "AKY........."
      },
      {
        "recurring_id": 3,
        "payment_date": "25-03-2023",
        "reference": "Payment 3"
        "processed_amount": 26.02,
        "is_processed": false,
        "status": "pending",
        "xref": "AKY........."
      }
}


Anchor
get-all-repeat-payments
get-all-repeat-payments

Get all repeat payments

Get all the repeat payments created from the same merchant account.
Results can be filtered by using the below query parameters. payment_type need to be passed as query param without which result can't be fetched.

GET /pay/v1/pay/repeat-payments

Headers

Content-Typestring
Content type.

Authorizationstring
Access token generated from create token request.

Query parameters

payment_typestring
Repeat payment type.

  • fixed_schedule

  • variable_schedule

pageinteger (optional)
Page Number.

statusstring (optional)
Repeat payment status.

  • Active - This means the payments have started

  • Pending - This means the first payment has not yet been processed

  • Cancelled - This means the schedule has been cancelled. No further payments will be processed

  • Completed - This means all the payments have been processed. No further payments will be processed

Request

Code Block
GET https://secure.blinkpayment.co.uk/api/pay/v1/repeat-payments?payment_type=variable_schedule&status=active&page=1&payment_type=variable_schedule HTTP/1.1
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbG...

Response

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

{
    "pageNumber": 1,
    "pageSize": 50,
    "totalResults": 7,
    "data": [
       {
            "id": 8,
            "payment_type": "variable_schedule",
            "status": "Active",
            "customer_name": "customername here",
            "customer_email": "email@gmail.co.uk",
            "reference": "Variable schedule test",
            "address": "2",
            "postcode": "3",
            "currency": "GBP",
            "start_payment_date": "19-02-2024",
            "final_payment_date": "21-02-2024",
            "recurring_amount": null,
            "is_limited_installments": false,
            "installments": null,
            "frequency": "N/A",
            "frequency_duration": "N/A",
            "is_active": true,
            "recurring_data": [
                {
                    "recurring_id": 190,
                    "payment_date": "2024-02-19",
                    "reference": "Payment 1",
                    "processed_amount": "21.02",
                    "is_processed": true,
                    "status": "Captured",
                    "xref": "AKY........."
                },
                {
                    "recurring_id": 191,
                    "payment_date": "2024-02-20",
                    "reference": "Payment 2",
                    "processed_amount": "1.02",
                    "is_processed": false,
                    "status": "Pending",
                    "xref": "AKY........."
                },
                {
                    "recurring_id": 192,
                    "payment_date": "2024-02-21",
                    "reference": "Payment 3",
                    "processed_amount": "23.02",
                    "is_processed": false,
                    "status": "Pending",
                    "xref": "AKY........."
                }
             ]
         }
      ]

Anchor
get-repeat-payment
get-repeat-payment

Get repeat payment

Get details of a specific repeat payment using id.

GET /pay/v1/pay/repeat-payments/{id}

Headers

Content-Typestring
Content type.

Authorizationstring
Access token generated from create token request.

Query parameters

payment_typestring
Repeat payment type.

  • fixed_schedule

  • variable_schedule

Request

Code Block
GET https://secure.blinkpayment.co.uk/api/pay/v1/repeat-payments/123?payment_type=fixed_schedule HTTP/1.1
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbG...

Response

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

{
    "id": 123,
    "payment_type": "fixed_schedule",
    "status": "active",
    "customer_name": "Test developer",
    "customer_email": "test@gmail.com,
    "reference": "test payment ......",
    "address": "Uk....",
    "Postcode": "119083",
    "Currency": "GBP",
    "start_payment_date": "23-02-2023",
    "final_payment_date": "25-03-2023",
    "recurring_amount": 20.02,
    "is_limited_installments": true,
    "installments": 3,
    "frequency": "days",
    "frequency_duration": 1,
    "is_active": true,
    "recurring_data": 
      {
        "recurring_id": 1,
        "payment_date": "23-02-2023",
        "reference": "Payment 1"
        "processed_amount": 20.02,
        "is_processed": true,
        "status": "captured"
        "xref": "eygh...."
      },
      {
        "recurring_id": 2,
        "payment_date": "24-02-2023",
        "reference": "Payment 2"
        "processed_amount": 20.02,
        "is_processed": false,
        "status": "pending"
        "xref": "eygh...."
      },
      {
        "recurring_id": 3,
        "payment_date": "25-02-2023",
        "reference": "Payment 3"
        "processed_amount": 20.02,
        "is_processed": false,
        "status": "removed"
        "xref": "eygh...."
      }
}


Anchor
Delete-a-scheduled-payment/Cancel-all-remaining-payments
Delete-a-scheduled-payment/Cancel-all-remaining-payments

Delete a specific future recurring payment of a Repeat schedule using recurring id (fetched from get repeat payment request.)


This will delete the future payment from both fixed and variable schedules.
The recurring_id needs to be passed along with the main id (repeat schedule id) in request url to delete any specific recurring payment.
If the recurring_id is not passed then it will delete all the future recurring payments of that schedule.

DELETE /pay/v1/repeat-payments/{id}

Headers

Content-Typestring
Content type.

Authorizationstring
Access token generated from create token request.

Attributes

payment_typestring
Repeat payment type. It must be either of the following values. It is passed to identify the type of the specific repeat payment.

  • fixed_schedule

  • variable_schedule

recurring_idinteger (optional)
Recurring id is need to be passed to delete a specific recurring event of Fixed and Variable schedule payment.

Request

Code Block
DELETE https://secure.blinkpayment.co.uk/api/pay/v1/repeat-payments/{id} HTTP/1.1
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbG...

{
    "payment_type": "fixed_schedule",
    "recurring_id": 123
}

Response

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

{
    "success": true,
    "message": "Deleted successfully"
}

Anchor
cancel-repeat-payment
cancel-repeat-payment

Refund a processed payment

Refund any processed repeat payment using repeat schedule id and recurring id.
In this scenario, id (repeat schedule id) need to be passed in request url along with recurring_id and payment_type in request body.

This request can be used to refund a processed payment that has a captured or completed status

DELETE /pay/v1/repeat-payments/cancel/{id}

Headers

Content-Typestring
Content type.

Authorizationstring
Access token generated from create token request.

Attributes

payment_typestring
Repeat payment type. It must be either of the following values. It is passed to identify the type of the specific repeat payment.

  • fixed_schedule

  • variable_schedule

recurring_idinteger
Recurring id needs to be passed to refund a specific payment from a Fixed or Variable schedule.

Request

Code Block
DELETE https://secure.blinkpayment.co.uk/api/pay/v1/repeat-payments/cancel/{id} HTTP/1.1
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbG...

{
    "payment_type": "fixed_schedule",
    "recurring_id": 123
}

Response

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

{
    "success": true,
    "message": "Cancelled successfully"
}

Anchor
retry-repeat-payment
retry-repeat-payment

Retry a processed payment that failed

Retry any specific payment which was able to run on the scheduled day but returned a declined status due to some issue for that Repeat schedule.

This will run the payment for both fixed and variable schedules.
In this scenario, the recurring_id (fetched from get repeat payment request) needs to be passed along with the id (repeat schedule id) in request url.

POST/pay/v1/repeat-payments/retry/{id}

Headers

Content-Typestring
Content type.

Authorizationstring
Access token generated from create token request.

Attributes

payment_typestring
Repeat payment type. It must be either of the following values. It is passed to identify the type of the specific repeat payment.

  • fixed_schedule

  • variable_schedule

recurring_idinteger
Recurring id needs to be passed to retry a specific payment from a Fixed or Variable schedule.

Request

Code Block
POST https://secure.blinkpayment.co.uk/api/pay/v1/repeat-payments/retry/{id} HTTP/1.1
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbG...

{
    "payment_type": "fixed_schedule",
    "recurring_id": 123
}

Response

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

{
    "success": true,
    "message": "Payment retried successfully"
}

Anchor
card-repeat-payment
card-repeat-payment

Add a new card

Update the card being used for any specific repeat schedule.
The new card details will be used to action all the future payments of that schedule.

In this scenario, the paymentToken need to be passed along with id (repeat schedule id) in request url. (Payment token should be fetched in same way by populating a hosted payment page using ccElement from Create intent request)

POST/pay/v1/repeat-payments/card/{id}

Headers

Content-Typestring
Content type.

Authorizationstring
Access token generated from create token request.

Attributes

payment_typestring
Repeat payment type. It must be either of the following values. It is passed to identify the type of the specific repeat payment.

  • fixed_schedule

  • variable_schedule

paymentTokenstring
Payment token is need to be passed to add any new card for Fixed and Variable schedule.

Request

Code Block
POST https://secure.blinkpayment.co.uk/api/pay/v1/repeat-payments/card/{id} HTTP/1.1
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbG...

{
    "payment_type": "fixed_schedule",
    "paymentToken": "ey............."
}

Response

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

{
    "success": true,
    "message": "Card updated"
}