我们正在接入视频号小店的开放接口,以实现订单同步和发货功能,但在后台配置消息回调参数的过程中遇到【提交回调消息失败,verify验证错误,请稍后再试】,调试过程中,我们可以正常接收到消息,并进行验签和解密消息,但返回响应之后,就遇到了上述问题,我们对照文档对返回消息做了以下尝试
1.直接返回空字符串
2.直接返回"success"
3.返回加密过后的"success",加密后的返回消息体如下
{"echostr":"tIg9R9+MuXH4Fk6X2b4JmPbZ0SanfxBi9THCuL/UBKn9PF4L5sHgcpFlbMd1bgdXQBOFl/K1ecbOdJWCgy+90Q==","signature":"b6d7d03bd4ed1138b8301a19c1eaa5ee38193aa4","timestamp":"1675993881811","nonce":"taT5gSJoF9qy6zAB"}
对于返回的消息体字段格式,由于开放文档上没有明确指出,我通过网上和之前的文档,又进行了如下尝试
{"encrypt":"4lLR9C4CTipMtMQAVKElrhPYvftzeE8S0scFcNzCb2VDABRGwtFRI/3+LRscAWuHgvUz2pNjahMjNi6xCM5+rA==","signature":"757c8dc849416d90186e1d66ef456f7d8b94ada7","timestamp":"1675994037619","nonce":"w2CmMckLeepUZ3QI"}
{"Encrypt":"uZLXQy6S9KQghvqFgLSUfxzlZSGh3CXnWe99tZsdt76pX8mUZ7lezhYjTb6VwewqF3a+4nKuQ8cDicfOIIclxw==","MsgSignature":"7572f1c5f9e710315e0b457c3c9830f9ce48bb0e","TimeStamp":"1675994121773","Nonce":"Jl5NS4qDjbJYFUbM"}
甚至使用了文档里已经写明的不支持的xml格式
<xml>
<Encrypt><![CDATA[icBJb1roetz9RSGk6aEY0nT9Q13jqtwni587XV2UXBBkzoCl78uC3fGsrQRkv0l3FzBw/faX93IWgbHg/Ochxw==]]></Encrypt>
<MsgSignature><![CDATA[9167e9953c9e489d9116bbe99c97d7891f343967]]></MsgSignature>
<TimeStamp>1675994261398</TimeStamp>
<Nonce><![CDATA[9YMJHoZP8C4Vdlin]]></Nonce>
</xml>
以上方法都返回了上述问题,导致我们不能正常接入消息回调,不清楚是因为什么导致了回传失败
问题已解决,返回的数据不能有任何格式,只能是一个干净的字符串.
1.成功的
8404152678078201806
2.失败的
{
"statusCode": 200,
"data": "8404152678078201806",
"succeeded": true,
"errors": null,
"extras": null,
"timestamp": 1694057607
}
楼主,解决了吗?我也遇到这个情况了,也测试了这4种情况,都不行
1.直接返回明文的echostr
2764012792170008373
2.直接返回加密后的echostr
wRCcvEZAscrLnoqWBPh6i2ZEbPV2P/hr+s4ucFi5NvZMyHZRTqFmtF0w+y6ssbqt1OLLoaawt9bC6lWJk8pJ0w==
3.密文不参与加签返回
{"encrypt":"kQQA2e6mPP/Z2u1WA81XmXrhOIAr9WfX3rdUemTGzPc8DXbHKrlSFlvO88SI8E4hEz5OTbCDq971ER4mS9xtmg==","signature":"a0629fea3ba401ca71ee369c412b05d8af83025c","timestamp":"1676266812","nonce":"144238157"}
4.密文参与没有加签返回
{"encrypt":"c2xVIoRbQZzPBYOQgYHSTUXncnzXrRtgFlDM5bWEvCevWD4q2aKPGvlkkGW5ldjauGtpS81zwT1PAcS9Lxh10w==","signature":"30301fbdca
验证的时候不是返回success的。返回微信传过来的echostr 。文档地址 https://developers.weixin.qq.com/doc/channels/API/basics/message_push.html
1.直接返回明文的echostr
2764012792170008373
2.直接返回加密后的echostr
wRCcvEZAscrLnoqWBPh6i2ZEbPV2P/hr+s4ucFi5NvZMyHZRTqFmtF0w+y6ssbqt1OLLoaawt9bC6lWJk8pJ0w==
3.密文不参与加签返回
{"encrypt":"kQQA2e6mPP/Z2u1WA81XmXrhOIAr9WfX3rdUemTGzPc8DXbHKrlSFlvO88SI8E4hEz5OTbCDq971ER4mS9xtmg==","signature":"a0629fea3ba401ca71ee369c412b05d8af83025c","timestamp":"1676266812","nonce":"144238157"}
4.密文参与没有加签返回
{"encrypt":"c2xVIoRbQZzPBYOQgYHSTUXncnzXrRtgFlDM5bWEvCevWD4q2aKPGvlkkGW5ldjauGtpS81zwT1PAcS9Lxh10w==","signature":"30301fbdcadca4cbf9bbcf4e91ab75662c660cfa","timestamp":"1676266907","nonce":"401431989"}
appid 和密钥是否正确?appid 是视频号小店的不?