• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/cashbox/rest/handlerservice.php
  • Класс: BitrixSaleCashboxRestHandlerService
  • Вызов: HandlerService::checkParamsBeforeUpdateHandler
static function checkParamsBeforeUpdateHandler($params)
{
	if (empty($params['ID']))
	{
		throw new RestException('Parameter ID is not defined', self::ERROR_CHECK_FAILURE);
	}

	$handler = CashboxRestHandlerTable::getList([
		'filter' => [
			'ID' => $params['ID']
		]
	])->fetch();
	if (!$handler)
	{
		throw new RestException('Handler not found', self::ERROR_HANDLER_NOT_FOUND);
	}

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

	if (empty($params['FIELDS']) || !is_array($params['FIELDS']))
	{
		throw new RestException('Parameter FIELDS is not defined', self::ERROR_CHECK_FAILURE);
	}

	if (isset($params['FIELDS']['SETTINGS']))
	{
		self::checkHandlerSettingsBeforeUpdate($params['FIELDS']['SETTINGS']);
	}
}