wxpay
wxpay copied to clipboard
使用鼓励金支付微信通知签名验证失败
使用鼓励金支付时 ,微信支付成功的通知会携带coupon_fee、coupon_count等可选字段,验证通知时没有考虑这种情况,导致报签名验证失败异常
怎么解决呢
修改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