Fix: Stripping Lunar's Stripe Driver with Boboko's Stripe Payment Driver

This commit is contained in:
2026-09-15 21:38:16 +03:00
parent 4489475840
commit 956e9e88a6
8 changed files with 288 additions and 59 deletions
@@ -9,18 +9,17 @@ use Modules\Core\Payment\Drivers\StripePaymentDriver;
use Stripe\Webhook;
/**
* A boboko-owned webhook endpoint for Stripe — deliberately NOT
* lunarphp/stripe's own route (vendor/lunarphp/stripe/routes/webhooks.php),
* which dispatches into Lunar's own Payments::driver('stripe') flow (the
* flow StripePaymentDriver was built to replace, see that class's own
* docblock). Signature verification is handled by
* Lunar\Stripe\Http\Middleware\StripeWebhookMiddleware, registered on this
* route (see src/Payment/routes/webhooks.php) — pure Stripe SDK
* verification + event-type filtering, safe to reuse even though this
* controller never touches the rest of that vendor package's flow. This
* controller verifies the signature again itself (Webhook::constructEvent())
* to get the constructed Event object — the middleware doesn't stash one
* anywhere reusable, it only gates the request through.
* A boboko-owned webhook endpoint for Stripe — never went through Lunar's
* own Payments::driver('stripe') flow (the flow StripePaymentDriver was
* built to replace, see that class's own docblock), and lunarphp/stripe
* has since been removed entirely (see Modules\Core\Payment\Support\
* StripeManager's own docblock). Signature verification is handled by
* Modules\Core\Payment\Http\Middleware\StripeWebhookMiddleware, registered
* on this route (see src/Payment/routes/webhooks.php) — pure Stripe SDK
* verification + event-type filtering. This controller verifies the
* signature again itself (Webhook::constructEvent()) to get the
* constructed Event object — the middleware doesn't stash one anywhere
* reusable, it only gates the request through.
*
* Resolves the driver directly by class, not via
* Modules\Core\Payment\Services\PaymentDriverRegistry — this endpoint is