• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/ui/barcode/payment.php
  • Класс: Bitrix\Crm\UI\Barcode\Payment
  • Вызов: Payment::init
private function init(): Result
{
	if ($this->initResult)
	{
		return $this->initResult;
	}

	$this->initResult = $this->initDataGenerator();
	if (!$this->initResult->isSuccess())
	{
		return $this->initResult;
	}

	if (!static::isBarcodeApiAvailable())
	{
		return $this->initResult->addError(
			new Error('UI Barcode API is not available', static::ERROR_CODE_API_NOT_AVAILABLE)
		);
	}

	$this->barcode = new Barcode();
	$this->barcode->type(BarcodeDictionary::TYPE_QR);
	$this->barcode->format(BarcodeDictionary::FORMAT_PNG);

	return $this->initResult;
}