forceDelete(); Cart::restoreStock(); if ($request->ajax()) { return response()->json( [ 'success' => true, 'message' => trans('payment::messages.payment_cancelled'), ], 200, ); } return redirect() ->route('checkout.create') ->with('error', trans('payment::messages.payment_cancelled')); } }