Payment processing scenario
Payment processing scenario
To process payments with the option to pay through the AIS "Raschet" (ERIP) system, you need to generate a JSON API request or a standard authorization request (Order creation for payment). For testing, specify the address https://securesandbox.webpay.by; for processing production payments, use https://payment.webpay.by.
If it is necessary to create an invoice with the possibility of payment until a specific date, the authorization request must include the wsb_due_date field. The value of this field should contain a Unix Timestamp until which the invoice will be available for payment.
After executing the request, a page with payment details will be displayed.
If the client is configured to accept payments only through the AIS "Raschet" (ERIP) system, a page with a payment information block will be displayed.

If the client, in addition to the ERIP payment method, has the option to pay by bank card, an additional tab for selecting the payment method will be displayed on the payment page.
It is also possible to define the active tab with the payment instrument when redirecting to the WEBPAY payment page. When passing the wsb_tab field with the value erip in the POST request, the tab for paying the order via the ERIP system will be active.

The payer has the option to save the order information to make the payment later. To do this, they need to click the "Pay Later" button. As a result, information about the order will be sent to the specified email address.
Below are examples of emails that will be sent to the payer with order information.
If the client is set up to accept payments only through the AIS "Raschet" (ERIP) system.

If the client is set up for both online bank card payments and payments through the AIS "Raschet" (ERIP) system.

<form action="https://securesandbox.webpay.by/" method="post">
<input type="hidden" name="*scart">
<input type="hidden" name="wsb_version" value="2">
<input type="hidden" name="wsb_language_id" value="russian">
<input type="hidden" name="wsb_storeid" value="11111111">
<input type="hidden" name="wsb_store" value="Your Store Name">
<input type="hidden" name="wsb_order_num" value="ORDER-12345678">
<input type="hidden" name="wsb_test" value="1">
<input type="hidden" name="wsb_currency_id" value="BYN">
<input type="hidden" name="wsb_seed" value="1242649174">
<input type="hidden" name="wsb_return_url" value="http://yoursiteurl.com/success.php">
<input type="hidden" name="wsb_cancel_return_url" value="http://yoursiteurl.com/cancel.php">
<input type="hidden" name="wsb_notify_url" value="http://yoursiteurl.com/notify.php">
<input type="hidden" name="wsb_invoice_item_name[0]" value="Product 1">
<input type="hidden" name="wsb_invoice_item_quantity[0]" value="2">
<input type="hidden" name="wsb_invoice_item_price[0]" value="10">
<input type="hidden" name="wsb_invoice_item_name[1]" value="Product 2">
<input type="hidden" name="wsb_invoice_item_quantity[1]" value="1">
<input type="hidden" name="wsb_invoice_item_price[1]" value="0.5">
<input type="hidden" name="wsb_total" value="20.90">
<!-- SecretKey value in the example is 1 -->
<input type="hidden" name="wsb_signature" value="266e9c04a24dfb5fc75775c42a831a49488f8303">
<input type="hidden" name="wsb_shipping_name" value="Shipping Cost">
<input type="hidden" name="wsb_shipping_price" value="0.98">
<input type="hidden" name="wsb_discount_name" value="Product Discount">
<input type="hidden" name="wsb_discount_price" value="0.58">
<input type="hidden" name="wsb_due_date" value="1586684975">
<input type="submit" value="Buy">
</form>