Smarty

  1. Home
  2. Docs
  3. Smarty
  4. Integration with the billing system
  5. Description of the built-in billing

Description of the built-in billing

Built-in billing in Smarty performs basic charging and accounting operations, and also determines the availability of certain services and content for the subscriber.

For your service, you can use built-in billing if its functionality is sufficient for you, or integrate an external billing system through an API for more flexible scenarios.

Basic mode of operation of the built-in billing

In the basic mode of operation, the main concept is a tariff package that determines the list of content available for viewing.

The tariff package is a group of streaming services and content, such as TV channels, interactive features, movies, etc.

The set of connected tariff packages for the subscriber and account determines the set of content available for viewing from streaming services, while they may intersect in different tariff packages.

The tariff package may be empty, but have certain options and permits, in which case the tariff package is considered a tariff option.

The validity period of the tariff package for the subscriber is determined by the date of activation and deactivation of the account. In this billing mode, only the monthly tariff period is supported.

Rate period for the account

In the basic billing mode, an activation date and deactivation date can be set for each account. When the activation date comes, the account is automatically activated and can be logged into the system and access browsing. When the deactivation date comes, the account is deactivated.

A service team must be set up to perform these operations check_accounts crontab.

The period can be set and extended manually by Billing APIor automatically with a free initial promotional period.

A special account field is used to enable automatic period extension Activation after the first entry, which is preset for the new account and determines the first free period. If this field is set, then after the first authorization of such an account, it is immediately activated, and the activation date (current date) and the deactivation date (activation date + number of trial access days) are set.

At the time of the date of deactivation, if the subscriber’s account has the necessary amount of funds to pay for all connected tariff packages and options for the next month, then these funds are written off and the account remains activated. An extension date equal to the current date is set (necessary to calculate the next write-off). After the next period (calendar month), the extension is repeated.

If the funds are insufficient, the account is deactivated. At the time of debiting funds, a transaction with a negative transaction amount is created.

Crediting funds to the subscriber’s account is possible through manual creation of a transaction in a billing, through the Billing API or as a result of payment by the subscriber through a payment gateway. After confirmation of the transaction, if the subscriber’s account is inactive, then there is an attempt to write off funds and renew the account, and if it is active, then the funds are credited to the subscriber’s virtual account in Smarty. At the time of payment, a transaction is created with a positive transaction amount.

If no activation date, deactivation date, or renewal date is set, the automatic built-in billing for the account is considered disabled. Such an account can be permanently activated, or managed by an external billing system without using built-in billing.

Subscription regime

This mode provides more flexibility through the use of dynamic subscriptions to tariff packages, which allows you to determine the dynamic period of access to view content.

Subscription is an additional entity that determines the connected tariff package, the start and end date of the subscription. Subscription can override the basic cost of the tariff package, which allows you to introduce features such as promo codes, “content locks”, discounts on long-term payment and other marketing opportunities.

Detailed subscription regime described here.

Important features of tariff packages

Multiabonement

Multi-abonement is the ability to use a single account on multiple devices. Smarty allows you to flexibly configure the multi-subscription capabilities for different types of devices – basic (for example, Multicast devices) and additional (for example, OTT devices). The type of device (basic or additional) you can set arbitrarily in the device settings in the Smarty control panel (section "General settings").

Multi-subscription restrictions are configured in the parameters of the tariff package. If the subscriber/account has several tariff packets connected, the corresponding restriction is defined as the maximum value of all connected packets.

The option “Maximum number of basic devices” – this restriction applies to the maximum number of basic devices associated with the account that have an authorization session in Smarty (not necessarily online). To request authorization from the base device over the limit, the server will return the authorization ban (code 5 per request) Loginsee documentation TV-Middleware API).

The option “Maximum number of simultaneous sessions of additional devices” – this restriction works on the principle of “carousel” and acts on the number of simultaneous online sessions of the account from additional devices. Authorization from an additional device over the limit is allowed, however, in this case, the oldest session of the account will be deauthorized.

In addition, it is possible to enable verification of IP addresses from which simultaneously used additional devices are authorized. If verification is enabled, when you authorize a new additional device from a different IP address, all devices from the previous IP address will be deauthorized.

Basic and additional tariff packages

The option “Basic tariff sign” in the tariff settings means that the tariff belongs to the base tariff and its weight among them. For example, several basic rates can be created, with the tariff with the highest priority set to subscribers by default.

The subscriber can choose only one of the basic rates during registration and in the personal account.

A tariff that is not basic is considered additional. Additional tariffs can be connected only in addition to one of the basic ones, and cannot be connected separately from it.

Availability of the tariff package for inactive accounts

The special option of the tariff package “Available for inactive accounts” allows you to create tariff packages with a set of free services available to subscribers who were disabled due to non-payment or for another reason.

Thus, you can create a set of TV channels or additional services that will be available to inactive subscribers, for example, a free package of TV channels.

For accounts whose subscribers have connected tariff packages with this option, authorization in the system is allowed even when inactive, but they are given a limited set of content.