complete($order); } catch (Exception $e) { $orderService->delete($order); return response()->json([ 'message' => $e->getMessage(), ], 403); } $order->storeTransaction($response); event(new OrderPlaced($order)); if (! request()->ajax()) { return redirect()->route('checkout.complete.show'); } } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show() { $order = session('placed_order'); if (is_null($order)) { return redirect()->route('home'); } return view('public.checkout.complete.show', compact('order')); } }