• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/paysystem/restservice.php
  • Класс: BitrixSalePaySystemRestService
  • Вызов: RestService::logAnalytics
static function logAnalytics($action, $handler, $personType, CRestServer $restServer) : bool
{
	$code = '';
	$type = '';
	if ($restServer->getAuthType() === BitrixRestOAuthAuth::AUTH_TYPE)
	{
		$app = BitrixRestAppTable::getByClientId($restServer->getClientId());
		if ($app['CODE'])
		{
			$code = $app['CODE'];
			$type = 'appCode';
		}
	}
	else
	{
		$code = $restServer->getPasswordId();
		$type = 'webHook';
	}

	if ($code !== '')
	{
		$tag = uniqid($code, true);
		AddEventToStatFile(
			'sale',
			$action,
			$tag,
			$code,
			$type
		);
		AddEventToStatFile(
			'sale',
			$action,
			$tag,
			$handler,
			'handler'
		);
		AddEventToStatFile(
			'sale',
			$action,
			$tag,
			$personType,
			'personType'
		);
	}

	return true;
}