diff --git a/pay/order/pay.go b/pay/order/pay.go index 06319dc72..1abd62876 100644 --- a/pay/order/pay.go +++ b/pay/order/pay.go @@ -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 != "" { // 如果有传入交易结束时间