From 599baa9b1766fc4fa43f7408e446308f1f5c8155 Mon Sep 17 00:00:00 2001 From: Alec Ritson Date: Tue, 3 Oct 2023 11:11:26 +0100 Subject: [PATCH] Config and route updates --- payment/stripe/config/stripe.php | 10 ++++++++++ payment/stripe/routes/webhooks.php | 6 ++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/payment/stripe/config/stripe.php b/payment/stripe/config/stripe.php index ed63ec6..e42b7b6 100644 --- a/payment/stripe/config/stripe.php +++ b/payment/stripe/config/stripe.php @@ -1,6 +1,16 @@ 'stripe/webhook', + /* |-------------------------------------------------------------------------- | Capture policy diff --git a/payment/stripe/routes/webhooks.php b/payment/stripe/routes/webhooks.php index bf485e2..b58c1cb 100644 --- a/payment/stripe/routes/webhooks.php +++ b/payment/stripe/routes/webhooks.php @@ -2,5 +2,7 @@ use Illuminate\Support\Facades\Route; -Route::post('stripe/webhook', \Lunar\Stripe\Http\Controllers\WebhookController::class) - ->withoutMiddleware([\App\Http\Middleware\VerifyCsrfToken::class]); +Route::post(config('lunar.stripe.webhook_path', 'stripe/webhook'), \Lunar\Stripe\Http\Controllers\WebhookController::class) + ->withoutMiddleware([\App\Http\Middleware\VerifyCsrfToken::class]) + ->middleware(\Lunar\Stripe\Http\Middleware\StripeWebhookMiddleware::class) + ->name('lunar.stripe.webhook');