Array
(
[appid] => XXXXXXXXXXX
[attach] => {"device":"mini","order_type":1,"order_sn":["SO200730133749208140000050"]}
[body] => XXXXXXXXXXX商品
[goods_tag] =>
[mch_id] => XXXXXXXXXXX
[nonce_str] => pveiuvt8e64ukk8z7mkg011x2n5dl4ct
[notify_url] => https://XXXXXXXXXXX.html
[openid] => XXXXXXXXXXX
[out_trade_no] => 20200730145602408640000052
[spbill_create_ip] => 192.168.112.1
[sub_appid] =>XXXXXXXXXXX
[sub_mch_id] => XXXXXXXXXXX
[time_expire] => 20200730150603
[time_start] => 20200730145603
[total_fee] => 3
[trade_type] => JSAPI
[sign] => 6541281749E926108CC5C2B2BB13727A
)
Array
(
[return_code] => FAIL
[return_msg] => sub_mch_id与sub_appid不匹配
)
不是哦,openid 就是这个 sub_appid小程序授权之后获取到的
https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=4_4,该报错。是你的openid和appid并非匹配造成的。参看文档获取openid