Xsolla servers integration

With this type of integration, the following tasks are performed on the Xsolla side:

  • Catalog storage and management
  • Price management
  • Storing data on regional prices
  • Regional restrictions management
  • Inventory management
  • Promotional campaign management
  • User authentication
  • User access management
  • Transaction processing

You don’t need to configure your own server for these tasks.

Integration flow

After the integration is complete, test the payment process.

To integrate the Payments library:

  1. Download and install Android Studio.
  2. Create a new project.
  3. Set up the project in your Publisher Account.
  4. Set up the Virtual Currency module (optional).
  5. Set up the Virtual Items module (optional).
  6. Set up Pay Station.
  7. Get a token.
  8. Install the library.
  9. Set up event processing and SDK methods.

Contact our integration team
Click the chat icon in the bottom right corner and contact the integration team via a messenger. We’ll answer you in real time and will help to resolve the problem.
This guide describes the minimum settings required to quick-start the module. For any questions, contact your Account Manager or email at integration@xsolla.com.

Create project in Publisher Account

  1. Sign up to Publisher Account.
  2. Configure your project:
    1. To fill in the game data automatically, provide the Link to your game on any platform. This adds an image of the game, its name, and description to the project settings.
    2. To fill in the game data manually, click I don’t have a link, set up manually and specify:
      • Project languages (default: English)
      • Project name for all specified languages
      • Game website (optional)
    3. Click Create project.

During the integration process, you need to provide the project ID that can be found in your Publisher Account next to the name of your project.

Set up Virtual Currency module

  1. Open your project in Publisher Account.
  2. Click Connect in the Store pane. You can go to the In-Game Store settings from any section of Publisher Account by clicking the Store in the side menu.

  1. Click Connect in the Virtual Currency pane.

  1. Create virtual currency:
    1. Click Create virtual currency.

    1. Specify the following information:
      • SKU
      • currency name
      • price of one unit of virtual currency
      • default currency
      • features of hard virtual currency (optional)
      • image (optional)
    2. Click Create currency.

  1. Create packages of virtual currency:
    1. Go to Packages.
    2. Click Create package.

    1. Specify the following information:
      • SKU
      • package name
      • short description
      • virtual currency
      • quantity of currency units in a package
      • price
      • default currency
      • image (optional)

    1. Set the Show in Store toggle to On.
    2. Click Create package.

The library supports purchasing of virtual items for virtual currency. Also, the users are able to use virtual currency according to in-game logics (getting access to a location, getting progression levels, etc.). Users spend virtual currency when calling a Xstore.consumeItem SDK method.

Set up Virtual Items module

The SDK methods support the following types of items:
  • Consumable item — an item in the inventory that can be accrued or purchased repeatedly and decreases in its number once used. The item stock can be replenished. Example: grenades and bullets to attack the opponents, first aid kits, etc.
  • Nonconsumable — an item in the inventory that can be accrued or purchased only once and doesn’t disappear from the inventory. Example: access to a location, status, etc.
  • Nonrenewing subscription — a nonconsumable item that is available for a limited period of time and doesn’t disappear from the inventory when it expires. For example, premium access or season access. For more details, see In-Game Store documentation.

  1. Open your project in Publisher Account.
  2. Click Connect in the Store pane. You can go to the In-Game Store settings from any section of Publisher Account by clicking the Store in the side menu.

  1. Click Connect in the Virtual Items pane.

  1. Click Create a group.

  1. Specify Group code and Group name.
  2. Set the Show group in Store toggle to On.
  3. Click Create group.

  1. Create items:
    1. Specify the following info for each of them:
      • one or more groups that the item should belong to
      • SKU
      • name and a short description
      • prices in real and virtual currencies
      • image (optional)

    1. In the Item property field of the Preferences section, select one of the following properties depending on the type of item:
      • consumable
      • nonconsumable
      • nonrenewing subscription
    2. Click Create an item.

  1. Make sure that the group status is Enabled.

Set up Pay Station in Publisher Account

  1. Go to your project and click Open in the Pay Station block. If you have not previously installed the Store module, click Connect in the Pay Station block.

  1. Open Pay Station settings.
  2. Specify Return URL and Redirect conditions in the Redirect policy block and click Save.

To redirect users to an Android application, the return URL must match the scheme app://xpayment.<ANDROID_PACKAGE_NAME>, where <ANDROID_PACKAGE_NAME> is the package name of the Android application.

Get token

You need a token to make the SDK work properly. An access token is a string that is used to initiate the payment process.

You can get a token using Create Order with All Items from Particular Cart method from Xsolla Store library. Or you can use another access token, e.g. the token received from PlayFab.

Install library

The library is available in Maven Central.

To install the library:

  1. Start Android Studio.
  2. Open build.gradle file of your application.
  3. Add the following line to the dependencies section, where <version_number> is the required version of the Payments library:

Latest version:

Full screen
Small screen
implementation 'com.xsolla.android:payments:<version_number>'

Test payment process

After successfully configuring the library, test the payment process. By default, all payments are in the sandbox mode and you can use a test bank card to simulate a successful payment process.

Test the payment process by making real payments:

  1. Make sure that you have signed a contract with Xsolla.
  2. Set .isSandbox(false) while building a Paystation Intent.

After the first real payment is made, a strict sandbox payment policy takes effect. A payment in the sandbox mode is available only to users who are specified in Publisher Account > Company settings > Users.
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!

Continue reading

Last updated: May 6, 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!