Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Marcolino922's avatar

Failed payments and unpaid invoices

Hi, I looked in the Laravel guides and directly on Stripe, but I have this doubt that I will try to explain better.

INTRODUCTION: Assuming that a customer already has an active subscription. But the moment of renewal arrives and the same customer has no funds on the card, so the renewal will try new attempts to pay the invoice, leaving it "open".

Now, the same customer decides to buy a new subscription, paying for it and then active.

My doubt, which I have not found anything about, when the pending invoice will be automatically paid (the customer now has funds on the card), what happens?

Shouldn't pending invoices be automatically canceled if the customer starts a new subscription? If so, how to fix this behavior?

0 likes
5 replies
martinbean's avatar

Now, the same customer decides to buy a new subscription, paying for it and then active.

@marcolino922 Then the customer has two subscriptions.

Shouldn't pending invoices be automatically canceled if the customer starts a new subscription? If so, how to fix this behavior?

No. Why should it? Stripe just handles subscriptions and capturing payments. If you’ve created two subscriptions for a customer, then that customer has two subscriptions. If a customer should only have one active subscription in your application, then that‘s your business logic; not Stripe’s.

Marcolino922's avatar

In that case the customer has not paid an invoice (previously pending due to lack of funds) in vain? It is precisely because he has decided to buy a new subscription.

He will pay that bill without having used the subscription.

Should I therefore block new subscriptions if a customer has open invoices?

martinbean's avatar

@marcolino922 If a user should only have one invoice then yes, don’t let them create a new subscription.

If a payment can’t be taken for say, my Netflix subscription, Netflix won’t allow me to create a new subscription until my old one is cancelled.

Marcolino922's avatar

In the logic of my code there is already a restriction that if the customer already has an active subscription, he cannot create a new subscription.

Unfortunately, however, what happened was that once the customer's subscription had to renew, Stripe made several attempts (keeping the subscription active) until it stopped saying to try again next week and canceling the subscription of the customer.

In this way the customer has an expired subscription and can create a new subscription, but he has a pending invoice that will be paid automatically ... but as I said, the customer has in the meantime purchased a new subscription being free to do so.

I would like to resolve in two ways, either to have the customer resume that suspended invoice (thus saying that he cannot create a new subscription if he already has a pending invoice to renew an old subscription), or to allow him at that point to create a new subscription but rightly cancel that recurring invoice that becomes superfluous.

(I apologize for rewriting everything, but it's right to make my scenario better understood)

martinbean's avatar

@marcolino922 Again, I suggest you read Stripe’s documentation on the subscription lifecycle: https://stripe.com/docs/billing/subscriptions/overview#subscription-lifecycle

You should not let a customer create a new subscription if Stripe is still trying to take a payment for an existing one. The subscription is has not been cancelled yet if Stripe is still trying to take a payment for an invoice!

Stripe will send you a webhook when a subscription is ended (either because the customer cancelled the subscription, or Stripe couldn’t take the money for an unpaid invoice).

Please or to participate in this conversation.