• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/paysystem/restservice.php
  • Класс: BitrixSalePaySystemRestService
  • Вызов: RestService::checkParamsOnDeleteHandler
static function checkParamsOnDeleteHandler($params): void
{
	$dbRes = InternalsPaySystemRestHandlersTable::getList(array(
		'filter' => array(
			'ID' => $params['ID']
		)
	));
	$data = $dbRes->fetch();
	if (!$data)
	{
		throw new RestException('Handler not found', self::ERROR_HANDLER_NOT_FOUND);
	}

	if ($params['APP_ID'] && !empty($data['APP_ID']) && $data['APP_ID'] !== $params['APP_ID'])
	{
		throw new AccessException();
	}

	$dbRes = Manager::getList(array('filter' => array('ACTION_FILE' => $data['CODE'])));
	if ($dbRes->fetch())
	{
		throw new RestException('Pay system with handler '.ToUpper($data['CODE']).' exists!', self::ERROR_PAY_SYSTEM_DELETE);
	}
}