From e6ef07139db60d52184edbeebb3f6e206999e904 Mon Sep 17 00:00:00 2001 From: IceToast <> Date: Sun, 15 Jan 2023 01:40:25 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20Moved=20Stripe=20routes=20t?= =?UTF-8?q?o=20extension?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PaymentGateways/Stripe/routes.php | 22 +++++++++++++++++++ routes/web.php | 11 +++------- 2 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 app/Extensions/PaymentGateways/Stripe/routes.php diff --git a/app/Extensions/PaymentGateways/Stripe/routes.php b/app/Extensions/PaymentGateways/Stripe/routes.php new file mode 100644 index 00000000..9322202a --- /dev/null +++ b/app/Extensions/PaymentGateways/Stripe/routes.php @@ -0,0 +1,22 @@ +name('payment.StripePay'); + +Route::get( + 'payment/StripeSuccess', + function () { + StripeSuccess(request()); + } +)->name('payment.StripeSuccess'); + + +// Stripe WebhookRoute -> validation in Route Handler +Route::post('payment/StripeWebhooks', function () { + StripeWebhooks(request()); +})->name('payment.StripeWebhooks'); diff --git a/routes/web.php b/routes/web.php index 35371bab..709bfff7 100644 --- a/routes/web.php +++ b/routes/web.php @@ -49,17 +49,14 @@ Route::middleware('guest')->get('/', function () { Auth::routes(['verify' => true]); -// Stripe WebhookRoute -> validation in Route Handler -Route::post('payment/StripeWebhooks', [PaymentController::class, 'StripeWebhooks'])->name('payment.StripeWebhooks'); - Route::get('/privacy', function () { -return view('information.privacy'); + return view('information.privacy'); })->name('privacy'); Route::get('/imprint', function () { -return view('information.imprint'); + return view('information.imprint'); })->name('imprint'); Route::get('/tos', function () { -return view('information.tos'); + return view('information.tos'); })->name('tos'); Route::middleware(['auth', 'checkSuspended'])->group(function () { @@ -91,8 +88,6 @@ Route::middleware(['auth', 'checkSuspended'])->group(function () { //payments Route::get('checkout/{shopProduct}', [PaymentController::class, 'checkOut'])->name('checkout'); Route::post('payment/pay', [PaymentController::class, 'pay'])->name('payment.pay'); - Route::get('payment/StripePay/{shopProduct}', [PaymentController::class, 'StripePay'])->name('payment.StripePay'); - Route::get('payment/StripeSuccess', [PaymentController::class, 'StripeSuccess'])->name('payment.StripeSuccess'); Route::get('payment/FreePay/{shopProduct}', [PaymentController::class, 'FreePay'])->name('payment.FreePay'); Route::get('payment/Cancel', [PaymentController::class, 'Cancel'])->name('payment.Cancel');