3namespace Bitrix\Rest\Infrastructure\Market;
5use Bitrix\Main\Application;
6use Bitrix\Main\Type\Date;
7use Bitrix\Rest\Marketplace\Client;
8use Bitrix\Rest\Marketplace\Url;
9use Bitrix\Rest\Service\RestOption;
10use Bitrix\Rest\Service\ServiceContainer;
14 private const BASE_CACHE_DIR =
'rest/market_subscription';
28 if (!Client::isSubscriptionAccess())
33 if (Application::getInstance()->getLicense()->getRegion() !==
'ru')
38 if ($this->marketOption->isNewPoliticsEnabled())
45 $this->marketOption->enableNewPolitics();
55 return Client::isSubscriptionAccess();
60 return Client::isSubscriptionAvailable();
65 return Client::isSubscriptionDemo();
70 return Client::isSubscriptionDemoAvailable();
75 return Client::getSubscriptionFinalDate();
81 isAvailable: $this->marketOption->isDiscountAvailable(),
82 percentage: $this->marketOption->getDiscountPercentage(),
83 termsUrl: $this->marketOption->getDiscountTermsUrl(),
89 $cache = Application::getInstance()->getCache();
94 'has_subscription_app_or_integration',
99 return $cache->getVars();
102 $hasSubscriptionIntegrations =
106 $cache->startDataCache();
107 $cache->endDataCache($hasSubscriptionIntegrations);
109 return $hasSubscriptionIntegrations;
119 return $this->marketOption->getSavedTransitionPeriodEndDate();
130 return $this->marketOption->isTransitionPeriodEnabled();
getTransitionPeriodEndDate()
isTransitionPeriodEnabled()
__construct(private readonly MarketOption $marketOption)
isPaidAppsOrIntegrationsInstalled()
isRequiredSubscriptionModelStarted()
static getSubscriptionBuyUrl()