How to configure redirects

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

  • automatic — a redirect in a set delay time.
  • manual — a redirect after a user closes the payment UI or clicks the redirect button.
  • Note
    You can configure different types of redirects for different payment statuses.

    Configure automatic redirects

    You can configure automatic redirects:

  • in Publisher Account
  • via API
  • Notice
    Redirect configurations passed via API take priority over the ones set in Publisher Account.

    Configure automatic redirects in Publisher Account

    1. Open your project in Publisher Account and go to Pay Station > Settings > Redirect policy.

    1. In the Return URL field, enter a URL address or a path a user will be redirected to after making a payment.
    2. In the drop-down list, choose Redirect conditions:
      • 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.
    3. In the Delay field, enter a redirect timeout in seconds.
    4. Click Save.

    Notice
    By default, a redirect is activated in 0 seconds.

    Configure automatic redirects via API

    Redirect configurations are specified in the return_url parameter and the redirect_policy parameter group in the Create token endpoint.

    1. In the return_url parameter, pass a URL address or a path a user will be redirected to after making the payment.
    2. Set the autoredirect_from_status_page parameter to true.
    3. In the delay parameter, pass a redirect timeout in seconds.
    4. In the redirect_conditions parameter, pass conditions when a redirect is activated:
      • 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.

    Configure manual redirects

    You can configure manual redirects:

    Notice
    Redirect configurations passed via API take priority over the ones set in Publisher Account.

    Configure manual redirects in Publisher Account

    1. Open your project in Publisher Account and go to Pay Station > Settings > Redirect policy.

    1. In the Return URL field, enter a URL address or a path a user will be redirected to after making a payment.
    2. In the drop-down list, choose Redirect conditions:
      • 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.
    3. Leave the Delay field empty.
    4. In the Status for manual redirection drop-down list, choose a payment status when the redirect button appears.
    5. In the Redirect button caption field, enter the copy for the button that will redirect a user to the return URL.
    6. Click Save.

    Notice

    By default, the redirect button copy is Back to the Game. It is localized into all Pay Station languages.

    If your project supports several languages, you can enter 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.

    Configure manual redirects via API

    Redirect configurations are specified in the return_url parameter and the redirect_policy parameter group in the Create token endpoint.

    1. In the return_url parameter, pass a URL address or a path a user will be redirected to after making a payment.
    2. In the redirect_conditions parameter, pass conditions when a redirect is activated:
      • 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.
    3. In the manual_redirection_action parameter, pass the payment UI behavior triggered by the user clicking the close button or the return button:
      • redirect (by default) — a user is redirected to the return URL.
      • postmessage — clicking the close icon initiates sending the close-widget event, and clicking the return button — the return event. In this case, a user isn’t redirected to the return URL. You need to configure processing of events for closing the payment UI or redirection.
    4. In the redirect_button_caption parameter, pass copy for the button that will redirect a user to the return URL.
    5. In the status_for_manual_redirection 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.

    Notice
    If the payment UI is opened in an iframe and the ui.desktop.header.close_button parameter is set to true, only the postmessage event is sent when a user clicks the close icon. It allows you to process the event and close the payment UI, and a user can stay at the page from which the payment was initiated.

    Examples of redirect configuration

    EXAMPLE 1

    If you use the same project in Publisher Account to process payments on different platforms, you can configure default redirects for payments processed in a browser and customized redirects — for mobile devices.

    To configure default redirects, in the return_url parameter, pass a URL address or a path a user will be redirected to after making a payment. A customized automatic redirect with 3 seconds delay may look like this:

    Copy
    Full screen
    Small screen
      {
          "redirect_policy": {
          "redirect_conditions": "successful",
          "autoredirect_from_status_page": true,
          "delay": 3
        }
      }

      EXAMPLE 2

      If you sell your items on a website and also use a game launcher, you can configure redirects for a website in your Publisher Account and customize redirect configurations for the launcher in the token:

      Copy
      Full screen
      Small screen
        {
          "redirect_policy": {
            "redirect_conditions": "successful_or_canceled",
            "status_for_manual_redirection": "successful_or_canceled",
            "manual_redirection_action": "postmessage"
          }
        }

        Was this article helpful?
        Thank you!
        Is there anything we can improve? Message
        We’re sorry to hear that
        Please explain why this article wasn’t helpful to you. Message
        Thank you for your feedback!
        We’ll review your message and use it to help us improve your experience.
        Rate this page
        Rate this page
        Is there anything we can improve?

        Don’t want to answer

        Thank you for your feedback!
        Last updated: August 24, 2021

        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!