正式路径和沙盒都是这样,不应该是超时啊
midasGetBalance -1midasGetBalance 始终返回 {"errcode":-1,"errmsg":"system error hint: [Em7y09633102]"} 刚才还能报90009,现在全是"errcode":-1,难道是官方服务器出问题了,有人遇到过吗
2018-05-17刚弄完 掉这个接口得到 https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s
midasGetBalance接口中的access_token指的是什么midasGetBalance:https://developers.weixin.qq.com/minigame/dev/document/midas-payment/midasGetBalance.html?t=2018329 我想问一下请求接口中的access_token指的是session_key吗? 我用的是cocos creator,我用下面的代码请求,但是总是返回:查询失败 {"errcode":40001,"errmsg":"invalid credential, access_token is invalid or not latest hint: [tk100729vr60!]"} 我可以确定获取到的wx_session_key是正确的 [代码][代码] //wx_openid 和 wx_session_key都是通过wx.login的code换取的 let data = { openid:wx_openid, appid: appid, midasSecret:midasSecret, offer_id: offer_id, ts: ts, zone_id: '1', pf: 'android', session_key:wx_session_key }; let stringA = 'appid='+data.appid +'&offer_id=' + data.offer_id +'&openid=' + data.openid +'&pf='+data.pf +'&ts='+data.ts +'&zone_id='+data.zone_id; let sigTemp=stringA+"&org_loc=/cgi-bin/midas/getbalance&method=POST&secret="+data.midasSecret; //sig参数 let sig = crypto.createHmac('sha256',data.midasSecret).update(sigTemp).digest('hex'); data.sig = sig; let stringB = 'access_token='+data.session_key +'&appid='+data.appid +'&offer_id=' + data.offer_id +'&openid=' + data.openid +'&pf='+data.pf +'&sig='+data.sig +'&ts='+data.ts +'&zone_id='+data.zone_id; let mp_sigTemp=stringB+"&org_loc=/cgi-bin/midas/getbalance&method=POST&session_key="+data.session_key; let mp_sig = crypto.createHmac('sha256',data.session_key).update(mp_sigTemp).digest('hex'); data.mp_sig = mp_sig; [代码][代码] [代码]let resultData = data;[代码] [代码]let xhr = cc.loader.getXMLHttpRequest();[代码][代码]//沙箱环境[代码][代码]let url = [代码][代码]'https://api.weixin.qq.com/cgi-bin/midas/sandbox/getbalance?'[代码][代码];[代码][代码]url += [代码][代码]'access_token='[代码][代码]+resultData.session_key;[代码][代码]xhr.open([代码][代码]'POST'[代码][代码],url, [代码][代码]true[代码][代码]);[代码] [代码][代码] xhr.onreadystatechange = function () { if (xhr.readyState === 4 && (xhr.status >= 200 && xhr.status < 300)) { let response = JSON.parse(xhr.responseText); if(response.errcode === 0){ //查询成功 console.log('查询成功'); console.log(JSON.stringify(response)); }else{ //查询失败 console.log('查询失败'); console.log('errcode: '+response.errcode); console.log('errmsg: '+response.errmsg); } } }; [代码]//POST参数[代码][代码]let form = [代码][代码]'openid='[代码][代码]+resultData.openid[代码][代码] [代码][代码]+[代码][代码]'&appid='[代码][代码]+resultData.appid[代码][代码] [代码][代码]+[代码][代码]'&offer_id='[代码][代码]+resultData.offer_id[代码][代码] [代码][代码]+[代码][代码]'&ts='[代码][代码]+resultData.ts[代码][代码] [代码][代码]+[代码][代码]'&zone_id='[代码][代码]+resultData.zone_id[代码][代码] [代码][代码]+[代码][代码]'&pf='[代码][代码]+resultData.pf[代码][代码] [代码][代码]+[代码][代码]'&sig='[代码][代码]+resultData.sig[代码][代码] [代码][代码]+[代码][代码]'&access_token='[代码][代码]+resultData.session_key[代码][代码] [代码][代码]+[代码][代码]'&mp_sig='[代码][代码]+resultData.mp_sig;[代码][代码]xhr.send(form);[代码]
2018-05-17access_token 获取的不对吧
setUserStorage签名一直提示错误假设 appid = "123" openid = "1234" access_token = "12345" sessionKey = "123456" 上报 参数 key = lvrank value = 1 请问 用户登录态签名 post_data 是什么 得到的Signature 是什么?(官方文档上的demo例子 我写出来和文档上一致)
2018-05-16