• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/update/checkoutwebhookregistrationagent.php
  • Класс: BitrixSaleUpdateCheckoutWebhookRegistrationAgent
  • Вызов: CheckoutWebhookRegistrationAgent::registerWebhook
static function registerWebhook(string $type): void
{
	$authAdapter = SeoCheckoutService::getAuthAdapter($type);
	$oauthService = SeoCheckoutServicesFactory::createService($authAdapter->getType());

	$registerPaymentSucceededResult = $oauthService->registerPaymentSucceededWebhook();
	$registerPaymentCanceledWebhookResult = $oauthService->registerPaymentCanceledWebhook();
	if ($registerPaymentSucceededResult->isSuccess() && $registerPaymentCanceledWebhookResult->isSuccess())
	{
		MainConfigOption::set('sale', 'YANDEX_CHECKOUT_OAUTH_WEBHOOK_REGISTER', true);
	}
}