Skip to content

Commit

Permalink
修复不传sign_type导致request sign_type无默认值的bug (#480)
Browse files Browse the repository at this point in the history
* 接入关闭订单

* test

* 删除testing,过不了ci

* 避免err覆盖

* 修复不传sign_type导致request sign_type无默认值的bug

* 修复不传sign_type导致request sign_type无默认值的bug

Co-authored-by: liujianwei <liujianwei@linghit.com>
  • Loading branch information
youkjw and liujianwei authored Sep 13, 2021
1 parent d776f5c commit 9294950
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pay/order/pay.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 != "" {
// 如果有传入交易结束时间
Expand Down

0 comments on commit 9294950

Please sign in to comment.