HOME.en.md
RuStore Unity plugin for accepting payments
The RuStorepayClient plugin helps integrate the payment mechanism into your project. Unity versions 2022.3.37f1+ are supported (requires Gradle 7.3 or higher), Unity 6000+.
Connecting to the Project
Installing the Plugins
From a network location (recommended)
RuStore packages are published to an npm registry and can be added to the project through Package Manager without manually downloading archives.
- Open the settings: Edit → Project Settings → Package Manager.
- In the Scoped Registries section, click + and fill in the fields:
- Name —
RuStore Nexus. - URL —
https://nexus-external.vkteam.ru/repository/npm-unity-rustore-exposed/. - Scopes —
ru.rustore.
- Name —
- Open Window → Package Manager. The RuStore Nexus registry will appear in the list of sources.
- Select RuStore Nexus and install the
ru.rustore.paypackage by clicking Install. Theru.rustore.coredependency will be installed automatically.
From a local location
Installing via Package Manager
- Download the following packages from the releases page:
ru.rustore.core-version.tgz.ru.rustore.pay-version.tgz.
- Import the packages into the project via Package Manager (Window → Package Manager → + → Add package from tarball…).
*Installing via .unitypackage
- Download the
RuStoreUnityPaySDK-version.unitypackagefile from the releases page. - Import it into the project (Assets → Import Package → Custom Package…).
Cloning the Repository
To install from source code, follow the cloning instructions.
For each release artifact, checksum (.sha256) and digital signature (.sig) files are available and can be used to verify the artifact’s integrity and authenticity after downloading.
Tip
If you use macOS, change the archive utility settings. In Archive Utility, clear the Keep expanding if possible checkbox. Otherwise, the project archive may be downloaded incorrectly.
Project Setup
Configure the following settings for the SDK dependencies to work correctly.
- Open the project settings: Edit → Project Settings → Player → Android Settings.
- In the Publishing Settings section, enable the following settings.
- Custom Main Manifest.
- Custom Main Gradle Template.
- Custom Gradle Properties Template.
- In the Other Settings section, configure:
- package name.
- Minimum API Level = 24.
- Target API Level = 34.
Connecting Dependencies
After installation, update the project dependencies using External Dependency Manager (Assets → External Dependency Manager → Android Resolver → Force Resolve).
Open External Dependency Manager settings: Assets → External Dependency Manager → Android Resolver → Settings, and enable the following settings:
- Use Jetifier.
- Patch mainTemplate.gradle.
- Patch gradleTemplate.properties.
Deeplink handling
The deeplink in the RuStore payment SDK is required for proper operation with third-party payment apps. It helps users make purchases in third-party apps faster and return to your app.
To set up a deeplink in your app, follow three main steps:
1. In Unity, open the menu: Window → RuStoreSDK → Settings → PayClient
2. Fill in the fields:
- consoleApplicationId — the application ID in the RuStore console.
- deeplinkScheme — the deeplink scheme (used in the intent-filter and in the SDK).
Select which Activity to launch after processing the deeplink:
- Activity →
com.unity3d.player.UnityPlayerActivity. - GameActivity →
com.unity3d.player.UnityPlayerGameActivity. - CustomMainActivity → your Activity (the
customMainActivityClassfield).
3. Run the patch and verify the manifest:
- Patch Manifest — automatically applies the necessary changes.
- Verify Manifest — check that
AndroidManifest.xmlis correct.
Changes to AndroidManifest.xml
The automatic manifest patch will make the following changes to AndroidManifest.xml:
-
Create a deeplink activity
ru.rustore.unitysdk.RuStoreDeeplinkActivityDefaultwith the themeTheme.NoDisplay. -
Create an
intent-filtertag inside the deeplink activity with a link to yourDeeplink Scheme. -
Create
meta-datatags inside<application>with a link to yourDeeplink Schemeand SDK initialization.
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.unity3d.player"
xmlns:tools="http://schemas.android.com/tools">
<application>
<!-- Game Activity -->
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:theme="@style/UnityThemeSelector" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
<!-- 1. Deeplink Activity -->
<activity android:name="ru.rustore.unitysdk.RuStoreDeeplinkActivityDefault"
android:theme="@android:style/Theme.NoDisplay"
android:exported="true">
<!-- 2. Deeplink intent-filter -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="@string/rustore_PayClientSettings_deeplinkScheme" />
</intent-filter>
</activity>
<!-- 3. Initializing SDK and Deeplink Scheme -->
<meta-data android:name="console_app_id_value" android:value="@string/rustore_PayClientSettings_consoleApplicationId" />
<meta-data android:name="internal_config_key" android:value="@string/rustore_PayClientSettings_internalConfigKey" />
<meta-data android:name="sdk_pay_scheme_value" android:value="@string/rustore_PayClientSettings_deeplinkScheme" />
</application>
</manifest>
Working with the SDK
Start exploring the RuStore library documentation with the methods of the RuStorePayClient class. Or use the online guide.
Technical support
Additional help and instructions are available in the RuStore documentation and by email at support@rustore.ru.
Distribution terms
This software, including source code, binary libraries, and other files, is distributed under the MIT license. Licensing information is available in the MIT-LICENSE document.