Skip to content

Commit

Permalink
fix wxpay bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mailbaoer committed Jun 6, 2018
1 parent 00b75de commit fcf1f6d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pay/pay.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ type (

// Ret 返回的基本内容
Ret struct {
Timestamp string `json:"timestamp,omitempty"` // 时间戳
NonceStr string `json:"noncestr,omitempty"` // 随机字符串
Timestamp string `json:"timeStamp,omitempty"` // 时间戳
NonceStr string `json:"nonceStr,omitempty"` // 随机字符串
}

// AppPayRet 下单返回内容
Expand All @@ -38,7 +38,7 @@ type (
// WaxPayRet 微信小程序下单返回内容
WaxPayRet struct {
Ret

AppID string `json:"appid,omitempty"` // 应用ID
Package string `json:"package,omitempty"` // 扩展字段 统一下单接口返回的 prepay_id 参数值,提交格式如:prepay_id=*
SignType string `json:"signType,omitempty"` // 签名算法,暂支持 MD5
PaySign string `json:"paySign,omitempty"` // 签名
Expand Down Expand Up @@ -151,6 +151,7 @@ func (m *WePay) WaxPay(totalFee int, openID string) (results *WaxPayRet, outTrad
Timestamp: fmt.Sprintf("%d", time.Now().Unix()),
NonceStr: unifiedOrderResp.NonceStr,
},
AppID: m.AppID,
Package: "prepay_id=" + unifiedOrderResp.PrepayID,
SignType: "MD5",
}
Expand Down

0 comments on commit fcf1f6d

Please sign in to comment.