catch-of-the-day/stripe-webhook-bundle
Illuminate\Events\Dispatcher), but the implementation would need adaptation.stripe/stripe-php SDK already handles this, but this bundle could streamline event dispatching.Event facade to dispatch Stripe events.EventDispatcher with Laravel’s Dispatcher.stripe-signature header validation).mrp/stripe-webhook-events).| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Symfony Dependency | High | Abstract core logic; use Laravel’s event system. |
| Webhook Security | Medium | Implement Laravel middleware for signature validation. |
| Bundle Maturity (WIP) | Medium | Review codebase for edge cases (e.g., retries, idempotency). |
| Laravel-Symfony Gaps | High | Test event listeners and service container integration. |
Event::listen() or a service provider.Route::post('/stripe-webhooks', ...).Event facade instead of Symfony’s EventDispatcher.app() or bind().StripeWebhookHandler) and integrate it into Laravel’s middleware/events.file_get_contents('php://input') parsing).stripe/stripe-php for webhook verification (if not already in use).// app/Http/Middleware/StripeWebhook.php
public function handle($request, Closure $next) {
$payload = $request->getContent();
$sigHeader = $request->header('Stripe-Signature');
\Stripe\Webhook::constructEvent($payload, $sigHeader, 'whsec_...');
event(new StripeWebhookReceived($event));
return response()->json(['status' => 'ok']);
}
Event::listen() or a service provider to bind Stripe events to handlers.charge.succeeded, payment_intent.succeeded).failed event for jobs or logging).dispatch(new ProcessStripeEvent($event))) can handle scaling.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Invalid Stripe Signature | False events processed | Strict middleware validation. |
| Event Listener Fails | Silent data loss | Queue failed events for retry. |
| Laravel Event System Down | Webhook drops | Fallback to direct logic (temporary). |
| Stripe API Rate Limits | Retry storms | Exponential backoff in listeners. |
StripeWebhookReceived event structure and available data.How can I help you explore Laravel packages today?