P2P (MTBank)
P2P (MTBank)
General description
For depositing and withdrawing funds on your website, the payer is allowed to use payment cards of MASTERCARD, VISA, BELKART systems. The types of cards to which funds can be withdrawn are determined by the acquiring bank.
Payment module development
The WEBPAY system provides two methods for initiating funds withdrawal using the P2P type:
- JSON API.
- Forming a standard POST request.
Forming a standard POST request
Please Note
All funds withdrawal operations are carried out with mandatory binding to a deposit operation.
To perform a deposit operation and card binding, you need to form one of the following types of requests:
The response will contain a transaction_id for subsequent withdrawal operations.
Funds Withdrawal
To perform a P2P funds withdrawal, you need to form a standard POST request (section Order creation for payment) to the address https://securesandbox.webpay.by/output/mtb for the sandbox environment or https://payment.webpay.by/output/mtb for the production environment, with the following additional fields:
| Field Name | Mandatory | Description |
|---|---|---|
wsb_token_p2p | Yes | The value of this field corresponds to the value of the transaction_id field passed in the notification after the completed deposit and card binding operation |
wsb_output_via_corpocard_mtb | Yes | The field always contains the value true and indicates the execution of a funds withdrawal |
wsb_customer_id | Yes | Unique user identifier in the Store. The field is case-insensitive |
Please Note
When forming a P2P request for funds withdrawal, the fields wsb_invoice_item_name, wsb_invoice_item_quantity, wsb_invoice_item_price are optional.
The electronic signature wsb_signature for forming a P2P funds withdrawal request must be generated according to the following rule from the values of the following fields:
wsb_seedwsb_storeidwsb_customer_idwsb_order_numwsb_testwsb_currency_idwsb_totalSecretKey
The fields must be concatenated into a single string, and the concatenation order must not be violated. Then, depending on the specified protocol version (wsb_version), the MD5 hash (if the version is not specified) or the SHA1 hash (for version 2) of the concatenated string is calculated.
<form action="https://securesandbox.webpay.by/output/mtb" method="post">
<input type="hidden" name="*scart">
<input type="hidden" name="wsb_version" value="2">
<input type="hidden" name="wsb_storeid" value="240869199">
<input type="hidden" name="wsb_order_num" value="ORDER-1234567822223">
<input type="hidden" name="wsb_test" value="0">
<input type="hidden" name="wsb_currency_id" value="BYN">
<input type="hidden" name="wsb_seed" value="dfdasf3i232m13ijdsmcvm">
<input type="hidden" name="wsb_token_p2p" value="164941648452655">
<input type="hidden" name="wsb_output_via_corpocard_mtb" value="true">
<input type="hidden" name="wsb_customer_id" value="164968">
<input type="hidden" name="wsb_return_url" value="https://yoursiteurl.com/success.php">
<input type="hidden" name="wsb_cancel_return_url" value="https://yoursiteurl.com/cancel.php">
<input type="hidden" name="wsb_notify_url" value="https://yoursiteurl.com/notify.php">
<input type="hidden" name="wsb_total" value="1.00">
<!-- The SecretKey value in the example is 1 -->
<input type="hidden" name="wsb_signature" value="c6e16f9fa0837eff0585b1046431a134839fbc14">
<input type="submit" value="Pay Out">
</form>