作者 郭文星
... ... @@ -203,7 +203,8 @@ class Wechat extends Api
/*
3.订单支付 前端请求
3.1 入库 订单状态
3.2 入库完成 处理支付接口 返回给前端
3.2 入库完成 处理支付接口 返回给前端 成功下单的接口结构
{"code":1,"msg":"下单成功","time":"1685349626","data":{"appId":"wx1c3cc5b4e2006be2","nonceStr":"647464fb20f0c","package":"prepay_id=wx29164027049900e6020fe5bc7628300000","signType":"MD5","paySign":"7EC048B24D643F7115DC0D6063A17E62","timestamp":"1685349627"}}
wx.chooseWXPay({
timestamp: <?= $config['timestamp'] ?>,
nonceStr: '<?= $config['nonceStr'] ?>',
... ... @@ -215,10 +216,12 @@ class Wechat extends Api
}
});
3.3 回调修改订单状态
*/
public function prepare_order($order_no = ''){
$user_id = $this->auth->id;
print_r([$this->auth->id,$this->auth->getUser()]);return;
$user_id = 2;//模拟用户
if(empty($user_id)){
return $this->error('用户信息错误');
}
... ...