Конвертирует данные, полученные из QR-кода, в массив данных для запроса к API.

@param string $qrCodeString Данные QR-кода

@return array Массив данных для запроса к API
11279
public static function fromQRCode($qrCodeString)
    {
        $paramsMap = [
            't'  => 'date',
            's'  => 'sum',
            'fn' => 'fiscalNumber',
            'i'  => 'fiscalDocument',
            'fp' => 'fiscalSign',
            'n'  => 'operation',
        ];

        $normalizedParams = array_fill_keys(array_values($paramsMap), null);

        parse_str($qrCodeString, $qrCodeParams);

        foreach ($paramsMap as $qrField => $normalizedField) {
            if (array_key_exists($qrField, $qrCodeParams)) {
                $normalizedParams[$normalizedField] = $qrCodeParams[$qrField];
            }
        }

        $normalizedParams['sum'] = self::rub2Kopeck($normalizedParams['sum']);

        return $normalizedParams;
    }
1155959
public function query_to_array($qs)
	{
		$query = explode('&', $qs);
		$data = array();

		foreach ($query as $q)
		{
			$q = explode('=', $q);

			if (isset($data[$q[0]]) && is_array($data[$q[0]]))
			{
				$data[$q[0]][] = urldecode($q[1]);
			}
			else if (isset($data[$q[0]]) && !is_array($data[$q[0]]))
			{
				$data[$q[0]] = array($data[$q[0]]);
				$data[$q[0]][] = urldecode($q[1]);
			}
			else
			{
				$data[urldecode($q[0])] = urldecode($q[1]);
			}
		}
		return $data;
	}
1287377
public function getQrImage(bool $setPngHeader = false): QrCode
    {
        if (!class_exists("Endroid\QrCode\QrCode")) {
            throw new QrPaymentException("Error: library endroid/qr-code is not loaded.", QrPaymentException::ERR_MISSING_LIBRARY);
        }

        if ($setPngHeader) {
            header("Content-type: image/png");
        }

        return new QrCode($this->getQrString());
    }
904723
public function DKIM_QP($txt)
    {
        $line = '';
        $len = strlen($txt);
        for ($i = 0; $i < $len; ++$i) {
            $ord = ord($txt[$i]);
            if (((0x21 <= $ord) and ($ord <= 0x3A)) or $ord == 0x3C or ((0x3E <= $ord) and ($ord <= 0x7E))) {
                $line .= $txt[$i];
            } else {
                $line .= '=' . sprintf('%02X', $ord);
            }
        }

        return $line;
    }
769243
public function detranslify($inString)
    {
        $dirtyResult = str_replace(self::$_EN_ALPHABET, self::$_RU_ALPHABET, $inString);
        return preg_replace(self::$_CORRECTION_PATTERN, self::$_CORRECTION_REPLACEMENT, $dirtyResult);
    }
361624
public function getQrString(): string
    {
        $this->checkProperties();

        $qr = "SPD*1.0*";
        $qr .= sprintf("ACC:%s*", $this->getIBAN());
        $qr .= sprintf("AM:%.2f*", $this->amount);
        $qr .= sprintf("CC:%s*", strtoupper($this->currency));

        if ($this->repeat) {
            $qr .= sprintf("X-PER:%d*", $this->repeat);
        }
        if ($this->comment) {
            $qr .= sprintf("MSG:%.60s*", $this->comment);
        }
        if ($this->internalId) {
            $qr .= sprintf("X-ID:%s*", $this->internalId);
        }
        if ($this->variableSymbol) {
            $qr .= sprintf("X-VS:%d*", $this->variableSymbol);
        }
        if ($this->specificSymbol) {
            $qr .= sprintf("X-SS:%d*", $this->specificSymbol);
        }
        if ($this->constantSymbol) {
            $qr .= sprintf("X-KS:%d*", $this->constantSymbol);
        }
        if (($dueDate = $this->getDueDate())) {
            $qr .= sprintf("DT:%s*", $dueDate->format('Ymd'));
        }

        return substr($qr, 0, -1);
    }
608083
public function initDataInterface(string $data):QRDataInterface{

		foreach(['Number', 'AlphaNum', 'Kanji', 'Byte'] as $mode){
			$dataInterface = __NAMESPACE__.'\\Data\\'.$mode;

			if(\call_user_func_array([$this, 'is'.$mode], [$data]) && \class_exists($dataInterface)){
				return new $dataInterface($this->options, $data);
			}

		}

		throw new QRCodeDataException('invalid data type'); // @codeCoverageIgnore
	}
1028256
def qrcode(self, data, **kwargs):
        
        barcode.validate_qrcode_args(**kwargs)
        return self._qrcode_impl(data, **kwargs)
615085
public function getQrc($keystandard, $keystr, $extinfo = null, $qrcode_size = 64)
    {
        $data = ['keystandard' => $keystandard, 'keystr' => $keystr, 'qrcode_size' => $qrcode_size];
        is_null($extinfo) || $data['extinfo'] = $extinfo;
        $url = "https://api.weixin.qq.com/scan/product/getqrcode?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, $data);
    }
984230
public static function rqlDecode($rqlQueryString)
    {
        $rqlQueryString = RqlParser::encodedStrQuery($rqlQueryString);
        $rqlQueryString = RqlParser::prepareStringRql($rqlQueryString);
        $parser = new self();
        $result = $parser->decode($rqlQueryString);
        unset($parser);

        return $result;
    }
65018
public function createQrCode(array $data)
    {
        $result = $this->httpRaw(self::WECHAT_QR_CODE_CREATE_PREFIX, $data, [
            'access_token' => $this->getAccessToken()
        ]);
        return !array_key_exists('errcode', $result) ? $result : false;
    }
945320
public function GenerateQrCode(int $acls = GnMashupLoginAcl::None)
    {
        $qrCode = parent::GenerateQrCodeInternal(GnSettings::GPSNOSE_COMMUNITY, TRUE, TRUE, $acls);

        return $qrCode;
    }
217443
protected function getResponseTransfer(array $decryptedArray): ComputopApiCrifResponseTransfer
    {
        $computopResponseTransfer = new ComputopApiCrifResponseTransfer();
        $computopResponseTransfer->fromArray($decryptedArray, true);
        $computopResponseTransfer->setHeader(
            $this->computopApiService->extractResponseHeader($decryptedArray, $this->config->getAuthorizeMethodName())
        );

        return $computopResponseTransfer;
    }
473916
public static function checkQRCodePayResult($qrCode)
    {
        if ($qrCode instanceof QRCode) {
            $qrID = $qrCode->getId();
        } else {
            $qrID = $qrCode;
        }
        $json = static::setRequest('get', static::GET_TRADES_ENDPOINT, [
            'qr_id' => $qrID,
            'status' => 'TRADE_RECEIVED',
        ])['response'];

        return $json['total_results'] > 0;
    }
60298
public function getSendNsca(string $connectionString, int $encryptionCipher = null, string $encryptionPassword = null): SendNsca {
        $password = $encryptionPassword ?? '';
        $cipher = $encryptionCipher ?? Ciphers::ENCRYPT_NONE;
        $key = md5($connectionString . ':' . $cipher . ':' . $password);
        if (false === isset(static::$instances[$key])) {
            static::$instances[$key] = new SendNsca($connectionString, $this->getEncryptor($cipher, $password));
        }
        return static::$instances[$key];
    }
1371793
public static function ordStr($string)
    {
        $codes = array();

        $encoding = mb_detect_encoding($string);
        $size = mb_strlen($string, $encoding);

        for ($i = 0; $i < $size; $i++) {
            $char = mb_substr($string, $i, 1, $encoding);
            $codes[] = static::ord($char);
        }

        return $codes;
    }
1179704
public function deviceGetQrcode(array $data)
    {
        return $this->auth(function () use ($data) {
            return $this->http([
                'url' => $this->baseUrl . 'device/getqrcode?access_token=' . $this->accessToken,
                'method' => 'get',
                'dataType' => 'json',
                'data' => $data,
            ]);
        });
    }