<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>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                在前面的章節中我們已經完成了所有的工具類的編寫,今天我們來實現下單流程的代碼實現,首先因為前面我們進行了路由攔截器的開發 所以我們因為是在開發測試階段沒必要進行路由攔截 所以呢 就先放行,因為我們路由攔截器當中之前攔截的是/user/api/v1/*/**路徑 所以這次控制器我們就先去掉user ### 第一步:在前面的《訂單的增刪改查Dao層編寫》這一章節我們已經完成了訂單的增刪改查操作 屬于mapper層 ### 第二步:在剛開始的時候我們通過代碼生成工具也已經生成好了VideoOrder訂單類,但是我們有可能會對訂單進行擴展,所以在dto層我們創建一個視頻訂單的擴展類VideoOrderDto.java ### ![](https://img.kancloud.cn/3d/00/3d0035ceea8d1aaaeb5d1ce819d3251c_1844x1800.png) ### 第三步:因為在統一下單的時候需要拿到請求用戶的真實ip地址 所以我們還得要封裝一個獲取用戶真實IP地址的工具類 ### ![](https://img.kancloud.cn/af/af/afaf6b76780996b1e15e369d7186fbd3_3230x1858.png) ### 第四步:控制器的編寫 ### ![](https://img.kancloud.cn/20/af/20af724e5c13af074213195ca5ef35f3_3270x1760.png) ![](https://img.kancloud.cn/ff/cf/ffcfcb352c8daddd02ce7f80bfabe9d7_3270x1008.png) ### 第五步:service層編寫 ### ![](https://img.kancloud.cn/fd/5f/fd5f3d9b2847654773c2efb6f823f70b_2712x1336.png) ### ![](https://img.kancloud.cn/2f/99/2f99d3b353946c90aaa0c02e0381c702_3072x1860.png) ### ![](https://img.kancloud.cn/09/69/0969cf837e53843244cd84bbfbef3c33_1894x1782.png) ### ![](https://img.kancloud.cn/32/25/32250dab22eff4060895acd5d40d442a_2112x1946.png) ### 統一下單的時候用到的字段需要根據微信官網文檔提供的來設置 地址如下: https://pay.weixin.qq.com/wiki/doc/api/native.php?chapter=9_1 ### ![](https://img.kancloud.cn/2a/31/2a3178881dd5ac1382e693d8e9e22a7b_1469x979.png) ### 第六步:在第五步的時候我們截圖當中也提到了 需要配置微信支付的配置信息 ### ![](https://img.kancloud.cn/aa/16/aa16ba3971f844193205c781502396ab_2794x1758.png) ### 不要忘記在配置文件當中寫入商戶號ID以及支付key和對應的微信支付回調地址 ![](https://img.kancloud.cn/bf/98/bf98c12c990ce140a98454578fd004ad_2514x1828.png) ### 最后你會發現我們打印了sign簽名以及要發送給微信的xml 這個sign就是根據生成xml的這些參數根據一定的規則轉化而來 所以拿到了sign和xml之后我們就可以利用微信官方提供的工具進行校驗 看我們的sign簽名生成的是否正確 ### sign: 85118C91DFCB052FB02AC183BF3D57D2 <?xml version="1.0" encoding="UTF-8" standalone="no"?> <xml> <appid>wx5beac15ca207cdd40c</appid> <body>高級教程666</body> <mch_id>1503808832</mch_id> <nonce_str>b11446ae6fc14ddb89c9bc5fa291dc43</nonce_str> <notify_url>16web.tunnel.qydev.com/pub/api/v1/wechat/order/callback1</notify_url> <out_trade_no>2a273e4b9f8c453380a08c7930fc3b6b</out_trade_no> <sign>85118C91DFCB052FB02AC183BF3D57D2</sign> <spbill_create_ip>0:0:0:0:0:0:0:1</spbill_create_ip> <total_fee>500</total_fee> <trade_type>NATIVE</trade_type> </xml> 校驗工具地址https://pay.weixin.qq.com/wiki/doc/api/native.php?chapter=20_1 ### ![](https://img.kancloud.cn/f5/b8/f5b89ac0d825d1c8ebf00576ca63588c_1469x999.png) ### 只要校驗通過了之后那么微信支付也就完成了80%的功能了 ###
                  <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>

                              哎呀哎呀视频在线观看