Sfoglia il codice sorgente

feat: ✨ Moved Stripe routes to extension

IceToast 2 anni fa
parent
commit
e6ef07139d
2 ha cambiato i file con 25 aggiunte e 8 eliminazioni
  1. 22 0
      app/Extensions/PaymentGateways/Stripe/routes.php
  2. 3 8
      routes/web.php

+ 22 - 0
app/Extensions/PaymentGateways/Stripe/routes.php

@@ -0,0 +1,22 @@
+<?php
+
+use Illuminate\Support\Facades\Route;
+
+include_once(__DIR__ . '/index.php');
+
+Route::get('payment/StripePay/{shopProduct}', function () {
+    StripePay(request());
+})->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');

+ 3 - 8
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');