This commit is contained in:
root 2019-10-25 17:36:38 +08:00
parent 5f90b80e46
commit 83a0374494

View File

@ -27,14 +27,14 @@ class OrderController extends Controller
if ($obj['status'] == 'succeeded') { if ($obj['status'] == 'succeeded') {
$order = Order::where('callback_no', $obj['source']['id'])->first(); $order = Order::where('callback_no', $obj['source']['id'])->first();
if (!$order) { if (!$order) {
die('ERROR'); abort(500, 'ERROR');
} }
if ($order->status !== 0) { if ($order->status !== 0) {
die('SUCCESS'); die('SUCCESS');
} }
$order->status = 1; $order->status = 1;
if (!$order->save()) { if (!$order->save()) {
die('ERROR'); abort(500, 'ERROR');
} }
die('SUCCESS'); die('SUCCESS');
} }