• Модуль: salescenter
  • Путь к файлу: ~/bitrix/modules/salescenter/lib/controller/payment.php
  • Класс: BitrixSalesCenterControllerPayment
  • Вызов: Payment::getPublicUrlAction
public function getPublicUrlAction(SalePayment $payment, array $options = [])
{
	if (LandingManager::getInstance()->isOrderPublicUrlAvailable())
	{
		$urlInfo = LandingManager::getInstance()->getUrlInfoByOrder(
			$payment->getOrder(),
			['paymentId' => $payment->getId()]
		);

		if (is_array($urlInfo) === false)
		{
			$this->addError(new Error('Error retrieving url info'));
			return false;
		}
	}
	else
	{
		$this->addError(new Error('Public url is not available'));
		return false;
	}

	return [
		'payment' => [
			'url' => $urlInfo['url'],
			'shortUrl' => $urlInfo['shortUrl'],
			'qr' => base64_encode(
				(new SalePaySystemBarcodeGenerator($options['qr'] ?? null))
					->generate($urlInfo['shortUrl'])
			),
		]
	];
}