RPP (Recurring Payment Plan)

Prepare Payment Token Request

Below are the required parameter for create payment token. Refer to following on how to prepare request. Required to additional field to pass in to specify recurring payment.

πŸ“˜

Please refer: Payment Token API Request

Pre Requisite

  1. MerchantID, secret code & currencyCode are provided by 2c2p.
  1. Set recurring to true
  1. Set required recurring data - invoicePrefix, recurringAmount, recurringInterval, recurringCount & chargeNextDate.
{
    "merchantID": "JT01",
    "invoiceNo": "1523953661",
    "description": "item 1",
    "amount": 1500.00,
    "currencyCode": "THB",
    "recurring": true,
    "invoicePrefix": "020620125724",
    "recurringAmount": "10",
    "allowAccumulate": false,
    "maxAccumulateAmount": "1500",
    "recurringInterval": "30",
    "recurringCount": "12",
    "chargeNextDate": "03062020"
}

Β 

Receive Payment Token Response

Below are the sample payment token response, Refer to following on how to receive.

πŸ“˜

Please refer: Payment Token API Response

{
  "webPaymentUrl": "https://sandbox-pgw-ui.2c2p.com/payment/4.1/#/token/kSAops9Zwhos8hSTSeLTUcCrwcnrndJUZanGJy3fBEsXCiYmynwxHvK5h7XPBadJqD0nG7v65t5N2jPVrnwX2jL4nu%2bKKSegjUjERKCyWPg%3d",
  "paymentToken": "kSAops9Zwhos8hSTSeLTUcCrwcnrndJUZanGJy3fBEsXCiYmynwxHvK5h7XPBadJqD0nG7v65t5N2jPVrnwX2jL4nu+KKSegjUjERKCyWPg=",
  "respCode": "0000",
  "respDesc": "Success"
}

Β 

Validation of Payment Token

Process only when parameter "respCode" is "0000" which is success requested payment token. Otherwise, terminate the payment process. Refer below Payment Response Code.

🚧

Please refer : Payment Response Code

Β 

Redirect to Payment Page

Redirect to payment page via browser. The payment page URL is return from Parameter "webPaymentUrl".

Β 

Receive Payment Response via backend API

πŸ“˜

Please refer : Payment Response - Backend API

The parameter "backendReturnUrl" that previously send via Payment Token Request is the merchant endpoint that will receive backend notification. If parameter "backendReturnUrl" is not set, system will default get the backend return url from merchant profile set in 2c2p merchant portal.

{
  "merchantID": "JT01",
  "invoiceNo": "1523953661",
  "cardNo": "411111XXXXXX1111",
  "amount": "1500.00",
  "currencyCode": "THB",
  "cardToken": "28052010234224845229",
  "recurringUniqueID": "138738",  //return recurring ID
  "tranRef": "2876444",
  "referenceNo": "2793077",
  "approvalCode": "287413",
  "eci": "05",
  "transactionDateTime": "20200602133028",
  "respCode": "0000",
  "respDesc": "Success"
}

Β 

Receive Payment Response via browser redirection

πŸ“˜

Please refer : Payment Response - Frontend API

The parameter "frontendReturnUrl" that previously send via Payment Token Request is the merchant page that will be redirect to. If parameter "frontendReturnUrl" is not set, system will default get the front end return url from merchant profile set in 2c2p merchant portal. Below are the sample response returned.

{"invoiceNo":"280520075921","channelCode":"CC","respCode":"2000","respDesc":"Transaction is completed, please do payment inquiry request for full payment information."}

Parameter "respCode" specify the status of the transaction and also indicate what action should perform next. Refer to Payment Flow Response Code.

🚧

Please refer : Payment Flow Response Code

Β 

Payment Inquiry to retrieve the payment information

πŸ“˜

Please refer : Payment Inquiry API

For merchant who do not implement "Receive Payment Response via backend API", require to call Payment Inquiry API to receive the payment response.