HOME.en.md


RU EN
🏠 Home ❮ Back

Unity plugin RuStore for payment processing

The RuStorepayClient plugin helps integrate a payment mechanism into your project. Unity 6000+ versions are supported.

Installing the plugin in your project

  • Download the files ru.rustore.core-x.y.z.tgz and ru.rustore.pay-x.y.z.tgz from the official repository on GitFlic.
  • Import the downloaded packages into the project via Package Manager (Window → Package Manager → + → Add package from tarball…).
  • Update project dependencies using External Dependency Manager (Assets → External Dependency Manager → Android Resolver → Force Resolve).

Installing External Dependency Manager

External Dependency Manager for Android is included in the RuStoreCore package. To install it, follow these steps.

Open RuStoreCore in the Package Manager window (Window → Package Manager → Packages RuStore → RuStoreCore). Go to the Samples tab. Import the External Dependency Manager sample.

Project Configuration

Open 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.

Open External Dependency Manager settings: Assets → External Dependency Manager → Android Resolver → Settings, enable the following settings.

  • Use Jetifier.
  • Patch mainTemplate.gradle.
  • Patch gradleTemplate.properties.

Deep Link Handling

Deep links in the RuStore Payment SDK are necessary for correct operation with third-party payment applications. They help users make purchases faster in a third-party app and return to your app.

To configure deep links in your app, follow three main steps:

1. In Unity, open the menu: Window → RuStoreSDK → Settings → PayClient

2. Fill in the fields:

  • consoleApplicationId — application ID in the RuStore console.
  • deeplinkScheme — deep link scheme (used in intent-filter and in the SDK).

Choose which Activity to launch after deep link processing:

  • Activity → com.unity3d.player.UnityPlayerActivity.
  • GameActivity → com.unity3d.player.UnityPlayerGameActivity.
  • CustomMainActivity → your Activity (field customMainActivityClass).

3. Patch and verify the manifest:

  • Patch Manifest — automatically apply the necessary changes.
  • Verify Manifest — check that AndroidManifest.xml is correct.

Changes in AndroidManifest.xml

The automatic manifest patch will make the following changes to AndroidManifest.xml: 1. Creates a deeplink activity ru.rustore.unitysdk.RuStoreDeeplinkActivityDefault with theme Theme.NoDisplay. 2. Creates an intent-filter tag inside the deeplink activity specifying a link to your Deeplink Scheme. 3. Creates meta-data tags inside <application> specifying a link to your Deeplink Scheme and SDK initialization. 4. Creates a pay activity ru.rustore.sdk.pay.internal.presentation.ui.PayActivity.

<?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" />

        <!-- 4. Pay Activity -->
        <activity android:name="ru.rustore.sdk.pay.internal.presentation.ui.PayActivity"
                  android:exported="false"
                  android:launchMode="singleTask"
                  tools:replace="android:launchMode" />
    </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 document MIT-LICENSE.