Void / Cancel

👍

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 JWT with exchange key.

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

 

Void / Cancel Request


To prepare a void / cancel 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 void / cancel request, refer to the sample structure shown below. You may also check the API specifications here: Void Request Parameters
<PaymentProcessRequest>
  <version>3.8</version>
  <merchantID>JT07</merchantID>
  <invoiceNo>250221094450</invoiceNo>
  <actionAmount>105.00</actionAmount>
  <processType>V</processType>
</PaymentProcessRequest>
  1. To generate encrypted request data, refer to this guide: Generate JWT Request with Keys

  2. To send the encrypted request via API, refer to the sample request below.

eyJhbGciOiJQUzI1NiIsInR5cCI6IkpXVCJ9.ZXlKaGJHY2lPaUpTVTBFdFQwRkZVQ0lzSW1WdVl5STZJa0V5TlRaSFEwMGlmUS5NdTF4TVFESnl4eXN1YUJvU1NCS3ZCTkRCWnlUeU0xLVIyd2IwQk5YZVhPVzVuRUprdVQ4ZXUtQVZpTWNSbzdqS25jWGtzWGdxT2RaeUY4SlpKemliZFRfT2x6TVVnMVJwTW93a1hkZXU0MEJwRUtlbS1vZW56cHktcWdFQXJJZDRYRllSQkFNdTFyeEVtSjFSSUlEQTB4VnVNM3haaENRdkhPVDlZTXM3ajBSUFp2VlBiZVhtenc0YWRwS0o1aGtjR0lBUVctajVNb3pqNEJtSGlLQTlTcHF4RUF2aFp4di13WWx0eHZQRXJoWi1IdDg5aFZpdXVvbkhKY0xPaWFGa2VELWNIajI0VjhRdTJFM09fUGlyb0pqcTBvdk9lVXFQNXZhZXpXYzhlaE16SkJSVGZUX3dZM1paOFBZSVFBRmcwaWNNdnU4clE1LWM0Wk1oUkNaal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25AIpKZ0

 

Void / Cancel Response


To receive and process void / cancel 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 void / cancel request, the API will return encrypted response data. Refer to the sample encrypted response below.
eyJhbGciOiJQUzI1NiIsInR5cCI6IkpXVCJ9.ZXlKaGJHY2lPaUpTVTBFdFQwRkZVQ0lzSW1WdVl5STZJa0V5TlRaSFEwMGlmUS5UQTQybEtrZy1VV2s2QWlURmUxN2JvenZ4Uy1tY1dEOGtxZkZEV05acU8xeFZiTndMWUUtcEhILXgzU1F4SWFtZ2dPQVZXZXNOUnJzR2N3M1FkeGYwV2VQR3VYN2NMUEtOOElHdGFZLWM0M3lDc1Q5WkVkeGhoaC0tN19RME5HVHZZUEkzTVJSRFZQTDFyUDRfMGpWcTVJYmF5bkFXNWRScTVMbUs3d212R2RET2xFaERlU3p4dUkweFVibGEyY00yX0x5MU10VUJwNktNMExqRkJvZURObnI0RF9BSllGSi1zSEI3MDBXWGwzc0hDZG1LSHVLME9UWEZ4ZXAyWGRZWGpzVTJxeS1HUTdGYnNwZkJxc3VIT1VvUEFXWkVJaGVCR0NGVWpEd2xKbld1Qmk5UEZRa0ZpM2JSQVZ5VVBUSzR1YmFxZWRyVVoyLTZENFZlZWx2bGh0ZFFOLWl5RURUdzBhaFFUdmxfSUtGNjY5QTdyeVNRY2w0SnJReVRxWVNndFVqbVBpQ0twUExoMVFhTm8xRFU5OV9ET1A4VmxJS0djdFYzRVY2cVVwbXByRTd6LVJYX2ZrT1BTNklSVWxMdHBOZmdsX3lMR3laVnF6Wm54QUNFOUpXc0xmS2hkTFNJMU0tc0Y5N29qYUVadW1HaHAxaHU5RDEtVmU0QUFEYVhic1oyQWctRkE0Wmk2dWNVaDhJRm53X2V2SGJxX3Q0V0dQMGtkOTVabG9nSjEyUElrWW13eklGU1NUT2xHSDhrVWNJeGJDeklvRVV3MUpSd1pfX0x6TFlrVkJN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WNNTDl5MWVpVWlQMGlkOUtEb0FjOW1DZnBKZjhsbEZYa0ZTTXNqMDF3d2lvdmFvbVVIRllXaGh6VlVsZ0MyY0NoS1FtdnNHcFdITGZKNFMwYllUal9VdkFpazBGUzgzc0RXby10ZWhVNEx0Q0tZYUdLcHNFSTNUaHVCR0hHVm1UczFBTnNfZXlaNjVob0Ywc3cwalF5ODdOZTQwck91SnE1MkpXNGpNSUY2WnRHdXhUSjZ0MEZacWFJdlhSWV9Cb2k0aFEuUUt1cnlXYkxMOENRWVRvdmd3clE4QQ.jXozeDxJ3be1NEWRTDBkIK3ykpVQYwPsii8gY3-u-LCPD6dh9-hfS49ARNc8QAoMSyaxp1O-S-ZkZPBhtNq3qNsMd9-RIaGc6FPImcejSLfBFo1UdarzPBmNK5lKONqppe86Q0O1tBRmnX5Fm2vtoGDf8gUFzBq6GZEvf8FOyGJftIuAsb0_-FJF64NxaX0Tki1HXm6tTIv88OD_1wB6mT6_Fg1WosLg326dCIC5Pdr5AXcPi3ih7sfbE5U4yozC8AANmIRCEHJ0p0vk2nLzhuiuX0aeSHLGHFuh4x7RMujATuELrsCupQOcCHdg0rPKqy8TT9O64vfTXW1q91JQQg
  1. To decrypt the response, refer to: Process JWT Request with Keys

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

<PaymentProcessResponse>
  <version>3.8</version>
  <timeStamp>250221153713</timeStamp>
  <respCode>00</respCode>
  <respDesc>Success</respDesc>
  <processType>V</processType>
  <invoiceNo>250221094450</invoiceNo>
  <amount>105.00</amount>
  <status>V</status>
  <approvalCode>295068</approvalCode>
  <referenceNo>3596581</referenceNo>
  <transactionDateTime>20210225094710</transactionDateTime>
  <maskedPan>411111XXXXXX1111</maskedPan>
  <eci>05</eci>
  <paymentScheme>VI</paymentScheme>
  <processBy>VI</processBy>
  <userDefined1 />
  <userDefined2 />
  <userDefined3 />
  <userDefined4 />
  <userDefined5 />
</PaymentProcessResponse>