• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/controller/action/paysystem/registeryookassawebhookaction.php
  • Класс: BitrixSaleControllerActionPaySystemRegisterYookassaWebhookAction
  • Вызов: RegisterYookassaWebhookAction::run
public function run()
{
	if (!MainLoader::includeModule('seo'))
	{
		$this->addError(new MainError('Module seo not installed'));
		return;
	}

	$authAdapter = SeoCheckoutService::getAuthAdapter(SeoCheckoutService::TYPE_YOOKASSA);
	$hasAuth = $authAdapter->hasAuth();
	if ($hasAuth)
	{
		MainConfigOption::set('sale', 'YANDEX_CHECKOUT_OAUTH', true);

		$oauthService = SeoCheckoutServicesFactory::createService($authAdapter->getType());
		$this->registerWebhooks($oauthService);
	}
	else
	{
		$this->addError(new MainError('Yokassa is not authorized'));
	}
}