Settle request is used for confirmation of withdrawal of payment Auth. The result of processing of the request is withdrawal of previously blocked monetary assets from the client’s card. The operation is available for transactions Purchase and Charge(host-2-host) with the type merchantTransactionType = AUTH.
Request parameters
The request with required parameters is to be formed on merchant’s side and to be transferred with POST method through HTTP protocol to URL https://api.wayforpay.com/api
For the purposes of confirmation of data validity there should be generated and transferred in the request the HMAC_MD5 control signature using SecretKey of merchant.
The line which subjects to HMAC_MD5 is generated through catenation of parameters merchantAccount, orderReference, amount, currency divided with “;” (semi-column) in coding UTF-8
Parameter | Description | Mandatory |
---|---|---|
transactionType | Type of request takes the value SETTLE | yes |
merchantAccount | Seller identifier | yes |
orderReference | Unique number of the order in merchant’s system | yes |
amount | The amount of write-offs confirmation | yes |
currency | Write-off currency | yes |
merchantSignature | Signature of the order | yes |
apiVersion | The protocol version. Default value: 1
| yes |
productName[] | Array with the names of ordered productsemail@mail.com | no |
productPrice[] | Array with the prices per product units, This information will be visible at the page of payment for order | no |
productCount[] | Array with the quantity of ordered products on each item. | no |
Response parameters:
The line which subjects to HMAC_MD5 is generated through catenation of parameters merchantAccount, orderReference, amount, currency, authCode, cardPan, transactionStatus, reasonCode divided with “;” (semi-column) in coding UTF-8
Parameter | Description | Example |
---|---|---|
merchantAccount | Seller identifier | test_merch_n1 |
orderReference | Unique number of the order in merchant’s system | 1212dd1 |
merchantSignature | hash_hmac |
|
amount |
Confirmation the amount of write-offs of blocked funds. The amount may be ≤ amount of AUTH | 100 |
currency | Currency | UAH |
authCode | Authorization code - assigned by Bank | 324567 |
createdDate | Date of creation request in psp | 123456789 |
processingDate | date of transaction processing | 12345678 |
cardPan | Masked card number | 42****4242 |
cardType | Card Type: Visa/MasterCard | Visa |
issuerBankCountry | Country of card | 980 |
issuerBankName | Name of the Bank card | PrivatBank |
recToken | Card token for recarring withdrawals | 121213321-3213213-3213213-321-3 |
transactionStatus | transaction status | Approved |
reason | Reason for refusal | Ok |
reasonCode | Code of refusal | 1100 |
fee | Commission psp | 0.00 |
paymentSystem | The payment system, through which the payment was made. | card |
An example of request and response
{
"transactionType":"SETTLE",
"merchantAccount":"test_merchant",
"orderReference":"DH783023",
"amount":100,
"currency":"UAH",
"merchantSignature":"b95932786cbe243a76b014846b63fe92",
"apiVersion": 1
}
Response:
{
"merchantAccount":"test_merch_n1",
"orderReference":"DH783023",
"merchantSignature":"",
"amount":100,
"currency":"UAH",
"authCode":"541963",
"createdDate":12345678,
"processingDate":12345678,
"cardPan":"41****8217",
"cardType":"visa",
"issuerBankCountry":"980",
"issuerBankName":"Privatbank",
"recToken":"",
"transactionStatus":"Approved",
"reason":ok,
"reasonCode":"1100",
"fee":0,
"paymentSystem":"card"
}