Options for returning customers to project after payment

Payment Page allows you to control the way customers are returned to the project after completing a payment. These settings are controlled by several parameters that are passed in the request for payment. The following are these parameters and their possible values.

Return URLs

To set the URL that the user will return to, send merchant_success_url and merchant_fail_url or redirect_fail_url and redirect_success_url with links to redirect you in case of a payment successfully performed or declined. In the first case with merchant_success_url and merchant_fail_url parameters, a customer see a page with the payment result on Payment Page and the return button, which, when clicked, redirects to the specified URL. In the second case with redirect_fail_url and redirect_success_url parameters, a customer is redirected automatically after payment completion to the specified URL without additional steps and the result page.

Pass the URL in the parameter merchant_return_url, to return customers in the project from the payment page by clicking the return button at any step before completing the payment.

Pass the URL in the redirect_return_url to allow customers to return in the project at any step before the payment is completed by clicking the return button. For more information about this functionality setting availability, refer to the ECommPay Key Account Manager.

You can also manage the return methods depending on the browser used by a customer. For more information contact the technical support by support@ecommpay.com.

Return setup

To set up the return of a customer after the payment was made, pass the merchant_success_enabled, after the declined payment—merchant_fail_enabled, at any payment performing step—merchant_return_enabled with one of the values:

  • 0—turned off
  • 1—only in redirect mode (full page)
  • 2—in redirect mode and in iframe mode (on merchant's website)

Return mode

To configure the mode of opening the project page during the return of the user after the payment is made, pass the merchant_success_redirect_mode/redirect_success_mode, after the declined payment—merchant_fail_redirect_mode/redirect_fail_mode, or at any payment performing step—merchant_return_redirect_mode with one of the values:

  • iframe—opening in iframe mode (embedded in the web page)
  • parent_page—opening in a modal window
  • blank_page—opening a new browser tab

Return mode examples

If Payment Page is opened in the iframe mode:
merchant_success_redirect_mode merchant_fail_redirect_mode merchant_return_redirect_mode merchant_success_enabled merchant_fail_enabled merchant_return_enabled Expected Result
iframe 0 no return button
1 no redirection, JavaScript callbacks processing
2 redirection in iframe
parent_page 0 no return button
1 no redirection, JavaScript callbacks processing
2 full page redirection
blank_page 0 no return button
1 no redirection, JavaScript callbacks processing
2 redirection in a new tab

If only the merchant_fail_url / merchant_success_url / merchant_return_url parameters are passed, when clicking the Back to website button the redirection does not occur, JavaScript callbacks processing is available.

If the merchant_success_enabled and merchant_fail_enabled parameters are not passed, the return occurs in mode "2".

If Payment Page is opened on the modal page:
merchant_success_redirect_mode merchant_fail_redirect_mode merchant_return_redirect_mode merchant_success_enabled merchant_fail_enabled merchant_return_enabled Expected Result
iframe 0 no return button
1 no redirection, the modal page is closed by button click
2 redirection in iframe
parent_page 0 no return button
1 no redirection, the modal page is closed by button click
2 full page redirection
blank_page 0 no return button
1 no redirection, the modal page is closed by button click
2 redirection in a new tab

If only the merchant_fail_url / merchant_success_url / merchant_return_url parameters are passed, when clicking the Back to website button the modal page is closed.

If the merchant_success_enabled and merchant_fail_enabled parameters are not passed, the return occurs in mode "2".

If Payment Page is opened in a new tab:
merchant_success_redirect_mode merchant_fail_redirect_mode merchant_return_redirect_mode merchant_success_enabled merchant_fail_enabled merchant_return_enabled Expected Result
iframe 0 no return button
1 full page redirection
2 full page redirection
parent_page 0 no return button
1 full page redirection
2 full page redirection
blank_page 0 no return button
1 redirection in a new tab
2 redirection in a new tab

If only the merchant_fail_url / merchant_success_url / merchant_return_url parameters are passed, when clicking the Back to website button the whole page is redirected.

If the merchant_success_enabled and merchant_fail_enabled parameters are not passed, the return occurs in mode "2".