This type of integration is suitable for partners who have already implemented the game logic for authorization, in-game store, and player’s inventory on their servers and want to use Xsolla Pay Station. You will need to get the Pay Station access token and configure the handling of webhooks.
During server integration, the following payment processing logic is implemented:
- The client sends a request to the application server to open the payment interface.
- The application server sends information about the currency and amount of the payment to the Xsolla server.
- The Xsolla server returns a token with purchase details and Pay Station parameters.
- The application server sends the received token to the client.
- The client opens Pay Station in a browser using the SDK.
- After paying for the purchase, a webhook with the payment status is sent to the application server.
To integrate Xsolla products with your servers using the Game Commerce plug-in:
- Install the plug-in.
- Set up the project in your Publisher Account.
- Set up an in-game store and product catalog on your server.
- Set up your UE4 project.
- Get a token.
- Open the payment UI.
- Set up webhook handling.
After the integration is complete, test the payment process.
- Download the Epic Games Launcher.
- Create a new UE4 project.
- Download plug-in from Unreal Engine Marketplace or GitHub.
After installing the plug-in, launch demo maps from the
For demo maps, a project in Publisher Account is preset and an in-game store is fully configured.
Default values for demo maps:
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
- Sign up to Publisher Account.
- Configure a Publisher Account project. The first project is automatically created after you sign up for an account:
- In the Projects section, select your project and go to Project settings.
- 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)
- Click Save.
You will need the following parameters for the integration:
- Merchant ID found in Project settings > Webhooks.
- API key found in Company settings > API key section.
- Project ID found in Project settings > Project ID.
- Secret key found in Project settings > Webhooks section.
Set up UE4 project
- Open your UE4 project in Unreal Editor.
- For Blueprint projects only:
- Compile your UE4 project.
- Go to the
Content Browserand add a New C++ Classwith the Noneparent node.
- Go to
Settings > Plugins > Installed > Xsolla Store SDK. Check the Enabledbox and click the Restart Nowbutton to save settings and reload the Unreal Editor.
- Go to
Content Browser > View Optionsand check the boxes for Show Engine Contentand Show Plugin Content.
- Design an interface for the login system, in-game store, and other pages for your application. You can create your own solution by following UMG UI documentation.
- Set up event handling according to your application logic using SDK methods.
To obtain a token, use the
- the ID of the user who made the purchase
- amount of payment
- payment currency
- purchase details (optional)
- Pay Station parameters (optional)
You can pass purchase information in one of the following ways:
- as a list of items via the
- as a description of the purchase via the
Pay Station parameters (e.g., localization language, interface properties, theme) are passed in the
settings object. To enable/disable sandbox mode, you need to change the value of the
sandbox parameter in the request to receive a token, and change the SDK settings. To change the rest of the Pay Station interface settings, you need to change the parameters of the request for a token.
custom_parametersparameter. This information will also be passed in the configured webhooks.
Open payment UI
To open the payment UI, pass the token obtained in the previous step to the
LaunchPaymentConsoleWithAccessToken SDK method.
Set up webhooks
- Go to your project in Publisher Account.
- Go to Project settings > Webhooks, specify the Webhook URL, and generate a secret key to sign project webhooks.
- Go to the Checkout tab and click Connect.
- Test the webhook handler.
- HTTP code 204 without a message body
- HTTP code 400 describing the problem if the specified user was not found or if an invalid signature was passed
- Click Pay Station in the side menu and go to Settings.
- Set the Checkout toggle to On.
- Click Save.
Test payment process
After successfully configuring the plugin, 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.
To test the payment process with real payments:
- Make sure that you have signed a contract with Xsolla.
- In your UE4 project, uncheck the
Sandboxbox in Settings > Project Settings > Plugins > Xsolla Payments.
- Set the
falsein the request for the token.
Was this article helpful?
Rate this page
Don’t want to answer
Thank you for your feedback!
Found a typo or other text error? Select the text and press Ctrl+Enter.