SDK pour Unity (PC, Web) / Informations générales
  Retour à la documentation

SDK pour Unity (PC, Web)

Informations générales

The payment UI is based on the Pay Station product. The choice of available payment methods and other settings are available in Publisher Account in the Pay Station section.

The way of opening the payment UI depends on the platform for which your application is built:

  • For desktop applications, the SDK allows you to open the payment UI in the built-in browser.
  • For mobile applications, the payment UI opens in an external browser.
  • For WebGL, the payment UI widget opens in an iframe on the same browser page.

The SDK supports the item purchase from the catalog in one click or via the shopping cart.

To test the purchase process, you can use sandbox mode of payment UI and test cards. The sandbox mode only simulates the behavior of a payment method; no real money is involved. To try sandbox, you don’t need to sign any agreements with Xsolla or pay any fees.

Avis
After the first real payment is made, a strict sandbox payment policy takes effect. Payments made in sandbox mode are available only to users who are specified in Publisher Account in the Company settings > Users section.

Instructions

Learn about advanced setups from our how-tos.

Comment configurer la redirection des utilisateurs vers votre application après un paiement

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:

  • in Publisher Account — use this option if you are setting up a project for a single application and don’t plan to create builds for different platforms.

  • in the SDK settings — use this option if you plan to:
    • use the project for multiple applications
    • create builds for different platforms
    • sell in-game items via the website
Avis
If redirects are configured in Publisher Account and SDK settings, the parameters specified in the SDK settings are used.

Configurer les redirections dans le Compte éditeur

  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 a mobile application, the URL must match one of the following schemes:

You can find the <ANDROID_PACKAGE_NAME>/<BUNDLE_ID> value in the Unity project settings (Edit > Project Settings > Player > Android (iOS) > Other Settings > Bundle 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.
Avis

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.

Configurer les redirections dans les paramètres du SDK

  1. Open your Unity project.
  2. Click Window > Xsolla > Edit Settings in the main menu.
  3. Open the Inspector panel and go to the Pay Station > Redirect Policy section.
  4. Go to the section corresponding to your application’s build platform (Desktop, WebGL, Android, or iOS) and specify the redirect parameters:
    1. Uncheck the Use setting from Publisher Account box.
    2. 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 a mobile application, the URL must match one of the following schemes:

You can find the <ANDROID_PACKAGE_NAME>/<BUNDLE_ID> value in the Unity project settings (Edit > Project Settings > Player > Android (iOS) > Other Settings > Bundle Identifier).

    1. To set automatic redirect parameters:
      1. In the drop-down list, choose Redirect Conditions:
        • 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 Redirect Timeout field, enter a redirect timeout in seconds.
    1. To set manual redirect parameters:
      1. In the drop-down list, choose Status for Manual Redirection:
        • 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 will redirect a user to the return URL.
Avis

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.

Cet article vous a été utile ?
Merci !
Que pouvons-nous améliorer ? Message
Nous sommes désolés de l'apprendre
Dites-nous pourquoi vous n'avez pas trouvé cet article utile. Message
Merci pour votre commentaire !
Nous examinerons votre message et l'utiliserons pour améliorer votre expérience.
Masquer

Comment configurer les paiements via Steam

Avis
Use this how-to guide if you included the demo project in your Unity project.

Xsolla can act as a payment gateway when players pay for in-game purchases via Steam. In this case, you don’t need to integrate the Steam SDK or take into account the nuances of paying via Steam when setting up an in-game store.

To set up payments via Steam:

  1. Sign an additional agreement with Xsolla.

Note
Xsolla takes a reduced revenue share when making payments via Steam. Check the details with your Account Manager.
  1. Set up the gateway for Steam in your Publisher Account.
  2. Set up native authentication via Steam.
  3. Open the Unity project.
  4. Click Window > Xsolla > Demo Settings in the main menu.
  5. In the Inspector panel, select Steam Gateway from the Payments Flow drop-down list.

After changing the Unity project settings, the x-steam-userid header is added to the payment token request using the PurchaseItem SDK method.

Cet article vous a été utile ?
Merci !
Que pouvons-nous améliorer ? Message
Nous sommes désolés de l'apprendre
Dites-nous pourquoi vous n'avez pas trouvé cet article utile. Message
Merci pour votre commentaire !
Nous examinerons votre message et l'utiliserons pour améliorer votre expérience.
Masquer

Poursuivre la lecture

Dernière mise à jour: 6 Mars 2024

Faute de frappe ou autre erreur dans le texte ? Sélectionnez le texte concerné et appuyez sur Ctrl+Entée.

Signaler un problème
Nous améliorons continuellement notre contenu grâce à vos commentaires.
Indiquez votre adresse e-mail pour un suivi
Merci pour votre commentaire !