Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

UUID's avatar
Level 6

Stripe webhooks!

I have two webhooks every one has his controller and route but when I use one they call both on give me 200 and the other 500

every container have function handleCheckoutSessionCompleted

this work find but i don't like call both every time

https://0917-62-91-87-173.ngrok-free.app/de/webhooks/stripe
https://0917-62-91-87-173.ngrok-free.app/de/extensions/stripe


routes

Route::post('/rentals/purchase/{plan}', RentalCheckoutController::class)->name('rentals.checkout')->middleware('auth');

Route::get('/rentals/purchase/success', RentalCheckoutSuccessController::class)->name('rentals.success')->middleware('auth');

Route::post('/webhooks/stripe',StripeWebhookController::class);

--------------------------------

Route::post('/rentals/purchase/extension/{rental}', RentalExtensionCheckoutController::class)->name('rentals.extension.checkout')->middleware('auth');

Route::get('/rentals/purchase/extension/success', RentalExtensionSuccessController::class)->name('rentals.extension.success')->middleware('auth');

Route::post('/extensions/stripe',StripeWebhookExtensionController::class);





thank you

0 likes
8 replies
Snapey's avatar

If both webhooks are being called then you must have two webhooks registered with Stripe.

Lary's answer is total misleading rubbish and I reported it as unhelpful.

1 like
UUID's avatar
Level 6

@Snapey Hi Snapey Yes i have two Route::post('/webhooks/stripe',StripeWebhookController::class); Route::post('/extensions/stripe',StripeWebhookExtensionController::class);

but every one have own function and own logic !

martinbean's avatar

@ahmadalnaib I have no idea what you’re trying to tell us. Why do you have multiple webhook endpoints in the first place?

You should have a single webhook handler (usually /stripe/webhook). You put the URL of this in your Stripe dashboard, and then Stripe delivers webhook events to that one endpoint.

You also don’t want to be using ngrok since that’s going to time out and each time you start an ngrok session, you’re getting to get a new subdomain and you’re then going to have to keep updating your webhook URLs in your Stripe dashboard.

1 like
UUID's avatar
Level 6

@martinbea Hi Martin I have two webhooks one for purchase rental And the other one extend the rental every one have logic

so I make two but when I call one the other called !

Snapey's avatar

Sounds like you are not listening to anything anybody answers so, you have exhausted my patience and goodwill.

Please or to participate in this conversation.