FAPI.UI.invokeUIMethod("showPaymentSubscription")

Shows a dialog for purchasing a subscription to periodic game bonuses or service. For a purchase to be successful game’s callback service must process and verify our callback request.

If user has successfully purchased a subscription, he will be charged for a selected amount of OKs each subscription period. Period and subscription cost can be configured for every subscription.

To show a subscription window you need to pass two parameters:

NameRequiredTypeDescription
productIdYesStringSubscription id
priceYesIntegerSubscription cost. Selected amount of OKs will be charged from user every subscription period
/*
* showPaymentSubscription() example
* Attention! Game's callback service must verify subscription for it to be proceed correctly
*/
function showPaymentSubscription() {
    FAPI.invokeUIMethod("showPaymentSubscription", "productId", 10);
}

To enable in-game subscription for your application you need to register it in OK.ru first.

To add a subscription please write an e-mail to api-support@ok.ru with following data:

ParameterDescriptionUnit
Trial period durationDuration of a trial period. On trial period subscription is free for userDays, hours, minutes
Period durationSubscription period. Every set amount of time user is charged for selected amount of OKsDays, hours, minutes
PriceSingle period price.OKs
Subscription iconSubscription image URL. Image’s size must be 256x256 
product idString identifier of a subscription 
NameSubscription name. Must have a size of 1 to 3 words. 
DescriptionShort subscription description. It must describe what user is purchasing with corresponding subscription