data = {
"appid": "*******",
"mch_id": "****",
"device_info": "******",
"body": "*****".encode("unicode_escape"),
"nonce_str": random_str(),
}
appid=*****&body=b'\\u6c90\\u6d74\\u4e73'&device_info=******&mch_id=******&nonce_str=C9kIATeeCeocvsDU&key=*******
D1E1D6B************B12A367j
url = "https://api.mch.weixin.qq.com/pay/micropay"
xml_data = '<xml>%s</xml>' % dicttoxml.dicttoxml(data, root=False)
headers = {'Content-Type': 'application/xml'}
res = requests.post(url, data=xml_data, headers=headers)
{
"xml": {
"return_code": "FAIL",
"return_msg": "签名错误"
}
}
我现在就是不知道为什么是签名错误,问题出在哪里呀 校验过的计算没问题