quartet/payment-stripe-bundle
Quartet Payment Stripe Bundle integrates Stripe payment processing into Quartet-based PHP applications. It provides bundle configuration and service wiring to help developers add Stripe payments with less boilerplate, keeping payment setup organized within an existing Quartet project.
The bundle is a Symfony bundle, not a Laravel package — if you're working in a Laravel app, you'll be pulling in the underlying Stripe SDK and wiring it yourself, using this repo mainly as a reference for how Quartet structures payment flows. In a Symfony app, the setup is:
composer require quartet/payment-stripe-bundleconfig/bundles.php (Quartet\Bundle\PaymentStripeBundle\QuartetPaymentStripeBundle::class => ['all' => true]).STRIPE_PUBLIC_KEY, STRIPE_SECRET_KEY) — the bundle typically expects these under quartet_payment_stripe in config/packages/.The first use case to validate is a one-off PaymentIntent: create a charge for a fixed amount, confirm it, and inspect the returned status. This exercises the client wiring, config loading, and error handling in one pass before you touch anything more complex.
Look first at the bundle's DependencyInjection/ folder to understand what services and parameters it registers — that's the source of truth for what you can autowire. Then check the EventSubscriber/ or webhook handlers, which is where most of the real logic lives.
Gateway service injection. Rather than calling the Stripe SDK directly, resolve the bundle's payment service from the container. This keeps your controllers testable and lets you swap gateways if you later add PayPal or similar via Quartet's payment abstraction. Type-hint the service interface, not a concrete Stripe class.
PaymentIntent + client-side confirmation. Create the intent server-side, return the client_secret to the frontend, and confirm via Stripe.js. This is the standard pattern the bundle is designed around and keeps you out of PCI scope. Store the intent ID on your order model immediately so you can reconcile later.
Webhooks as the source of truth. Never trust the browser redirect for order fulfillment. Register a webhook endpoint, verify the signature with the bundle's webhook handler, and update order state in the payment_intent.succeeded, payment_intent.payment_failed, and charge.refunded handlers. Idempotency is essential — Stripe retries aggressively, so guard every handler against duplicate events (store the event ID).
Subscription flows. If you're doing recurring billing, prefer Stripe Checkout Sessions or the Billing Portal over building your own — the bundle exposes the underlying client so you can call these directly. Store stripe_customer_id and stripe_subscription_id against your user model and listen to customer.subscription.updated / .deleted for state sync.
Testing. Use Stripe's test-mode keys with the standard magic card numbers (4242… for success, 4000 0025 0000 3155 for 3DS). For webhook tests, use the Stripe CLI (stripe listen --forward-to) locally and assert against your handler subscribers.
Stripe\Client yourself; the bundle is only useful as architectural inspiration.composer why-not quartet/payment-stripe-bundle before adopting — it may be pinned to an old Symfony LTS or PHP version you've already moved past. Treat it as unmaintained until proven otherwise.api_version explicitly in your config and test against that version rather than letting Stripe default it.Request::getContent() returns it, but be careful if middleware reads the body first — the signature check will fail with a confusing error. Exclude the webhook route from any body-parsing middleware.1000 means $10.00. Currency must be a lowercase ISO code. This trips people up in every Stripe integration and this bundle doesn't abstract it away.%stripe_secret_key% — check Configuration.php in DependencyInjection/ for the exact tree name. If autowiring a gateway service fails, the bundle may use a factory that requires a manually named alias.quartet_payment_stripe.* events rather than forking.Stripe\Stripe::setLogger()) to your Monolog channel; the default is silent. Also enable setAppInfo() so failures are traceable in the Stripe dashboard.How can I help you explore Laravel packages today?