更新
This commit is contained in:
parent
a7504f3660
commit
188db1c071
@ -38,4 +38,23 @@ class PayController extends BaseApiController
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 查询订单支付状态
|
||||
*/
|
||||
public function wechatQuery(){
|
||||
$order_no=$this->request->get('order_no');
|
||||
$order = [
|
||||
'out_trade_no' => $order_no,
|
||||
];
|
||||
$app=new PayService(0);
|
||||
|
||||
$res = $app->wechat->query($order);
|
||||
if ($res['trade_state'] == 'SUCCESS' && $res['trade_state_desc'] == '支付成功') {
|
||||
PayNotifyLogic::handle('cashierclass', $res['out_trade_no'], $res);
|
||||
return $this->success('支付成功');
|
||||
}else{
|
||||
return $this->fail('订单支付中');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ class PaymentLogic extends BaseLogic
|
||||
$result = $wechat->wechat->pos($order)->toArray();
|
||||
} catch (ExceptionException $e) {
|
||||
if(getenv('APP_DEBUG')==true){
|
||||
self::$error=$e->extra['message'];
|
||||
self::$error=$e->extra['message']??$e->getMessage();
|
||||
}else{
|
||||
self::$error = $e->getMessage();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user