Skip to content

Subscriptions ​

A subscription is a user's paid access to additional platform features.

Overview ​

The platform has one subscription with several plans; by default it is the "Plus subscription" with monthly and yearly plans. The subscription unlocks the features the administrator has marked as paid. A user picks a plan in the subscription modal and pays through the connected payment provider; the subscription renews automatically if the provider supports it.

The subscription is configured in the Admin Panel → Monetization group. User subscriptions with their payment history are listed in Admin Panel → Monetization → Subscriptions, and all payments with their statuses in Admin Panel → Monetization → Payments.

Subscription parameters are set in Admin Panel → Monetization → Subscription modal:

  • Slug: required; lowercase Latin letters, digits and hyphens; used in links to the subscription modal, plus by default
  • Name: required, up to 255 characters
  • Tagline and description: texts of the subscription modal
  • Badge text: a short subscription label up to 50 characters, for example Plus
  • Enable subscription feature checks: the main switch for paid features, see Features

Plans ​

Plans are created in Admin Panel → Monetization → Plans:

  • Name: required, up to 255 characters
  • Slug: required and unique
  • Period: month or year
  • Price: required
  • Currency: a three-letter code, RUB by default
  • Plan badge, description, note, original price, monthly equivalent: texts of the plan card
  • Order: the order of plans in the subscription modal
  • Active: an inactive plan cannot be purchased

A payment extends the subscription by the plan's period.

Features ​

Features are capabilities unlocked by the subscription. They are created in Admin Panel → Monetization → Features; a feature has a name, a unique code, a description, an icon or media file, an order, a highlight flag and a value for numeric parameters.

Access to a feature is determined as follows:

  • Subscription feature checks are off: all features are available to all users
  • The feature is active: available only to users with a current subscription
  • The feature is inactive or not created: available to all users

After the database is filled with seed data, the checks are on.

The platform checks features with these codes:

  • badge: the badge next to the name
  • fancy_nickname: changing the profile address
  • video_avatar: a video avatar
  • private_messages: sending private messages
  • reactions: the full set of reactions; without the feature, the first 10 active reactions are available
  • reaction_insights: the list of users who reacted
  • post_summaries: post summaries
  • chatgpt_comments: replies of the comment bot
  • ad_free: turning off advertising; works only when the checks are on and the feature is active
  • favorite_gifs: saving GIFs to favorites; the feature value is the maximum number of favorite GIFs, without a value the number is unlimited
  • comment_edit_minutes: the comment editing time in minutes taken from the feature value instead of the general one

Payment ​

The payment provider is connected in Admin Panel → Monetization → Provider:

  • YooKassa: Shop ID and secret key
  • T-Bank: Terminal Key and secret key

For YooKassa, the notification URL {APP_URL}/payments/yookassa/result is set in the provider's dashboard.

A subscription can be purchased only if the user has no current one. After payment, the subscription is activated. The user receives an email about a successful and about a canceled payment.

Renewal and cancellation ​

A subscription is renewed within an hour after its term ends.

A user cancels the subscription in Settings → Basic. A canceled subscription stops working immediately and is not renewed. If the user pays again before the paid period ends, the new period is added to the previous end date.

Released under the MIT License.