Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

微信付款成功验签,err = nil,但ok = false 是什么情况? #71

Closed
ysongyang opened this issue Sep 16, 2020 · 3 comments
Closed
Labels
question Further information is requested

Comments

@ysongyang
Copy link

notifyReq, err := wechat.ParseNotifyToBodyMap(ctx.Request)
// 验签操作
ok, err := wechat.VerifySign(apiKey, wechat.SignType_MD5, notifyReq)

log.Println(ok) // false
log.Println(err) //

这是什么操作??????

@wziww
Copy link
Contributor

wziww commented Sep 16, 2020

一个是 sdk 使用异常(error),一个是 sdk 正常情况下验签的结果(true / false)

@iGoogle-ink
Copy link
Member

@ysongyang
可以看一下源码,error是业务处理 error,判断error不为空,再判断 ok 是否 为 true

@iGoogle-ink iGoogle-ink added the question Further information is requested label Sep 21, 2020
@ysongyang
Copy link
Author

问题已解决~~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants