Skip to content

微信支付结果通知接口请求signType为空时默认为统一下单时的signType,若统一下单时使用HMAC-SHA256签名会导致验签失败 #1585

Description

@joewee

简要描述

微信支付结果通知接口请求signType为空时默认为统一下单时的signType,若统一下单时使用HMAC-SHA256签名,支付结果通知请求中signType为空,若采用微信官方文档上所说采用MD5验签会导致验签失败。

模块版本情况

  • WxJava 模块名: weixin-java-pay
  • WxJava 版本号: 3.8.0

详细描述

支付通知报文:

<xml><appid><![CDATA[wxbabdf7a3a9acdfef]]></appid>
<bank_type><![CDATA[OTHERS]]></bank_type>
<cash_fee><![CDATA[1]]></cash_fee>
<fee_type><![CDATA[CNY]]></fee_type>
<is_subscribe><![CDATA[N]]></is_subscribe>
<mch_id><![CDATA[1583165551]]></mch_id>
<nonce_str><![CDATA[1590477937689]]></nonce_str>
<openid><![CDATA[oWeP25T9OE1ixbLUgN0DxMuSZ6N4]]></openid>
<out_trade_no><![CDATA[20052615250005]]></out_trade_no>
<result_code><![CDATA[SUCCESS]]></result_code>
<return_code><![CDATA[SUCCESS]]></return_code>
<sign><![CDATA[8172FF692C2606339C2C80B371F5695BAC78A52CBB64883F9A02B1C7A28B847C]]></sign>
<time_end><![CDATA[20200526152550]]></time_end>
<total_fee>1</total_fee>
<trade_type><![CDATA[JSAPI]]></trade_type>
<transaction_id><![CDATA[4200000540202005267407409907]]></transaction_id>
</xml>

日志

产生异常:
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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions