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

	$handlerData = self::getHandlerData($params['BX_REST_HANDLER']);
	if (!$handlerData)
	{
		throw new RestException('Handler not found', self::ERROR_HANDLER_NOT_FOUND);
	}

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

	$dbRes = InternalsPersonTypeTable::getList([
		'filter' => [
			'=ID' => $params['PERSON_TYPE_ID'],
			'=ENTITY_REGISTRY_TYPE' => $params['ENTITY_REGISTRY_TYPE'],
		]
	]);
	if (!$dbRes->fetch())
	{
		throw new RestException('Incorrect person type id!', self::ERROR_PERSON_TYPE_NOT_FOUND);
	}
}