Browse Source

fix payment params error

Mongo 8 years ago
parent
commit
0762d6c249
1 changed files with 1 additions and 1 deletions
  1. 1 1
      pay/pay.go

+ 1 - 1
pay/pay.go

@@ -90,7 +90,7 @@ func (pcf *Pay) PrePayId(p *PayParams) (prePayID string, err error) {
 	tradeType := "JSAPI"
 	tradeType := "JSAPI"
 	template := "appid=%s&body=%s&mch_id=%s&nonce_str=%s&notify_url=%s&out_trade_no=%s&spbill_create_ip=%s&total_fee=%s&trade_type=%s"
 	template := "appid=%s&body=%s&mch_id=%s&nonce_str=%s&notify_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 := 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))
 	sum := md5.Sum([]byte(str))
 	signature := string(sum[:])
 	signature := string(sum[:])
 	sign := strings.ToUpper(signature)
 	sign := strings.ToUpper(signature)