Settle Payment

This guide show how to integrate with Payment Process Settle API

👍

HTTPS POST / Server-to-Server

Encryption of payment request and response is use JWE

  • JWE algorithm = RSA-OAEP + A256GCM
  • Signature is use JWS PS256

Required to know how to prepare request and process response using JWT with exchange key.

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

 

Settle Request


Below are the guidelines that how to prepare a settle request and send to 2c2p

📘

Provided Sample Code

Prepare Request Data, Generate JWT Token with Key & Send API
Refer sample code here.

  1. Prepare payload data. Below sample request data show the request structure. Refer Settle Request Parameter for API Specification.
<PaymentProcessRequest>
  <version>3.8</version>
  <merchantID>JT07</merchantID>
  <processType>S</processType>
  <invoiceNo>INV14235354</invoiceNo>
</PaymentProcessRequest>
  1. Generate encrypted request data. Refer to Generate JWT Request with Keys

  2. Send the encrypted request to settle API. Below show encrypted request data

eyJhbGciOiJQUzI1NiIsInR5cCI6IkpXVCJ9.ZXlKaGJHY2lPaUpTVTBFdFQwRkZVQ0lzSW1WdVl5STZJa0V5TlRaSFEwMGlmUS5BTUpWM2FHaHNMOVFxMUg1Wk4tUkhyYVhNT1BBVTF2VXFjelZxcjhHSFkxSXMwWHQ2ZHNabElDQktYR1Z6WTNCNjhBT2dwemxTY09TbEh2RkxpcWlTTTdFMEhBZm5Tb0E3aFdWQjNaWWt2bkJRREZQZ2pvMWVIZUpLdjVsUy1ySE8xYko3NThzUE9ob19XVjl0X0w3cEotaW8xc09rN1lsMk1NYWpYdnZGcnFJUEdSOFNlQnowNGV3VUhJLTMtb01mb21OLUV2eUFsLUR6bmc3TGx0VmNtNE54bTJfOWNYQWtUYTFtTUQyaERFdENwN3pxRmN6bmVVTG5meE5ISHkyOUFqZVBoSC1GUkdOZlFrNEhZN2hxYmhLNGxOM0xxdDlHVzF6Q3pQaWFmanhCVW5wNVFHX2NlUXIwTURyQkZDVFkzR3psWHRCMGJwSXpoOWtqUm1aNXcuV3Y0Y1cyR0VfRDRDU1NuMy50Q3NhR2Rja3ppbjI2eVJPcmZ2RUdibWFHcndlODduc2g5REdWQ0YwaXA5ajJLRHJMM1hKMzNuT1lfYUlLQmhsWkpmMTJxNS0tRElkWi1XYVQtd0NaYlJlT3ZPR1dGWmdYcEVPY1JrdDM4aURSeU1seTA0WFNCbzduUFdxREt3anU1SkZmTngyNU5LRGtDaVR4SU5KSjFsakhqY0F0NWVmYm0xdFZNTE10T3pocTBBcFgzSEtYRkNNak0tYk1FdGNseElYQnNsc0tkbWxDV2NreGllaV9RLkxMLXZRY2g0UDdISm41cTktcEhMSEE.DX4iYBPYezzxQ3hHKHQPpSDAtkyPm1hSJL0YENeJyvqgmhDlUv6wX0kgMh0oKUrvHCOSztHZzJ75YZZ4hfzFyuZk5BuBGtROmj2W9arcnGO_5hN9Ny2l1fCy4zuWHvtR3bUt2ei2iDZY4_xuPaLRQuOgz0Hj-fW1XAXcqt8ru9mri249Lp7DIl6gWN4h5yX3E8LYAJfCxyRnEdLhdFnkKM59R_pOiC6hURnaOB4L0aOpUxz67oeqzxTuAMGGR777ea49uNHS9F-kHh8IHhJUGh6TZdY123Gh7WovPMkClE0xpi__fY6idoH2n6DWo80qX8_rlz948E4RHUcyQKYCygZGI36KtQaWPwxNZ9fH9aZF3YuU6q0AYzQOVX1OZ-p6Z3qJg1XWie0VONdFWY7tdgeF6NqbQvboU0KAAskaXhTPssBbroqjeM5fW4klaAcQEx1jW6PmvNgAaNArctoqbAcRhsvc4MSnkWEFIj3xFSha3ZTIzPn86Q2leTnv7WKsAbUcoATHFYHtTrhIVni_FUga_CdIYiO7nWjMkT_THCVoPi0LO4zxt8Q_loiohIE5D0qFhoDVHIE3lhdHZTBAIkj6StgHkuUsXdyzXxhR_gEWcKXe9kZlOn90x4V_WMHrJKKtQTbY_87C4MZabZtuMe5FDY32d50HW4_pJUZJM1o

 

Settle Response


Below are the guidelines that how to process settle response from 2c2p.

📘

Provided Sample Code

Receive Response Data & Decrypt JWT Token with Key
Refer sample code here.

  1. Settle API will return encryp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kVJX2EwLXkwa284aDE4Q3RtQjNicTdKOFREV3cyd21xc3hyQXRzUVZzQzFnV1pmRlNxc3hNd1lhQVpmTHJxRm91Z1RHNlBxN3pKbGJwWlk4TU16R2EtanlCQ0JZUWpSamZvSmlDendQc3hLQkEwZ2NwZmx2cnVIQTk0VkpfT3lLQXg4aVhWektSb2l1QzZZN2dLbzRxS1JnZjdXZ2NoVl9ZVFBBeng1WmJkVUloQWM0ZWd3LXppVkZBU2xJQlU0c0hPRU1LQkViazhONkRtS3ZNZW93SV9zOU1fbmZwSElmTHRqaWxpWHR1TXYxSU5SMjdyajQzTnBsWGVWcEl0S000ZmxncTJwRXhUSGVfS2JDejd2eWNiYk5tcTY2ajFhUU5nNUdwaEdxWkx1czZQZ3p2QXdHd3EzQ054cGEwcVFzVV8zNTJ2Mk5zeDVWUWhQUWx0SkNSWk5kSEZ4YUpXLWhZUEFFM0JPMzlVNG45Vzc4bUZSMENkNDZtVVlrNXl5RnpqSk91bTNSWU9MNDJ2T2dSdy5VUnpGMXdkQjVpRFVUQl9hOVVvbjNR.czac5DA6fsAF_cmFgN6S0J5XNM9melgwWfYXNRDru0OaQpMzh9r9sdtt8mO7jjw_z0tJg6tsk3Rv4EnuKUww9i4wJazQ5L3oLx2DHBt-8pQ5RbajaQhqZCLb-czRtp6DiDULxOVJKShBlR3hx8DcyCt16KH3ThG9yC5v0ARjwZu6-cByspvvpyWq1raS5dxldPbbbns5VeMpBXRl3sgzTyiv591GTzfdftzHNZZzBqDeCf3-ZjGtFWBEVixWwO8ryFBq7CwGGOnOih15WQFb6mDVeuYzxLTb0toEOJYmuiB4-lOfRmOg7909uF-F51Rk7xgizZOfLdMnGbKN2HVCdg
  1. You wouldn't recognize the meaning of JWT response and it is required to decode it, refer to Process JWT Request with Keys

  2. Below are sample settle response refer to Response Parameter for API Specification.

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