Ensuring If The Order Completed And Redirecting Customer To Success Page

Hello. I am developing an addon. The addon is a credit card payment integration. I am sending the credit card form to the payment provider's web site that will be processed. I can get the response from provider (Success or Failed)

I want to redirect the customer if the payment is success.

I think I need to use process at the page following: http://docs.cs-cart.com/4.4.x/developer_guide/addons/tutorials/payment_processor_addon.html

But don't understand exactly how to do.

I sent data form to the URL which will be processed by using fn_create_payment_form function. Data form processed successfully but browser stops there at the form page and nothing redirects anywhere. Where can I receive processed answer from the payment service?

Here below you can see the page at payment service. Script stops here and nothing is redirected back anywhere.

The way of receiving payment response depends on payment gateway. For some systems you should specify URL in the payment request, sometimes it should be specified in the merchant dashboard and for another ones you should call special requests to receive transaction status. As there is no universal way, check integration manual for your payment processor

Thanks eCom.