<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          wxpayGo 的微信支付商戶平臺 SDK

          聯(lián)合創(chuàng)作 · 2023-09-24 15:16

          wxpay 是一個使用Go語言編寫的微信支付商戶平臺SDK。

          舉個栗子

          以查詢企業(yè)付款A(yù)PI為栗:

          package main
          
          import (
              "log"
          
              "github.com/go-with/wxpay"
          )
          
          const (
              appId  = "" // 微信公眾平臺應(yīng)用ID
              mchId  = "" // 微信支付商戶平臺商戶號
              apiKey = "" // 微信支付商戶平臺API密鑰
          
              // 微信支付商戶平臺證書路徑
              certFile   = "cert/apiclient_cert.pem"
              keyFile    = "cert/apiclient_key.pem"
              rootcaFile = "cert/rootca.pem"
          )
          
          func main() {
              c := wxpay.NewClient(appId, mchId, apiKey)
          
              // 附著商戶證書
              err := c.WithCert(certFile, keyFile, rootcaFile)
              if err != nil {
                  log.Fatal(err)
              }
          
              params := make(wxpay.Params)
              // 查詢企業(yè)付款接口請求參數(shù)
              params.SetString("appid", c.AppId)
              params.SetString("mch_id", c.MchId)
              params.SetString("nonce_str", "5K8264ILTKCH16CQ2502SI8ZNMTM67VS")  // 隨機字符串
              params.SetString("partner_trade_no", "10000098201411111234567890") // 商戶訂單號
              params.SetString("sign", c.Sign(params))                           // 簽名
          
              // 查詢企業(yè)付款接口請求URL
              url := "https://api.mch.weixin.qq.com/mmpaymkttransfers/gettransferinfo"
          
              // 發(fā)送查詢企業(yè)付款請求
              ret, err := c.Post(url, params, true)
              if err != nil {
                  log.Fatal(err)
              }
          
              log.Print(ret)
          }
          瀏覽 26
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  婷婷激情网站 | 护士AV无码A片在线观看 | 日韩日逼视频 | 一区二区三区免费观看 | 午夜精品男人的天堂 |