For any question, we are one click away

Contact us

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.

Redirect integration

Before you begin, make sure you have created an account or logged in.
  1. A customer selects a product in the online store, and then clicks Buy.

  2. The online store server receives a purchase request.

  3. 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 the returnUrl 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://uat.dskbank.bg/payment/rest/register.do \
    --header 'content-type: application/x-www-form-urlencoded' \
    --data amount=2000 \
    --data currency=975 \
    --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.

  4. 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 the orderId 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://uat.dskbank.bg/payment/merchants/payment_en.html?mdOrder=01491d0b-c848-7dd6-a20d-e96900a7d8c0"
    }
  5. 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.

  6. The payment gateway opens the payment URL.

  7. 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.

  8. The payment gateway processes the payment request.

  9. The customer is redirected to the online store page defined in the returnUrl parameter (specified in step 3).

  10. 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 the orderStatus parameter. Status 2 means a succesfull payment. Additionally, the actionCode 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.

Categories:
eCommerce API V1
Categories
Search results