SDKs for Unity / Item purchase
 Back to Docs

SDKs for Unity

  • Integration guide

  • Demo project

  • Authentication

  • Catalog

  • Subscriptions

  • Promotions

  • Item purchase

  • Player inventory

  • User account and attributes

  • Application build guides

  • Troubleshooting

    • General information

      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.

      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.


      Learn about advanced setups from our how-tos.

      How to set up payments via Steam

      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.

      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.

      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.

      Useful links

      Last updated: August 24, 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!