- Модуль: sale
- Путь к файлу: ~/bitrix/modules/sale/lib/cashbox/cashboxatolfarm.php
- Класс: BitrixSaleCashboxCashboxAtolFarm
- Вызов: CashboxAtolFarm::getCallbackUrl
protected function getCallbackUrl()
{
$context = MainApplication::getInstance()->getContext();
$scheme = $context->getRequest()->isHttps() ? 'https' : 'http';
$server = $context->getServer();
$domain = $server->getServerName();
if (preg_match('/^(?.+):(?d+)$/', $domain, $matches))
{
$domain = $matches['domain'];
$port = $matches['port'];
}
else
{
$port = $server->getServerPort();
}
$port = in_array($port, array(80, 443)) ? '' : ':'.$port;
return sprintf('%s://%s%s/bitrix/tools/sale_farm_check_print.php', $scheme, $domain, $port);
}