wxpay icon indicating copy to clipboard operation
wxpay copied to clipboard

使用鼓励金支付微信通知签名验证失败

Open zzkristy opened this issue 7 years ago • 2 comments

使用鼓励金支付时 ,微信支付成功的通知会携带coupon_fee、coupon_count等可选字段,验证通知时没有考虑这种情况,导致报签名验证失败异常

zzkristy avatar May 19 '17 14:05 zzkristy

怎么解决呢

YubinH avatar May 22 '17 04:05 YubinH

修改verify_notify中解析xml的方式,把返回的xml所有字段取出来。

def xml2dict(xml_str):
        root = ElementTree.fromstring(xml_str)
        result = {}
        for child in root:
            tag = child.tag
            text = child.text
            result[tag] = text
        return result

zzkristy avatar May 22 '17 05:05 zzkristy