Redirect integration
Redirect integration is a simple and secure process that uses the payment page on the payment gateway side. The main advantage of this integration method is that you don't need to collect and process card data on your website. The API is used minimally in this case, so this method does not require much development expertise.
A customer selects a product in the online store, and then clicks Buy.
The online store server receives a purchase request.
-
The online store server requests an order registration by sending the register.do API call to the payment gateway. This request must contain the
amount
parameter (the payment amount in minor currency units) and thereturnUrl
parameter (the address to which the customer will be redirected after successfull payment in step 9). Read more about redirect after payment here.Request example:
curl --request POST \ --url https://3dsec.berekebank.kz/payment/rest/register.do \ --header 'content-type: application/x-www-form-urlencoded' \ --data amount=2000 \ --data currency=398 \ --data userName=test_user \ --data password=test_user_password \ --data returnUrl=https://mybestmerchantreturnurl.com \ --data description=my_first_order \ --data language=en
POST/payment/rest/register.do
Alternatively, you can hold the amount on account before the charge by using the registerPreAuth.do call. For more details about hold and capture, click here.
-
The payment gateway server registers an order and sends a response to the online store server. The response contains the
formUrl
parameter (the payment URL to which the online store should redirect the customer in step 5) and theorderId
parameter (the unique order number in the payment gateway system, will be used in step 10).Response example:
{ "orderId": "01491d0b-c848-7dd6-a20d-e96900a7d8c0", "formUrl": "https://3dsec.berekebank.kz/payment/merchants/payment_en.html?mdOrder=01491d0b-c848-7dd6-a20d-e96900a7d8c0" }
The online store redirects the customer to the URL received in the
formUrl
parameter. The redirection may be done in the same window or in a new window.The payment gateway opens the payment URL.
-
The customer enters his or her card number, expiration date, and CVV/CVC, and clicks Pay.
Alternatively, it is possible to use tokenized payments via Apple Pay or Google Pay wallets. In this case, the customer selects the corresponding option. Read more about using tokenized payments here.
The payment gateway processes the payment request.
-
The customer is redirected to the online store page defined in the
returnUrl
parameter (specified in step 3). -
The online store sends the getOrderStatusExtended.do request to the payment gateway to check the order status and make sure the order is really paid. The request contains the
orderId
parameter received in step 4. In response, the payment gateway returns the order status in theorderStatus
parameter. Status2
means a succesfull payment. Additionally, theactionCode
parameter is returned - it contains the response code from the processing bank. See the list of response codes here. Find more details in the Getting the order status section.