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
  • management of promotional campaigns
  • user authentication
  • user access management
  • transaction processing
Discord server
Connect with the Xsolla team and developers who use Xsolla products.
You don’t need to configure your own server side for these tasks.

Integration flow

To integrate with Xsolla servers using the Game Commerce plug-in:
  1. Install the plug-in.
  2. Set up the project in your Publisher Account.
  3. Set up Login or implement your own authorization system using the Pay Station access token.
  4. Set up the Virtual Currency module (optional).
  5. Set up the Virtual Items module.
  6. Set up your UE4 project.
After the integration is complete, test the payment process.
Note
This guide describes the minimum settings required to quick-start the module. For any questions, contact your Account Manager.

Install plug-in

  1. Download the Epic Games Launcher.
  2. Create a new UE4 project.
  3. Download plug-in from Unreal Engine Marketplace or GitHub.

After installing the plug-in, launch demo maps from the Content Browser > Xsolla Content > Maps directory. Demo maps show the features of the plug-in and represent a possible implementation of the application logic.

For demo maps, a project in Publisher Account is preset and an in-game store is fully configured.

Default values for demo maps:

KeyValue
Login ID026201e3-7e40-11ea-a85b-42010aa80004
Project ID77640

You can use demo maps in two ways:

  • as an example
  • as an initial version of the login system, inventory, and in-game store in order to get a quick result and expand its capabilities if necessary

Set up project in your Publisher Account

  1. Sign up to Publisher Account.
  2. Configure a Publisher Account project. The first project is automatically created after you sign up for an account:
    1. In the Projects section, select your project and go to Project settings.
    2. In the General settings tab, add the following:
      • image (optional)
      • project languages (English is set by default)
      • project name for all specified languages
      • game website (optional)
      • project description (optional)
    3. Click Save.

During the integration process, you will need the following parameters:

  • Project ID found in Project settings > Project ID.

  • Login ID found in Login settings > Login ID. It has the UUID format.

Set up Login

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

  1. Go to Login projects and click Set up Login.

  1. Specify a Name and click Create.

  1. Go to General settings > URL block and specify the Callback URL that the user is redirected to after the email confirmation or password reset.
  2. Select the Xsolla storage in the User data storage block.
  3. Set up OAuth 2.0 authorization:

    1. Go to the Authorization block.
    2. Click Connect in the OAuth 2.0 authentication pane.
    3. Specify OAuth 2.0 redirect URIs and click Connect.
    4. Copy and save the Client ID.

Note
OAuth 2.0 is the recommended authentication method and is selected in the SDK settings by default.

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.

Note
The plug-in 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 ConsumeInventoryItem SDK method.

Set up Virtual Items module

Note
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 UE4 project

  1. Open your UE4 project in Unreal Editor.
  2. For Blueprint projects only:
    1. Compile your UE4 project.
    2. Go to the Content Browser and add a New C++ Class with the None parent node.
  3. Go to Settings > Plugins > Installed > Xsolla Store SDK. Check the Enabled box and click the Restart Now button to save settings and reload the Unreal Editor.

  1. Specify project parameters:
    1. Go to Settings > Project Settings > Plugins > Xsolla Login and specify the following parameters:

      1. In the Login ID and Demo Login ID fields, specify the Login ID from Publisher Account.
      2. In the Project ID and Demo Project ID fields, specify the Project ID from Publisher Account.
      3. Enable Use OAuth 2.0 option.
      4. In the Client ID field, specify Client ID received when setting up OAuth 2.0 in Publisher Account.

Note
If you use your own authorization system, you do not need to fill in Login ID and Demo Login ID fields.

    1. Go to Settings > Project Settings > Plugins > Xsolla Store and specify the Project ID in the Project ID and Demo Project ID fields.

    1. Go to Settings > Project Settings > Plugins > Xsolla Inventory and specify the Project ID in the Project ID and Demo Project ID fields.

As a result, your project in Publisher Account will be connected to demo maps.

  1. Go to Content Browser > View Options and check the boxes for Show Engine Content and Show Plugin Content.

  1. Go to Content Browser > Xsolla Content > Maps and launch the Demo_Store map of the game. Make sure that the authorization and other functions are working correctly.
  2. Design an interface for the login system, in-game store, and other pages for your application.

Note
You can create your own solution by following UMG UI documentation, or use the demo scene as a template. To adapt the demo scene interface to your application, use the UI builder.

  1. Set up event handling according to your application logic using SDK methods. Follow the step-by-step tutorials to get started with basic SDK features.

Note
To modify the SDK for your application specifics, follow the SDK modification instruction.

Test payment process

After successfully configuring the plug-in, test the payment process. By default, all payments are in sandbox mode for any users. 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. In your UE4 project, uncheck the Sandbox box in Settings > Project Settings > Plugins > Xsolla Store.

Note
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: September 1, 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!