Set up Payments Android SDK
To integrate the Xsolla Payments SDK:
- Set up the Store module (optional).
- Set up Pay Station in your Publisher Account.
- Get a token.
- Install the library.
- Configure Return URL.
- Set up event processing and SDK methods.
After the integration is complete, test the payment process.
Set up Pay Station in Publisher Account
- 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.
- Open Pay Station settings.
- Specify Return URL and Redirect conditions in the Redirect policy block and click Save.
Get a token
You need to get a token to make the SDK work properly. An access token is a string that is used to initiate the payment process.
Install the library
The library is available in JCenter.
To install the library:
- Start Android Studio.
- Open build.gradle file of your application.
- Add the following line to the dependencies section, where <version_number> is the required version of the Payments Android SDK:
Configure Return URL
Add the following strings to the project's strings resources file to specify the Return URL configured in Publisher Account.
<string name="xsolla_payments_redirect_scheme">https</string> <string name="xsolla_payments_redirect_host">example.com</string> <string name="xsolla_payments_redirect_path_prefix">/payment</string>
There you should set the Return URL split into three parts. The example is for https://example.com/payment.
Test the payment process
After successful 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:
- Make sure that you have signed a contract with Xsolla.
- Set .isSandbox(false) while building a