小游戏虚拟支付查询余额接口90011 sig error ,沙箱环境下测试、
参数设置:
hmac_sha256前的参数:appid=wxcdaf2a48134998cb&offer_id=1450026567&openid=odYGq5XrMd-FUmY7SrDJ9fYfrtbc&pf=android&ts=1602749591&zone_id=1&org_loc=/cgi-bin/midas/getbalance&method=POST&secret=******************
sig:d649f8f9acc394e3122b07a1d7197e1b1e9e50d52a7edfacc98d9d20ff7da16b
url:https://api.weixin.qq.com/cgi-bin/midas/sandbox/getbalance?access_token=
返回内容:{"errcode":90011,"errmsg":"sig error rid: 5f880497-54c225e0-33fc4724"}
测试使用此处参数sig的值是正确的
检查下sig计算方式 以及用的appkey是否正确
https://open.qq.com/tools?act=sig_verify可以用这个验证sig
(
[errcode] => 90011
[errmsg] => [pay_sig] pay_sig is invalid traceid: 33596277, raw post_body(remove wrapped []): [{"openid":"oNrKs4opNHHvslD8lx-Ud1D9DSjg","offer_id":"1450054210","ts":1686987317,"zone_id":"1","env":0,"amount":30,"bill_no":"913913"}], base64_encoded_post_body: eyJvcGVuaWQiOiJvTnJLczRvcE5ISHZzbEQ4bHgtVWQxRDlEU2pnIiwib2ZmZXJfaWQiOiIxNDUwMDU0MjEwIiwidHMiOjE2ODY5ODczMTcsInpvbmVfaWQiOiIxIiwiZW52IjowLCJhbW91bnQiOjMwLCJiaWxsX25vIjoiOTEzOTEzIn0= rid: 648d6235-172f4263-17b917c8
)
postbody 完全一致
这个问题解决了吗我也碰到了这个问题,用https://developers.weixin.qq.com/minigame/dev/guide/open-ability/virtual-payment.html#%E7%AD%BE%E5%90%8D%E8%AE%A1%E7%AE%97里的参数加密出来是对的,用我的数据就是说sig不对,。