微信支付返回
-
微信支付JSAPI支付成功后res未返回或无法判断支付成功的解决办法
首先,我们要明确JSAPI支付成功后,res到底返回了什么。 通过将res写后端日志,可以看到如下所示:
1234567891011121314151617181920212223[ info ] [ HEADER ] array ('cookie' => 'PHPSESSID=vegi7372n5hr1h7r8trdtm90u9','accept-language' => 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7','accept-encoding' => 'gzip, deflate','referer' => 'https://school.lanluo.cn/index/user/order/id/13','sec-fetch-dest' => 'empty','sec-fetch-mode' => 'cors','sec-fetch-site' => 'same-origin','origin' => 'https://school.lanluo.cn','content-type' => 'application/x-www-form-urlencoded; charset=UTF-8','user-agent' => 'Mozilla/5.0 (Linux; Android 12; M2011K2C Build/SKQ1.211006.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/86.0.4240.99 XWEB/4313 MMWEBSDK/20220805 Mobile Safari/537.36 MMWEBID/576 MicroMessenger/8.0.27.2220(0x28001B3F) WeChat/arm64 Weixin NetType/5G Language/zh_CN ABI/arm64','x-requested-with' => 'XMLHttpRequest','accept' => 'application/json, text/javascript, */*; q=0.01','content-length' => '23','host' => 'school.lanluo.cn',)[ info ] [ PARAM ] array ('errMsg' => 'chooseWXPay:ok',)[ info ] [ RUN ] app\index\controller\User->order_res[ /www/wwwroot/school.lanluo.cn/application/index/controller/User.php ][ notice ] array ('errMsg' => 'chooseWXPay:ok',)在最后,明确了res的内容是:’errMsg’ => ‘chooseWXPay:ok’ 官方文档 在公众号的说明是这样的:https://…