From bf28f4bc4b3882e1a608ed7001519e02205f811e Mon Sep 17 00:00:00 2001 From: root Date: Mon, 4 Nov 2019 13:48:28 +0800 Subject: [PATCH] update --- app/Http/Controllers/Guest/OrderController.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/Guest/OrderController.php b/app/Http/Controllers/Guest/OrderController.php index 28c1223a..52a59938 100644 --- a/app/Http/Controllers/Guest/OrderController.php +++ b/app/Http/Controllers/Guest/OrderController.php @@ -26,15 +26,15 @@ class OrderController extends Controller if($response->isPaid()){ $order = Order::where('trade_no', $_POST['out_trade_no'])->first(); if (!$order) { - abort(500, 'ERROR'); + abort(500, 'fail'); } if ($order->status !== 0) { - die('SUCCESS'); + die('success'); } $order->status = 1; $order->callback_no = $_POST['trade_no']; if (!$order->save()) { - abort(500, 'ERROR'); + abort(500, 'fail'); } /** * Payment is successful @@ -72,16 +72,16 @@ class OrderController extends Controller if ($obj['status'] == 'succeeded') { $order = Order::where('callback_no', $obj['source']['id'])->first(); if (!$order) { - abort(500, 'ERROR'); + abort(500, 'fail'); } if ($order->status !== 0) { - die('SUCCESS'); + die('success'); } $order->status = 1; if (!$order->save()) { - abort(500, 'ERROR'); + abort(500, 'fail'); } - die('SUCCESS'); + die('success'); } }