mirror of
https://github.com/silenceper/wechat.git
synced 2026-02-04 12:52:27 +08:00
修复不传sign_type导致request sign_type无默认值的bug (#480)
* 接入关闭订单 * test * 删除testing,过不了ci * 避免err覆盖 * 修复不传sign_type导致request sign_type无默认值的bug * 修复不传sign_type导致request sign_type无默认值的bug Co-authored-by: liujianwei <liujianwei@linghit.com>
This commit is contained in:
@@ -216,6 +216,11 @@ func (o *Order) PrePayOrder(p *Params) (payOrder PreOrder, err error) {
|
||||
p.NotifyURL = o.NotifyURL // 默认使用order.NotifyURL
|
||||
}
|
||||
|
||||
// 签名类型
|
||||
if p.SignType == "" {
|
||||
p.SignType = util.SignTypeMD5
|
||||
}
|
||||
|
||||
param := map[string]string{
|
||||
"appid": o.AppID,
|
||||
"body": p.Body,
|
||||
@@ -232,10 +237,6 @@ func (o *Order) PrePayOrder(p *Params) (payOrder PreOrder, err error) {
|
||||
"goods_tag": p.GoodsTag,
|
||||
"notify_url": p.NotifyURL,
|
||||
}
|
||||
// 签名类型
|
||||
if param["sign_type"] == "" {
|
||||
param["sign_type"] = util.SignTypeMD5
|
||||
}
|
||||
|
||||
if p.TimeExpire != "" {
|
||||
// 如果有传入交易结束时间
|
||||
|
||||
Reference in New Issue
Block a user