1
0
mirror of https://github.com/silenceper/wechat.git synced 2026-02-09 23:22:27 +08:00

[feature] Format the code and improve Mini Program authorization to o… (#473)

* [feature] Format the code and improve Mini Program authorization to obtain openid(miniprogram/auth/auth.go Code2Session)

* [feature] CheckEncryptedData (https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/user-info/auth.checkEncryptedData.html)

* upgrade json error

* upgrade json error

Co-authored-by: houseme <houseme@outlook.com>
This commit is contained in:
houseme
2021-09-08 11:03:23 +08:00
committed by GitHub
parent 47adf42208
commit 96c1f98944
90 changed files with 787 additions and 760 deletions

View File

@@ -24,7 +24,7 @@ func NewTransfer(cfg *config.Config) *Transfer {
return &transfer
}
//Params 调用参数
// Params 调用参数
type Params struct {
DeviceInfo string
PartnerTradeNo string
@@ -34,10 +34,10 @@ type Params struct {
Amount int
Desc string
SpbillCreateIP string
RootCa string //ca证书
RootCa string // ca证书
}
//request 接口请求参数
// request 接口请求参数
type request struct {
AppID string `xml:"mch_appid"`
MchID string `xml:"mchid"`
@@ -53,7 +53,7 @@ type request struct {
SpbillCreateIP string `xml:"spbill_create_ip,omitempty"`
}
//Response 接口返回
// Response 接口返回
type Response struct {
ReturnCode string `xml:"return_code"`
ReturnMsg string `xml:"return_msg"`
@@ -69,7 +69,7 @@ type Response struct {
PaymentTime string `xml:"payment_time"`
}
//WalletTransfer 付款到零钱
// WalletTransfer 付款到零钱
func (transfer *Transfer) WalletTransfer(p *Params) (rsp Response, err error) {
nonceStr := util.RandomStr(32)
param := make(map[string]string)