• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/cashbox/cashboxpaysystem.php
  • Класс: BitrixSaleCashboxCashboxPaySystem
  • Вызов: CashboxPaySystem::printImmediately
public function printImmediately(Check $check): SaleResult
{
	$result = new SaleResult();

	$checkParamsResult = $this->checkParams($check);
	if (!$checkParamsResult->isSuccess())
	{
		$result->addErrors($checkParamsResult->getErrors());
		return $result;
	}

	if ($this->needPrintCheck($check))
	{
		$payment = CheckManager::getPaymentByCheck($check);
		if (!$payment)
		{
			$result->addError(
				new MainError(
					MainLocalizationLoc::getMessage('SALE_CASHBOX_PAYSYSTEM_PAYMENT_NOT_FOUND')
				)
			);
			return $result;
		}

		$url = $this->getPrintUrl();
		$fields = $this->buildCheckQuery($check);

		$sendResult = $this->send($url, $payment, $fields);
		if ($sendResult->isSuccess())
		{
			$processPrintResult = $this->processPrintResult($sendResult);
			if ($processPrintResult->isSuccess())
			{
				$result->setData($processPrintResult->getData());
			}
			else
			{
				$result->addErrors($processPrintResult->getErrors());
			}
		}
		else
		{
			$result->addErrors($sendResult->getErrors());
		}
	}

	return $result;
}