From 0762d6c249d31ab9c72ab535c5401391bb7e06ab Mon Sep 17 00:00:00 2001 From: Mongo Date: Tue, 31 Oct 2017 16:51:20 +0800 Subject: [PATCH] fix payment params error --- pay/pay.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pay/pay.go b/pay/pay.go index 4527e93..720bc73 100644 --- a/pay/pay.go +++ b/pay/pay.go @@ -90,7 +90,7 @@ func (pcf *Pay) PrePayId(p *PayParams) (prePayID string, err error) { tradeType := "JSAPI" template := "appid=%s&body=%s&mch_id=%s&nonce_str=%s¬ify_url=%s&out_trade_no=%s&spbill_create_ip=%s&total_fee=%s&trade_type=%s" str := fmt.Sprintf(template, pcf.AppID, p.Body, pcf.PayMchID, nonceStr, pcf.PayNotifyURL, p.OutTradeNo, p.CreateIP, p.TotalFee, tradeType) - str := str + "&key=" + pcf.PayKey + str = str + "&key=" + pcf.PayKey sum := md5.Sum([]byte(str)) signature := string(sum[:]) sign := strings.ToUpper(signature)