Closed
Description
调用微信支付里拉取用户评论数据的接口:
this.wxService.queryComment(DateUtils.addDays(new Date(), -30), new Date(), 0, 200);
报错:
WxPayException(customErrorMsg=null, returnCode=FAIL, returnMsg=商户签名错误, resultCode=null, errCode=null, errCodeDes=null, xmlString=
<return_code></return_code>
<return_msg></return_msg>
)
将打印出来的请求数据放到微信支付接口签名校验工具里校验,结果如下:
1.接口请求的原始数据去校验,校验失败。
2.接口请求的原始数据去掉 <sign_type>HMAC-SHA256</sign_type>,校验成功。
结论:从实验结果上,请求数据设置了signType就会签名出错,不清楚是微信本身问题,还是weixin-java-pay的接口问题, <sign_type>HMAC-SHA256</sign_type> 本身有默认值,建议去掉这个设置,以便解决这个问题。