Jerry 6 лет назад
Родитель
Сommit
bd40beeb49
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      wechat_servier_api.go

+ 2 - 2
wechat_servier_api.go

@@ -29,7 +29,7 @@ func HttpAgent() (agent *gorequest.SuperAgent) {
 }
 
 //验证支付成功后通知Sign值
-func VerifyPayResultSign(apiKey string, notifyRsp *WeChatNotifyRequest) (ok bool, sign string) {
+func VerifyPayResultSign(apiKey string, signType string, notifyRsp *WeChatNotifyRequest) (ok bool, sign string) {
 
 	body := make(BodyMap)
 	body.Set("return_code", notifyRsp.ReturnCode)
@@ -63,7 +63,7 @@ func VerifyPayResultSign(apiKey string, notifyRsp *WeChatNotifyRequest) (ok bool
 
 	signStr := sortSignParams(apiKey, body)
 	var hashSign []byte
-	if notifyRsp.SignType == SignType_MD5 {
+	if signType == SignType_MD5 {
 		hash := md5.New()
 		hash.Write([]byte(signStr))
 		hashSign = hash.Sum(nil)