Set up user redirection

To redirect users to another page after they completed the payment, you can configure two types of redirects:

  • automatic — a redirect with a set delay.
  • manual — a redirect after a user closes the payment UI or clicks the redirect button.

You can configure a redirect in the following ways:

  • during the order creation - use this option if you plan to use the project for multiple applications or to sell in-game items via the website.

Notice
If redirects are configured in Publisher Account and during order creation, the parameters specified during order creation are used.

Configure redirects in Publisher Account

  1. Open your project in Publisher Account.
  2. Click Pay Station in the side menu.
  3. Go to the Settings > Redirect policy section.

  1. In the Return URL field, enter the URL or path where a user is redirected to after making a payment.

Note
To redirect users to an iOS application, the URL must match the following scheme: app://xpayment.<BUNDLE_ID>, where <BUNDLE_ID> is the iOS application identifier.

  1. To set automatic redirect parameters:
    1. In the drop-down list, choose Automatic redirect condition:
      • None — do not redirect.
      • Successful payment — redirect when a payment is successful.
      • Successful or canceled payment — redirect when a payment is successful or canceled.
      • Any payment — redirect for any payment status.
    2. In the Delay field, enter a redirect timeout in seconds.

  1. To set manual redirect parameters:
    1. In the drop-down list, choose Manual redirect condition:
      • None — do not redirect.
      • Successful payment — the redirect button appears when a payment is successful.
      • Successful or canceled payment — the redirect button appears when a payment is successful or canceled.
      • Any payment — the redirect button appears for any payment status.
    2. In the Redirect button caption field, enter the copy for the button that redirects a user to the return URL.

Notice

The redirect button copy is Back to the Game by default. It is localized in all Pay Station languages.

If your project supports several languages, you can specify redirect button copy for each of them in the respective fields.

When a user closes the payment UI, they are also redirected to the specified return URL.

  1. Click Save.

Configure redirects during the order creation

Create a paymentProjectSettings object and pass it to the order creation method (createOrder). In the object, set the redirect settings:

  1. In the returnUrl parameter, pass the URL address or path where a user is redirected after making a payment.

Note
To redirect users to an iOS application, the URL must match the following scheme: app://xpayment.<BUNDLE_ID>, where <BUNDLE_ID> is the iOS application identifier.

  1. To set automatic redirect parameters:
    1. In the redirectPolicy.redirectConditions parameter, pass conditions when a redirect is activated:
      • none — do not redirect.
      • successful — redirect when a payment is successful.
      • successfulOrCanceled — redirect when a payment is successful or canceled.
      • any — redirect for any payment status.
    2. In the delay parameter, pass the redirect timeout in seconds.

  1. To set manual redirect parameters:
    1. In the statusForManualRedirection parameter, pass a payment status when the redirect button appears:
      • none — do not redirect.
      • successful — redirect when a payment is successful.
      • successful_or_canceled — redirect when a payment is successful or canceled.
      • any — redirect for any payment status.
    2. In the redirectButtonCaption parameter, pass the copy for the button that redirects a user to the return URL.

Notice

The redirect button copy is Back to the Game by default. It is localized in all Pay Station languages.

If your project supports several languages, you can specify redirect button copy for each of them in the respective fields.

When a user closes the payment UI, they are also redirected to the specified return URL.

You can use a demo project as an example of configuring redirects during order creation.

Your progress
Thank you for your feedback!
Last updated: December 27, 2022

Found a typo or other text error? Select the text and press Ctrl+Enter.

Report a problem
We always review our content. Your feedback helps us improve it.
Provide an email so we can follow up
Thank you for your feedback!