These docs are for v4.0.2. Click to read the latest docs for v4.3.0.

Settle Payment

👍

HTTPS POST / Server-to-Server

Payment requests and responses are encrypted using JWE

  • JWE algorithm = RSA-OAEP + A256GCM
  • The signature uses JWS PS256

Merchants must know how to prepare requests and process responses using JWE + JWS with exchange key.

https://demo2.2c2p.com/2C2PFrontend/PaymentAction/2.0/action
https://t.2c2p.com/PaymentAction/2.0/action

 

Settle Request


To prepare a settle request, refer to the guidelines below.

📘

Provided Sample Code

The following sample code demonstrates how to prepare request data, generate the JWT token with key, and send the API request.

For the JWT token, you may also refer to the sample code here.

  1. To prepare the data payload for the settle request, refer to the sample structure shown below. You may also check the API specifications here: Settle Request Parameters

2.To generate encrypted request data, refer to this guide: Generate JWT Request with Keys

<PaymentProcessRequest>
  <version>3.8</version>
  <merchantID>JT07</merchantID>
  <processType>S</processType>
  <invoiceNo>INV14235354</invoiceNo>
</PaymentProcessRequest>
eyJhbGciOiJQUzI1NiIsInR5cCI6IkpXVCJ9.ZXlKaGJHY2lPaUpTVTBFdFQwRkZVQ0lzSW1WdVl5STZJa0V5TlRaSFEwMGlmUS5BTUpWM2FHaHNMOVFxMUg1Wk4tUkhyYVhNT1BBVTF2VXFjelZxcjhHSFkxSXMwWHQ2ZHNabElDQktYR1Z6WTNCNjhBT2dwemxTY09TbEh2RkxpcWlTTTdFMEhBZm5Tb0E3aFdWQjNaWWt2bkJRREZQZ2pvMWVIZUpLdjVsUy1ySE8xYko3NThzUE9ob19XVjl0X0w3cEotaW8xc09rN1lsMk1NYWpYdnZGcnFJUEdSOFNlQnowNGV3VUhJLTMtb01mb21OLUV2eUFsLUR6bmc3TGx0VmNtNE54bTJfOWNYQWtUYTFtTUQyaERFdENwN3pxRmN6bmVVTG5meE5ISHkyOUFqZVBoSC1GUkdOZlFrNEhZN2hxYmhLNGxOM0xxdDlHVzF6Q3pQaWFmanhCVW5wNVFHX2NlUXIwTURyQkZDVFkzR3psWHRCMGJwSXpoOWtqUm1aNXcuV3Y0Y1cyR0VfRDRDU1NuMy50Q3NhR2Rja3ppbjI2eVJPcmZ2RUdibWFHcndlODduc2g5REdWQ0YwaXA5ajJLRHJMM1hKMzNuT1lfYUlLQmhsWkpmMTJxNS0tRElkWi1XYVQtd0NaYlJlT3ZPR1dGWmdYcEVPY1JrdDM4aURSeU1seTA0WFNCbzduUFdxREt3anU1SkZmTngyNU5LRGtDaVR4SU5KSjFsakhqY0F0NWVmYm0xdFZNTE10T3pocTBBcFgzSEtYRkNNak0tYk1FdGNseElYQnNsc0tkbWxDV2NreGllaV9RLkxMLXZRY2g0UDdISm41cTktcEhMSEE.DX4iYBPYezzxQ3hHKHQPpSDAtkyPm1hSJL0YENeJyvqgmhDlUv6wX0kgMh0oKUrvHCOSztHZzJ75YZZ4hfzFyuZk5BuBGtROmj2W9arcnGO_5hN9Ny2l1fCy4zuWHvtR3bUt2ei2iDZY4_xuPaLRQuOgz0Hj-fW1XAXcqt8ru9mri249Lp7DIl6gWN4h5yX3E8LYAJfCxyRnEdLhdFnkKM59R_pOiC6hURnaOB4L0aOpUxz67oeqzxTuAMGGR777ea49uNHS9F-kHh8IHhJUGh6TZdY123Gh7WovPMkClE0xpi__fY6idoH2n6DWo80qX8_rlz948E4RHUcyQKYCygZGI36KtQaWPwxNZ9fH9aZF3YuU6q0AYzQOVX1OZ-p6Z3qJg1XWie0VONdFWY7tdgeF6NqbQvboU0KAAskaXhTPssBbroqjeM5fW4klaAcQEx1jW6PmvNgAaNArctoqbAcRhsvc4MSnkWEFIj3xFSha3ZTIzPn86Q2leTnv7WKsAbUcoATHFYHtTrhIVni_FUga_CdIYiO7nWjMkT_THCVoPi0LO4zxt8Q_loiohIE5D0qFhoDVHIE3lhdHZTBAIkj6StgHkuUsXdyzXxhR_gEWcKXe9kZlOn90x4V_WMHrJKKtQTbY_87C4MZabZtuMe5FDY32d50HW4_pJUZJM1o
  1. To send the encrypted request via API, refer to the sample request below.
curl --location --request POST 'https://demo2.2c2p.com/2C2PFrontend/PaymentAction/2.0/action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2iDZY4_xuPaLRQuOgz0Hj-fW1XAXcqt8ru9mri249Lp7DIl6gWN4h5yX3E8LYAJfCxyRnEdLhdFnkKM59R_pOiC6hURnaOB4L0aOpUxz67oeqzxTuAMGGR777ea49uNHS9F-kHh8IHhJUGh6TZdY123Gh7WovPMkClE0xpi__fY6idoH2n6DWo80qX8_rlz948E4RHUcyQKYCygZGI36KtQaWPwxNZ9fH9aZF3YuU6q0AYzQOVX1OZ-p6Z3qJg1XWie0VONdFWY7tdgeF6NqbQvboU0KAAskaXhTPssBbroqjeM5fW4klaAcQEx1jW6PmvNgAaNArctoqbAcRhsvc4MSnkWEFIj3xFSha3ZTIzPn86Q2leTnv7WKsAbUcoATHFYHtTrhIVni_FUga_CdIYiO7nWjMkT_THCVoPi0LO4zxt8Q_loiohIE5D0qFhoDVHIE3lhdHZTBAIkj6StgHkuUsXdyzXxhR_gEWcKXe9kZlOn90x4V_WMHrJKKtQTbY_87C4MZabZtuMe5FDY32d50HW4_pJUZJM1o'

 

Settle Response


To receive and process settle request responses, refer to the sample code below.

📘

Provided Sample Code

The following sample code demonstrates how to receive response data and decrypt the JWT token with key.

For decrypting the JWT token, you may also refer to the sample code here.

  1. Following a settle request, the API will return encrypted response data. Refer to the sample encrypted response below.

  2. To decrypt the response, refer to: Process JWT Request with Keys

  3. Refer to the sample response structure below. You may also check the API specifications here: Response Parameters

eyJhbGciOiJQUzI1NiIsInR5cCI6IkpXVCJ9.ZXlKaGJHY2lPaUpTVTBFdFQwRkZVQ0lzSW1WdVl5STZJa0V5TlRaSFEwMGlmUS5rcXNGWFhQcFJwQWhkMEloUnNWYmN6QU52NV84aEhYN1hrdkxsSTItWGs4S2xyeWwtU1RmMDZUWHZKdWpDazNndG1GMGpYQXNPUGJSNXFTUEZOU0RkclJVeERmN0ZHZldjZmpKWXR1WlFjVC15cndOeHdtQl9XS0ViWVZmTlFDLThFTVZ5bXMza2wxNUZvd3Z4bV96Wl9WVFFMSTZmRDhHRG05OEFRSXprUksybWs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xncTJwRXhUSGVfS2JDejd2eWNiYk5tcTY2ajFhUU5nNUdwaEdxWkx1czZQZ3p2QXdHd3EzQ054cGEwcVFzVV8zNTJ2Mk5zeDVWUWhQUWx0SkNSWk5kSEZ4YUpXLWhZUEFFM0JPMzlVNG45Vzc4bUZSMENkNDZtVVlrNXl5RnpqSk91bTNSWU9MNDJ2T2dSdy5VUnpGMXdkQjVpRFVUQl9hOVVvbjNR.czac5DA6fsAF_cmFgN6S0J5XNM9melgwWfYXNRDru0OaQpMzh9r9sdtt8mO7jjw_z0tJg6tsk3Rv4EnuKUww9i4wJazQ5L3oLx2DHBt-8pQ5RbajaQhqZCLb-czRtp6DiDULxOVJKShBlR3hx8DcyCt16KH3ThG9yC5v0ARjwZu6-cByspvvpyWq1raS5dxldPbbbns5VeMpBXRl3sgzTyiv591GTzfdftzHNZZzBqDeCf3-ZjGtFWBEVixWwO8ryFBq7CwGGOnOih15WQFb6mDVeuYzxLTb0toEOJYmuiB4-lOfRmOg7909uF-F51Rk7xgizZOfLdMnGbKN2HVCdg
<PaymentProcessResponse>
   <version>3.8</version>
   <timeStamp>080221085851</timeStamp>
   <respCode>00</respCode>
   <respDesc>Success</respDesc>
   <processType>S</processType>
   <invoiceNo>INV14235354</invoiceNo>
   <amount>25.00</amount>
   <status>RS</status>
   <approvalCode>12345</approvalCode>
   <referenceNo>2475643463</referenceNo>
   <transactionDateTime>20211211111934</transactionDateTime>
   <maskedPan>41111XXXXXX1111</maskedPan>
   <eci>00</eci>
   <paymentScheme>VI</paymentScheme>
   <processBy>VI</processBy>
   <userDefined1 />
   <userDefined2 />
   <userDefined3 />
   <userDefined4 />
   <userDefined5 />
</PaymentProcessResponse>