<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 功能強大 支持多語言、二開方便! 廣告
                要實現原生掃碼支付功能,前提已經完成了[微信平臺支付配置](微信平臺支付配置.md) # 模式一開發實現流程 ## 第一步:獲取二維碼 獲取到的二維碼鏈接已自動進行轉換短鏈接操作,減小二維碼數據量,提升掃描速度和精確度。 獲取的方法如下: ~~~ $appid = '你的公眾號appid'; $product = [ 'product_id'=>'商戶定義的商品id 或者訂單號', 'body'=>'商品簡單描述', 'out_trade_no'=>'商戶系統內部訂單號,要求32個字符內、且在同一個商戶號下唯一', 'total_fee'=>'訂單總金額,單位為分' ]; $callback = '支付成功后的回調地址'; $type = 1; //模式一 $scan = D('Common/Payment')->scan_pay($appid, $product, $callback, $type); if ($scan['status'] == 0) { $this->error($scan['msg']); } $this->assign('qrcode', $scan['short_url']); ~~~ prodect數組是傳遞最基本的商品參數,同時也支持傳遞更多微信支付里的[統一下單](https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_1)接口里的參數 參數body請按照規范傳遞,具體請見[參數規則](https://pay.weixin.qq.com/wiki/doc/api/native.php?chapter=4_2) 其中回調地址的格式:應用名/model類名/方法名,如:weixin/Service/payok type的值是 1或者2,1表示模式一,2表示模式二,默認是2 ## 第二步:顯示二維碼 在前臺HTML里可以通過WeiPHP自帶的JS庫生成并顯示二維碼: ~~~ <script type="text/javascript" src="__STATIC__/qrcode/qrcode.js"></script> <script type="text/javascript" src="__STATIC__/qrcode/jquery.qrcode.js"></script> <div id="qrCode"></div> <script type="text/javascript"> var textLink = "{$qrcode}"; $('#qrCode').qrcode({width:150,height:150,text:textLink}); </script> ~~~ ## 第三步:異步接收支付結果 參考 [異步接收支付結果](異步接收支付結果.md) # 模式二開發實現流程 模式二的開發流程同模式一。 ## 第一步:獲取二維碼 同模式一,只需要把type參數修改為2,然后二維碼的地址修改為: 獲取的方法如下: ~~~ $appid = '你的公眾號appid'; $product = [ 'product_id'=>'商戶定義的商品id 或者訂單號', 'body'=>'商品簡單描述', 'out_trade_no'=>'商戶系統內部訂單號,要求32個字符內、且在同一個商戶號下唯一', 'total_fee'=>'訂單總金額,單位為分' ]; $callback = '支付成功后的回調地址'; $type = 2; //模式二 $scan = D('Common/Payment')->scan_pay($appid, $product, $callback, $type); if ($scan['status'] == 0) { $this->error($scan['msg']); } $this->assign('qrcode', $scan['code_url']); ~~~ ## 第二步:顯示二維碼 同模式一 ## 第三步:異步接收支付結果 參考 [異步接收支付結果](異步接收支付結果.md)
                  <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>

                              哎呀哎呀视频在线观看