<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                ##### 安裝 `https://github.com/piggly-dev/php-pix` #### 操作類 `<?php namespace app\common\library; use Piggly\Pix\Exceptions\QRCodeNotSupported; use Piggly\Pix\Parser; use Piggly\Pix\StaticPayload; use think\Exception; /** * Class PixPayCode * @package app\common\library */ class PixPayCode { /* * * $payload = (new \app\common\library\PixPayCode()) ->setAmount($amount) //->setTid($tid) //->setDescription($description) //->setPixKey($keyValue) //->setMerchantName($merchantName) //->setMerchantCity($merchantCity) ->getPixQrCodeValue(); */ /** * @var string */ private $pixKey='c51bf4e8-16bc-4e-9016-abeb0fc48d91'; /** * @var string */ private $description; /** * @var string */ private $merchantName='ZH - ELRONICOS LA'; /** * @var string */ private $merchantCity='?o ulo'; /** * @var string */ private $txid; /** * @var */ private $amount; /** * @var StaticPayload */ private $payload; /** * PixPayCode constructor. */ public function __construct() { $this->payload = new StaticPayload(); $this->txid = Parser::getRandom(); $this->description = ''; } /** * @param string $pixKey * @return $this */ public function setPixKey(string $pixKey) { $this->pixKey = $pixKey; return $this; } /** * @param float $amount * @return $this */ public function setAmount(float $amount) { $this->amount = (string)number_format($amount, 2, '.', ''); return $this; } /** * @param string $description * @return $this */ public function setDescription(string $description) { $this->description = $description; return $this; } /** * @param string $merchantName * @return $this */ public function setMerchantName(string $merchantName) { $this->merchantName = $merchantName; return $this; } /** * @param string $merchantCity * @return $this */ public function setMerchantCity(string $merchantCity) { $this->merchantCity = $merchantCity; return $this; } /** * @param string $txid * @return $this */ public function setTid(string $txid) { $this->txid = $txid; return $this; } /** * @return array * @throws Exception */ public function getPixQrCodeValue() { $payload = $this->payload ->setAmount($this->amount) ->setTid($this->txid) ->setDescription($this->description) ->setPixKey(Parser::KEY_TYPE_RANDOM, $this->pixKey) ->setMerchantName($this->merchantName) ->setMerchantCity($this->merchantCity); try { return ['image' => $payload->getQRCode(), 'pix' => $payload->getPixCode()]; } catch (QRCodeNotSupported $e) { throw new Exception($e->getMessage()); } } } `
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看