-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
微信支付结果通知接口请求signType为空时默认为统一下单时的signType,若统一下单时使用HMAC-SHA256签名会导致验签失败 #1585
Labels
Comments
你自己指定的请求时的签名是 |
是的,统一下单时指定了HMAC-SHA256 @binarywang |
现在微信接口实际情况和文档上好像有差异,支付通知的签名好像是用的统一下单时用的签名类型 |
这真是够坑爹的 |
joewee
changed the title
微信支付结果通知接口官方文档显示signType为空默认MD5但是实际接口返回好像是HMAC-SHA256导致验签失败
微信支付结果通知接口请求signType为空时默认为统一下单时的signType,若统一下单时使用HMAC-SHA256签名会导致验签失败
May 26, 2020
建议先换签名类型为md5,解决此问题 |
binarywang
added a commit
that referenced
this issue
May 26, 2020
我已经改为MD5了,我的想法也是增加个重载方法指定signType。另外或者默认为空时从config中取signType,但是好像这样不能完全解决这个问题 @binarywang |
我已经增加了个重载方法,你可以看看最新代码,如果有更好的方法,欢迎随时提交PR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
简要描述
微信支付结果通知接口请求signType为空时默认为统一下单时的signType,若统一下单时使用HMAC-SHA256签名,支付结果通知请求中signType为空,若采用微信官方文档上所说采用MD5验签会导致验签失败。
模块版本情况
详细描述
支付通知报文:
日志
产生异常:
com.github.binarywang.wxpay.exception.WxPayException: 参数格式校验错误!
at com.github.binarywang.wxpay.bean.result.BaseWxPayResult.checkResult(BaseWxPayResult.java:331)
at com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult.checkResult(WxPayOrderNotifyResult.java:324)
at com.github.binarywang.wxpay.service.impl.BaseWxPayServiceImpl.parseOrderNotifyResult(BaseWxPayServiceImpl.java:158)
The text was updated successfully, but these errors were encountered: