• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/internals/analytics/sender.php
  • Класс: BitrixSaleInternalsAnalyticsSender
  • Вызов: Sender::send
public function send(): bool
{
	if ($this->data)
	{
		$postData = $this->getCommonData();
		$postData['content'] = $this->data;
		$postData['bx_hash'] = self::signRequest($postData);
		$postData = MainWebJson::encode($postData);

		$httpClient = new MainWebHttpClient();
		$response = $httpClient->post(self::URL, $postData);
		if (!$response || $httpClient->getStatus() !== 200)
		{
			return false;
		}

		try
		{
			$response = MainWebJson::decode($response);
			if ($response['result'] !== 'ok')
			{
				return false;
			}
		}
		catch (MainArgumentException $ex)
		{
			return false;
		}
	}

	return true;
}