From 314d4de81653c633c230ced43d42c98f0da47b22 Mon Sep 17 00:00:00 2001 From: IceToast <> Date: Sun, 15 Jan 2023 02:22:03 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20TypeError?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Extensions/PaymentGateways/Stripe/index.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Extensions/PaymentGateways/Stripe/index.php b/app/Extensions/PaymentGateways/Stripe/index.php index 134ca414..ea0369e8 100644 --- a/app/Extensions/PaymentGateways/Stripe/index.php +++ b/app/Extensions/PaymentGateways/Stripe/index.php @@ -93,7 +93,7 @@ function StripePay(Request $request) function StripeSuccess(Request $request) { $user = Auth::user(); - error_log('StripeSuccess'); + $user = User::findOrFail($user->id); $payment = Payment::findOrFail($request->input('payment')); $shopProduct = ShopProduct::findOrFail($payment->shop_item_product_id); @@ -133,7 +133,6 @@ function StripeSuccess(Request $request) 'status' => 'processing', ]); - // todo invoice event(new PaymentEvent($user, $payment, $shopProduct)); Redirect::route('home')->with('success', 'Your payment is being processed')->send(); @@ -179,6 +178,9 @@ function handleStripePaymentSuccessHook($paymentIntent) event(new UserUpdateCreditsEvent($user)); event(new PaymentEvent($user, $payment, $shopProduct)); } + + // return 200 + return response()->json(['success' => true], 200); } catch (Exception $ex) { abort(422); }