Block
https://{Environment}.payture.com/api/BlockThe Block command places a hold on funds on the Customer's card for subsequent capture. It is used as part of the two-step payment flow.
The held funds can then be captured with the Charge command or released with the Unblock command.
Request
curl https://sandbox3.payture.com/api/Block \
-X POST \
-H "Content-Type: application/x-www-form-urlencoded" \
-d Key=Merchant \
-d Amount=12480 \
-d OrderId=5f63838d-fb03-00c6-c890-c67cfc1c54ea \
--data-urlencode "PayInfo= \
PAN=4111111111100031; \
EMonth=12; \
EYear=22; \
CardHolder=Ivan Ivanov; \
SecureCode=123; \
OrderId=5f63838d-fb03-00c6-c890-c67cfc1c54ea; \
Amount=12480" \
--data-urlencode "CustomFields = \
IP=241.22.197.12; \
Product=Ticket" \Parameter names in requests are case-sensitive
| Parameter | Description | Format |
|---|---|---|
| Key | Payment terminal name Provided with the test/production access credentials | String Mandatory |
| OrderId | Unique payment ID in the Merchant's system Recommended format: GUID/UUID or alphanumeric. Other formats may cause failures in banking services | String [1..50] Mandatory |
| Amount | Payment amount in kopecks (or another minor unit of the terminal currency) Digits only, without decimal or other separators | Integer Mandatory |
| PayInfo | Transaction parameters URL-encoded string of key-value pairs separated by “;” (semicolon). Keys and values are separated by “=” (equals sign) | String Mandatory |
| CustomFields | Additional transaction fields URL-encoded string of key-value pairs separated by “;” (semicolon). Keys and values are separated by “=” (equals sign) | String Optional |
| Cheque | Fiscal receipt data in JSON format, Base64-encoded | String Optional |
PayInfo parameter structure
Important! The OrderId and Amount parameters are passed twice in the same request: among the main request parameters and inside the PayInfo parameter.
| Parameter | Description | Format |
|---|---|---|
| PAN | Card number Digits without spaces | String [13..19] Mandatory |
| EMonth | Card expiration month 2 digits | Integer Mandatory |
| EYear | Card expiration year Last 2 digits of the year | Integer Mandatory |
| OrderId | Unique payment ID in the Merchant's system Recommended format: GUID/UUID or alphanumeric. Other formats may cause failures in banking services | String [1..50] Mandatory |
| Amount | Payment amount in kopecks (or another minor unit of the terminal currency) Digits only, without decimal or other separators | Integer Mandatory |
| SecureCode | CVC2/CVV2 code 3 or 4 digits. Whether it is required depends on the payment type and the payment terminal configuration | Integer Optional |
| CardHolder | Cardholder's last name and first name Latin letters and spaces only | String [1..30] Optional |
Example of the PayInfo parameter (decoded):
PAN=4111111111100031;
EMonth=12;
EYear=22;
CardHolder=Ivan Ivanov;
SecureCode=123;
OrderId=5f63838d-fb03-00c6-c890-c67cfc1c54ea;
Amount=12480Examples of possible CustomFields keys
| Parameter | Description | Format |
|---|---|---|
| IP | Customer's IP address IPv4 or IPv6 | String Optional |
| Description | Additional payment description | String Optional |
Example of the CustomFields parameter (decoded):
IP=241.22.197.12;
Description=MyTestTransactionResponse
Response examples
<Block OrderId="5f63838d-fb03-00c6-c890-c67cfc1c54ea" Key="Merchant" Success="True" Amount="12492"/>XML string with the Block element.
| Parameter | Description | Format |
|---|---|---|
| Success | Operation success flag. Possible values:True — the operation succeededFalse — the operation failed3DS — 3‑D Secure authentication is required | String Mandatory |
| OrderId | Payment ID in the Merchant's system Matches the value passed in the request | String [1..50] Mandatory |
| Key | Payment terminal name Matches the value passed in the request | String Mandatory |
| Amount | Payment amount in kopecks (or another minor unit of the terminal currency) Returned if “Success=True” or “Success=3DS”. Matches the value passed in the request | Integer Optional |
| ACSUrl | 3-D Secure authentication server (ACS) URL Returned if “Success=3DS” | String Optional |
| PaReq | 3-D Secure authentication request Returned if “Success=3DS” | String Optional |
| ThreeDSKey | Unique transaction ID (MD) Returned if “Success=3DS” | String Optional |
| ThreeDSVersion | 3-D Secure protocol version: 1.0 — version 1 2.1 — version 2 Returned if “Success=3DS” | String Optional |
| FinalTerminal | Final terminal on which the payment was processed Returned if the payment was forwarded to another terminal | String Optional |
| AddInfo | Additional transaction parameters that can be returned in the payment gateway response by arrangement with Payture support The format and possible parameters are described here (in Russian) | Object Optional |
| ErrCode | Error code. See error codes Returned if “Success=False” | String Optional |
Pay3DS
The Pay3DS command completes the charge of funds from a card protected by 3-D Secure. It is called after the Pay request, once the 3-D Secure authentication results have been received from the issuing bank.
Block3DS
The Block3DS command completes the hold of funds on a card protected by 3-D Secure. It is called after the Block request, once the 3-D Secure authentication results have been received from the issuing bank.
