Working with payments in RuStore
You can monetize your app through purchases in RuStore. Here are four ways to do it:
- Sell a paid app on the storefront. Create a paid app, upload it to the RuStore storefront, and receive payouts for downloads.
- Add consumable products. These are purchases that can be bought more than once and used in the app. For example, health boosts, hints, crystals, or coins in games.
- Add non-consumable products. Unlike consumables, these can be purchased only once and cannot be “spent” in the app or game. By purchasing such products, the user becomes their owner (e.g., ad removal, a hidden level, or a premium item in a game).
All types of paid products are added through the RuStore Console.
Getting started
To start accepting payments, submit a monetization request according to your business registration form:
- Legal entities and individual entrepreneurs registered in Russia.
- Foreign companies not registered in Russia.
- Individuals with self-employed status.
Payment acceptance requirements
- Your app is uploaded to the RuStore Console.
- Your app has passed moderation (publishing the app is not required).
The keystore
signature must match the signature used for the app published in the RuStore Console. Make sure the buildType
you use (e.g., debug
) is signed with the same key as the app published in the Console (e.g., release
).
- The user and the app must not be blocked in RuStore.
Creating paid apps or products
Add a paid app to the storefront in the RuStore Console if you choose this monetization route.
If you want to monetize your app with in-app paid products, create products (to be used inside your app) in the RuStore Console.
See How to create a paid product. See How to create a subscription.
SDK setup
Integrate the Pay SDK into your app so users can purchase products.
How payments work
With the SDK you can:
- Fetch information about products created in the RuStore Console.
- Configure interaction with banking apps to redirect a user directly to the payment screen and back to your app
- Initialize payments so users can purchase the products you added in your app.
- Control consumption/confirmation of products to ensure they are granted to users without errors.
Learn more in Payment SDK setup.
Purchase status model
One-stage payment status model.
Two-stage payment status model.
Subscription purchase status model.
Handling unfinished payments
Only purchases started with the two-step payment flow (i.e., with an authorization hold) require confirmation. After a successful hold, such purchases will have the PurchaseStatus.PAID
status.
To capture funds from the buyer’s card, purchase confirmation is required. Use the confirmTwoStepPurchase
method for this.
If, after a successful hold, you cannot deliver the item to the user, cancel the purchase using the cancelTwoStepPurchase
method.
If the purchase is canceled, the funds are immediately refunded to the user in full.
Accepting payments in other stores
Users can pay in your app even if RuStore is not installed on their devices.
Benefits
You can increase revenue and attract a loyal audience, because now:
- users can pay even if they haven’t installed RuStore yet;
- you can continue accepting payments while publishing your app on different platforms.
Purchases without authorization
- Paying without RuStore is available starting from Pay SDK 9.0.1.
- Payment occurs without VK ID authorization and without a mandatory email. The user can optionally specify an email to receive a receipt.
- Payment methods are not saved between purchases. Available methods: new card, FPS (SBP), and SberPay.
- You can request the purchase list (
getPurchases
) without authorization. The response will include payments made on the current device using Pay SDK version 9.0.1. Keep this in mind when migrating from the BillingClient SDK. - During payment you can pass an internal user ID or email to simplify refunds. Such a payment can be easily found in the RuStore Console by the provided identifier.
- A user not authorized in RuStore is automatically routed to the outside-RuStore payment scenario.
If you cannot or do not want to store the purchase history on your server, we recommend disallowing purchases for non-authorized users. To do this:
- Call
isRuStoreInstalled
to check whether RuStore is installed. - If RuStore is not installed, redirect the user to the RuStore installation page or show an error message in the UI.
- If RuStore is installed, check the user’s authorization status in RuStore (e.g., via
getUserAuthorizationStatus
). - If the user is not authorized, redirect them to the authorization page.
- If RuStore is installed and the user is authorized, continue with the payment process.
- Kotlin
- Java
public fun isRuStoreInstalled(context: Context): Boolean
RuStoreUtils.INSTANCE.isRuStoreInstalled(context);
Purchases with authorization
- VK ID authorization is required when paying for a subscription. If desired, the buyer can also authorize when paying for in-app products.
Before using the SDK
We recommend the following before switching to the current version of the Payment SDK:
-
Set up analytics
If you publish your app on different platforms and want to separate payment flows by the app’s install source, create different build variants using build flavors. This allows you to collect analytics by distribution channel.
Receiving notifications on your server
To receive real-time payment updates, configure server notifications. This simplifies your workflow: you won’t need to poll for payment status — RuStore will send notifications whenever the payment status changes.
Connecting the API
Using the API makes your app more secure. It won’t be possible to hack it to get products and subscriptions for free.
To work with the RuStore API, complete authorization and obtain a JWE token.
Use the API methods for:
Server-side purchase validation
If you need to validate a successful purchase on the RuStore server, you can use the invoiceId
from the ProductPurchaseResult
model returned after a successful product purchase.
val params = ProductPurchaseParams(ProductId("productId"))
RuStorePayClient.instance.getPurchaseInteractor()
.purchase(params = params, preferredPurchaseType = PreferredPurchaseType.TWO_STEP)
.addOnSuccessListener { result ->
val invoceId = result.invoceId.value
yourApi.validate(invoceId)
}
You can also get invoiceId
from the Purchase
model. Retrieve the Purchase
model using getPurchases()
or getPurchase
.
Testing payments
Verify your SDK and API integration using test payments.
You can incentivize payments and increase revenue using coupons. Issue coupons in the RuStore Console, share them with your audience, and attract new paying users.
Managing payments
Once you have your first payments, you can manage them in the RuStore Console.