root 5 years ago
parent
commit
621658ba84
1 changed files with 3 additions and 3 deletions
  1. 3 3
      app/Http/Controllers/Guest/OrderController.php

+ 3 - 3
app/Http/Controllers/Guest/OrderController.php

@@ -69,13 +69,13 @@ class OrderController extends Controller
         }
 
         $obj = $event->data->object;
-        if ($obj['status'] == 'succeeded') {
-            $order = Order::where('callback_no', $obj['source']['id'])->first();
+        if ($obj['status'] == 'chargeable') {
+            $order = Order::where('callback_no', $obj['id'])->first();
             if (!$order) {
                 abort(500, 'fail');
             }
             if ($order->status !== 0) {
-                die('success');
+                die('order is paid');
             }
             $order->status = 1;
             if (!$order->save()) {