By Hanzalah Seikhai, Stripe developer. 3 December 2026
Stripe subscription payment failed: how to handle invoice.payment_failed without losing customers
A card expires, a bank declines a renewal, and the subscription quietly moves to past_due. If your app only listens for the first payment, it either keeps giving access for free or cuts off a customer who would have paid. This is the setup I use.
1. Turn on retries in the Dashboard
In the Billing settings, in the section for failed payments, turn on Smart Retries and the emails that ask the customer to update the card. Then choose what happens after the last retry: cancel the subscription or mark it unpaid. Most of the recovery work is done by these settings, not by your code.
2. Listen for the right events
invoice.payment_failed: a renewal failed. Show a banner and send the customer to update the card.invoice.paid: a renewal or a retry succeeded. Clear the banner and extend access.customer.subscription.updated: the status changed, for example topast_dueor back toactive.customer.subscription.deleted: retries ran out or the customer cancelled. Remove access.
3. Base access on the subscription status, not on one payment
Store the subscription status and the period end on your user. On Stripe API versions from 2025-03-31 the period end lives on the subscription item, on older versions on the subscription itself. Give access while the status is active or trialing. For past_due, decide on a grace period and keep access with a warning during it. Cut access on canceled or unpaid.
// Laravel example in a webhook handler
case 'customer.subscription.updated':
case 'customer.subscription.deleted':
$sub = $event->data->object;
User::where('stripe_customer_id', $sub->customer)->update([
'subscription_status' => $sub->status,
'current_period_end' => Carbon::createFromTimestamp(
$sub->items->data[0]->current_period_end ?? $sub->current_period_end
),
]);
break;
4. Let the customer fix the card in one click
Create a Customer Portal session and link to it from the banner. The customer updates the card, Stripe retries the open invoice, and invoice.paid brings the account back without anyone on your side doing anything.
5. Do not rebuild retries yourself
A cron job that charges the card again on its own fights with Stripe's retries and can charge twice. Let Stripe own the retry schedule and let your app react to the events.
Check it in test mode
Use a test clock, attach the test card that fails on renewal, advance the clock past the renewal date, and watch the events arrive in order. It is the only way to see a whole failed renewal in a few minutes instead of a month.
If you want this fixed or built in your app, see Stripe subscriptions in Laravel, hire me on Upwork, or get in touch.
Written by Hanzalah Seikhai, Stripe developer. Hire me on Upwork.