#thomas_subscription_recovery

1 messages ยท Page 1 of 1 (latest)

small ivyBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question. Thank you for your patience!

โฑ๏ธ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime! If this thread is closed and you have another question you'll need to start a new thread.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1212878300209483817

๐Ÿ“ Have more to share? You can add more detail below, including code, screenshots, videos, etc.

weak matrixBOT
tawny citrus
#

Hi there! By "udpate their card in their dashboard", are you referring to the Customer Portal or something else?

tawny ibex
#

Hi,
I do not use the Customer Portal from Stripe, it is homemade using the API, but the result is the same. I correctly receive the new payement method for that user in my stripe dashboard

#

Here is a client in this case : cus_LlHQxVOL4iWes4

#

Payment error on the 28 at 14:26 and card update on the 29 at 15h49

tawny citrus
#

Ah, I see. You're creating a Checkout Session in setup mode to collect new card details from the customer.

tawny ibex
#

Yes, subscription is set as past_due, but I cut the customer access to my website in this case

#

And it will be automatically restored if a new payement suceed

tawny citrus
#

I see you're already setting the new PM as both the customer's default for invoices and setting it as the default on the subscription directly

tawny ibex
#

Yes, I would like to manually make a call to pay the invoice, as the customer is expected to have his acess to the website back after he updated his credit card

tawny citrus
#

So making a call to /pay the invoice should trigger a payment attempt using the newly-collected PM

tawny ibex
#

Ok thank you. What is the best way to get the id of the unpaid invoice for that customer ?

tawny citrus
#

You'll likely have already stored the ID of the Subscription's latest invoice (from webhooks) so you can make a call to pay that Invoice, which should move the Subscription to active

tawny ibex
#

Ok perfect, I think I will manage it from here, thank you very much ๐Ÿ™‚

tawny citrus
#

I see you're listening for invoice.payment_failed events so you can retrieve it from there, or from the customer.subscription.updated event

#

Sure thing!

tawny ibex
#

Even better, thanks ๐Ÿ™‚

weak matrixBOT
#

subscription_recovery