$wxTool=new WxRelevantTool(); $redis=new Redis(); $session_key=$redis->get($this->user_data['small_theater_openid']); //获取 paySig //获取 signature $postdate['openid'] = $openid; $postdate['user_ip'] = '127.0.0.1'; $postdate['env'] = 1; $appkey =$wxTool->AppKey ; $url = "/xpay/query_user_balance"; $signData = json_encode($postdate); $data['num']=$score; $data['paySig']=WxRelevantTool::calc_PaySig($url, $signData, $appkey); $data['signature']=WxRelevantTool::calc_Signature($signData, $session_key); $data['offerId']=$wxTool->OfferID; $data['order_id']=$order; DataReturnTool::ajaxReturn(200,'成功',$data); $url $postdate['openid'] = $openid; $postdate['user_ip'] = '127.0.0.1'; $postdate['env'] = 1; 这几个我不知道怎么弄
微信小程序虚拟支付,查询账户余额错误 【系统错误,请稍后重试】 ?Array ( [errcode] => -1 [errmsg] => system error detail:[系统错误,请稍后重试] rid: 64e85c3b-08099c3e-39088b6f )
2023-08-25楼主解决了吗
微信小程序虚拟支付对接报签名错误?参考文档:https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/virtual-payment.html 调用接口: https://api.weixin.qq.com/xpay/query_user_balance?access_token=71_n_O9fO__O0bLuVr-kjIgNXmxHmsOU7fURFSpfTTRvYp7tReFzt4bDrGEqNgGFpCZfnbaZMAaOneDFfTOh_Il9QtRkpOlZxmGNlgWjSnSbdmNb0nX8Wwx27LLfYoYMGcABANBV&pay_sig=ef671bb980a4de54f6f6a93f54165701aad5ba4835b4d117f52381d6ca07df4f&signature=96fb3d84dc5d09a7accb2df460a8cb934ed5ad863d99c37f83907e8065989608 请求参数: {"openid":"oSOB25Id4x-dMBmicDnvEPycdMnM","user_ip":"127.0.0.1","env":1} php生成签名的方法(对标上面文档中提供的python脚本改写): /** * pay_sig签名算法计算示例 * @param $uri * @param $postBody * @param $appKey * @return string */ public function calcPaySig($uri, $postBody, $appKey): string { $needSignMsg = $uri . '&' . $postBody; return bin2hex(hash_hmac('sha256', $needSignMsg, $appKey, true)); } /** * 用户登录态signature签名算法 * @param $postBody * @param $sessionKey * @return string */ public function calcSignature($postBody, $sessionKey) { return bin2hex(hash_hmac('sha256', $postBody, $sessionKey, true)); } 返回错误: {"errcode":268490003,"errmsg":"签名校验失败 rid: 64ca5e2f-6884c3cf-184aa397"}
2023-08-25现在可以了吗, 我现在也在写这个,可以交流一下吗
微信小程序虚拟支付对接报系统错误?参考文档:https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/virtual-payment.html 调用接口: https://api.weixin.qq.com/xpay/query_user_balance?access_token=71_-XlebZfN1-xxxx&pay_sig=a18e12a0de2d0da28cb352c3841bad43b6de2fa7b0d48e0d557ccf3c56afe639&signature=7ffd0a7487df3e76f03296336df191d19bb89dd7acf5a08666675b894f59c45a 请求参数: {"openid":"oGFgL5HKExTYAW_UFFBZF-SBobuE","user_ip":"127.0.0.1","env":1} 返回错误: {"errcode":-1,"errmsg":"system error detail:[系统错误,请稍后重试] rid: 64d5edb8-34e60334-25b034cb"}
2023-08-23