Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Stripe Webhooks Laravel Package

spatie/laravel-stripe-webhooks

Laravel package to handle Stripe webhooks: verifies Stripe signatures, logs valid calls to the database, and dispatches configurable jobs or events per webhook type. Provides the plumbing for receiving and validating webhooks; you implement the business logic.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. Buy: Accelerates development by eliminating the need to build custom Stripe webhook handling from scratch, reducing time-to-market for payment-related features.
  • Scalability: Enables reliable handling of high-volume Stripe events (e.g., subscriptions, payments, refunds) with built-in deduplication and logging.
  • Roadmap Priorities:
    • Payments/Subscriptions: Critical for SaaS, e-commerce, or fintech products relying on Stripe for transactions.
    • Compliance/Auditability: Logging all webhook calls to a database supports regulatory requirements (e.g., PCI DSS) and debugging.
    • Event-Driven Architecture: Facilitates decoupled processing (e.g., queueing jobs for async workflows like fraud checks or notifications).
  • Use Cases:
    • Real-time Actions: Trigger actions like sending receipts (invoice.paid), updating user balances (customer.subscription.updated), or handling failures (charge.failed).
    • Multi-Tenant/Connect: Supports Stripe Connect scenarios with multiple signing secrets for platform accounts.
    • Idempotency: Prevents duplicate processing of retried webhooks (e.g., after Stripe retries failed deliveries).

When to Consider This Package

  • Adopt if:
    • Your Laravel app relies on Stripe for payments/subscriptions and needs reliable, scalable webhook handling.
    • You require audit logs of all Stripe events (e.g., for debugging or compliance).
    • You want to decouple webhook processing (e.g., queue jobs for async tasks like emails or analytics).
    • Your team lacks expertise in Stripe’s webhook signature verification or idempotency handling.
    • You’re using Stripe Connect or need to support multiple signing secrets (e.g., for platform accounts).
  • Look Elsewhere if:
    • You’re using a non-Laravel backend (e.g., Node.js, Django) or need a framework-agnostic solution.
    • Your webhook logic is extremely simple (e.g., one-off endpoints with no retries or logging).
    • You require real-time synchronous processing (e.g., blocking UI updates) and can’t tolerate queue delays.
    • You’re already using a Stripe SDK with built-in webhook support (e.g., Stripe’s official PHP library) and don’t need Laravel-specific features like queueing or logging.
    • Your team prefers low-code/no-code tools (e.g., Stripe’s webhook testing tools or Zapier).

How to Pitch It (Stakeholders)

For Executives:

*"This package lets us safely and scalably handle Stripe webhooks—critical for payments, subscriptions, and compliance—without reinventing the wheel. It:

  • Reduces risk: Automatically verifies Stripe signatures and logs all events for audits.
  • Saves dev time: Cuts months of work to build robust webhook infrastructure from scratch.
  • Supports growth: Handles high volumes with queueing and deduplication, so we don’t miss or reprocess events.
  • Future-proofs: Works with Stripe Connect (for platforms) and integrates seamlessly with our Laravel stack.

Cost: Free (MIT license), with minimal ongoing maintenance. ROI: Faster feature delivery for payments/subscriptions, lower debugging overhead, and compliance-ready logs."*


For Engineering:

*"This package solves three key pain points for Stripe webhooks in Laravel:

  1. Security: Automatically validates Stripe signatures (no manual hash_hmac checks) and rejects invalid requests.
  2. Reliability: Deduplicates retried webhooks (Stripe’s default behavior) and logs all payloads to webhook_calls for debugging.
  3. Scalability: Lets us queue jobs for async processing (e.g., sending emails, updating databases) without blocking the webhook endpoint.

How to Use It:

  • Install via Composer, publish config, and route Stripe’s webhook URL to Route::stripeWebhooks().
  • Define jobs or events in config/stripe-webhooks.php to handle specific Stripe events (e.g., charge.succeeded).
  • Leverage built-in retries by reprocessing failed jobs or manually dispatching ProcessStripeWebhookJob.

Trade-offs:

  • Adds a database table (webhook_calls) for logging.
  • Requires queue setup (e.g., Redis) for async processing.
  • Not a silver bullet: You’ll still need to implement business logic (e.g., updating user balances) in your jobs/listeners.

Alternatives:

  • Roll your own: ~1–2 weeks of dev time for signature verification, deduplication, and logging.
  • Stripe CLI: Good for testing, but lacks Laravel integration.

Recommendation: Use this for any Stripe-dependent feature (payments, subscriptions, payouts). It’s battle-tested (500+ stars) and maintained by Spatie, a trusted Laravel package provider."*

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codraw/framework-extra-bundle
codraw/messenger
codraw/security
codraw/mailer
codraw/contracts
codraw/profiling
codraw/dependency-injection
codraw/tester
codraw/core
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony