Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
developer:api_specification:xml_payment_features_einvoice [2019/05/20 17:47]
robinc [Notes and Details on the Response]
developer:api_specification:xml_payment_features_einvoice [2019/05/20 18:24]
robinc Added Cancel Payment Link content
Line 590: Line 590:
 </​WRAP>​ </​WRAP>​
  
 +===== Cancel Payment Link =====
  
 +This feature allows you to cancel an existing payment link.
  
 +  * **Main Request body Tag**: <​CANCEL_PAYMENT_LINK> ​
 +  * **Main Response body Tag**: <​CANCEL_PAYMENT_LINK_RESPONSE>​
 +
 +==== Request Body Fields ====
 +
 +^ **FIELD** ​        ^ **REQUIRED** ​ ^ **DESCRIPTION** ^
 +| TERMINALID ​        |Y| A Terminal ID provided by Nuvei, in which the payment was created.|
 +| MERCHANTREF ​        | Y| This is the identifier used to create the payment link. |
 +| DATETIME ​            |Y| Request date and time. Format: YYYY-MM-DDTHH:​MM:​SS. |
 +| HASH           |Y| A HASH code formed by part of the request fields. The formation rule is given at the **ND001 - Hash Formation**,​ in the next section.|
 +
 +==== Notes and Details About the Request ====
 +
 +ND001 - Hash Formation
 +
 +The general rule to build the HASH field is given on the [[developer:​api_specification:​special_fields_and_parameters|Special Fields and Parameters]] page, under Special Fields and Parameters section. For this specific feature, you should use the following format.
 +
 +<WRAP center box 100%>
 +TERMINALID:​MERCHANTREF:​DATETIME:​TERMINALSECRET
 +</​WRAP>​
 +
 +ND002 - Data Encoding for Requests
 +
 +All data sent to us shold be correctly encoded using UTF-8 as the character encoding.
 +
 +ND003 - General Constraints
 +
 +^ **CONTRAINT** ​        ^ **DESCRIPTION** ^
 +| C001         | You can only cancel payment links that are still OPEN (status). If they are already cancelled, expired or complete, you are not going to be able to cancel them and an error will be returned.|
 +
 +==== Examples for a Request ====
 +
 +  * **Scenario**:​ Cancel a payment link you don't want to be paid anymore.
 +  * **Terminal**:​ 6491002.
 +  * **Terminal Secret**:​x4n35c32RT.
 +
 +<code xml>
 +<?xml version="​1.0"​ encoding="​UTF-8"?>​
 +<​CANCEL_PAYMENT_LINK>​
 +    <​TERMINALID>​3614043</​TERMINALID>​
 +    <​MERCHANTREF>​XML_JAN22002</​MERCHANTREF>​
 +    <​DATETIME>​06-03-2018:​17:​41:​08:​273</​DATETIME>​
 +    <​HASH>​7777552e7a847fd7e42c979dc42180a3772e5685b9e117589048595af9a7f872f5b7e6ce9d6213622889a7cfc1fbeb50f39a64bf4bdf32db3aae64f775c679d9</​HASH>​
 +</​CANCEL_PAYMENT_LINK>​
 +</​code>​
 +
 +<WRAP center important 100%>
 +**REMEMBER** to change the Terminal ID and Terminal Secret for valid values. Consult the [[developer:​integration_docs|Integration Docs]] for examples or contact our support team.
 +</​WRAP>​
 +
 +==== Response Body Fields ====
 +
 +If the cancellation is successful, you are going to receive a response with the following fields:
 +
 +^ **FIELD** ​          ^ **DESCRIPTION** ^
 +| TERMINALID ​        | The Terminal ID informed on request.|
 +| MERCHANTREF ​        |The Merchant Ref informed on request. |
 +| DATETIME ​            | Request date and time. Format: YYYY-MM-DDTHH:​MM:​SS|
 +| HASH           | A HASH code formed by part of the request fields. The formation rule is given at the **ND001 - Hash Formation**,​ in the next section.|
 +
 +==== Notes and Details on the Response ====
 +
 +**ND001 - Hash Formation**
 +
 +The general rule to build the HASH field is given on the [[developer:​api_specification:​special_fields_and_parameters|Special Fields and Parameters]] page, under the Special Fields and Parameters section. For this specific feature, you should use the following format.
 +
 +<WRAP center box 100%>
 +TERMINALID:​MERCHANTREF:​DATETIME:​TERMINAL SECRET
 +</​WRAP>​
 +
 +**ND002 - Error Handling**
 +
 +^ *ERROR** ​          ^ MESSAGE** ^
 +| Cannot find terminal or terminal is deactivated ​        | Invalid TERMINALID field|
 +| Datetime is invalid ​       |Invalid DATETIME field |
 +| Hash is invalid ​            | Invalid HASH field|
 +| Terminal is not configured ​          | Terminal is not configured|
 +| Terminal informed does not have feature ​      ​|Terminal does not support Invoice Payment Request |
 +| Payment Link not found            | Invoice Payment Request does not exist|
 +| Payment Link status is not OPEN          |Cannot cancel an Invoice Payment Request with status different from Open|
 +
 +==== Examples for the Response ====
 +
 +  * **Scenario**:​ Response for a successful cancellation. ​
 +  * **Terminal**:​ 6491002.
 +  * **Terminal Secret**: x4n35c32RT.
 +
 +<code xml>
 +<?xml version="​1.0"​ encoding="​UTF-8"?>​
 +<​CANCEL_PAYMENT_LINK_RESPONSE>​
 +    <​TERMINALID>​3614043</​TERMINALID>​
 +    <​MERCHANTREF>​XML_JAN22002</​MERCHANTREF>​
 +    <​DATETIME>​22-01-2019:​14:​57:​23:​770</​DATETIME>​
 +    <​HASH>​8b304d77a9b621a99de4e97f8bf8d8b72ae2787315a13688ea8a2acbb02956401e6d3099d866e54dd4fdac8a0b31e481385fffaf75ad53ec1885b9beef780df6</​HASH>​
 +</​CANCEL_PAYMENT_LINK_RESPONSE>​
 +</​code>​
 +
 +<WRAP center important 100%>
 +**REMEMBER** to change the Terminal ID and Terminal Secret for valid values. Consult the [[developer:​integration_docs|Intregration Docs]] for examples or contact our support team.
 +</​WRAP>​
  
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International