lunarphp/stripe
Stripe payment integration for Lunar, the Laravel ecommerce platform. Connect Stripe to Lunar carts and orders to accept card payments, handle payment intents, and manage Stripe-backed transactions directly within your Laravel storefront. Ideal for adding Stripe checkout to Lunar-powered shops.
lunarphp/lunar install (matching major version) and a Stripe account with API keys already in hand. Add it with composer require lunarphp/stripe.STRIPE_KEY, STRIPE_SECRET, and STRIPE_WEBHOOK_SECRET in .env. Mirror the key pair (publishable/secret, test/live) so your local and staging environments never share live credentials.config/lunar/payments.php) so your checkout flow resolves the stripe driver. If you only have one payment type, this is a one-line change; otherwise wire it per payment type.src/ end-to-end before touching the config — it's the contract Lunar expects (intent creation, confirmation, refund entry points). Then read the webhook route/controller, because almost every non-trivial Stripe bug you'll hit is a webhook-ordering or signature issue.payment_intent.succeeded webhook (or the driver's equivalent). Idempotently update Lunar's payment state from the webhook handler.requires_capture from succeeded.stripe listen --forward-to .../webhooks/stripe) during development so you never wait on production webhooks to see state transitions. Use Stripe's standard test cards (4242…, 4000 0025… for 3DS, 4000 0000 0000 9995 for declines) to exercise each branch.lunarphp/lunar. Don't fork it expecting merges — patch Lunar upstream or subclass the driver locally.lunarphp/stripe on the same major as lunarphp/lunar. A minor-version skew can change driver method signatures and break checkout silently at the intent-creation step.STRIPE_WEBHOOK_SECRET is missing or stale (e.g., after recreating a CLI endpoint), verification throws inside the controller and Stripe retries — which looks like duplicate events rather than a config error. Log the raw payload and signature before verifying while debugging.localhost directly; use the CLI forwarder, and make sure the forwarded path matches the route this package registers. If you've customized the webhook route, update both the CLI command and the dashboard endpoint.card_declined, authentication_required). Catch and translate these into Lunar payment failure states with a human-readable message — don't dump the raw exception into a customer-facing checkout page.STRIPE_SECRET pointing at live keys during a test run is the classic way to move real money in dev. Gate test-mode assertions on the key prefix (sk_test_) and fail fast at boot if it doesn't match the environment.How can I help you explore Laravel packages today?