#rene_best-practices

1 messages ยท Page 1 of 1 (latest)

topaz trailBOT
#

๐Ÿ‘‹ 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.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— 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/1476864188499628113

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

azure dove
#

๐Ÿ‘‹ happy to help

#

you need to listen to invoice.paid event and only then update your DB

quaint ledge
#

Thanks, I already update my DB only on invoice.paid.

The core issue is that Klarna does not support payment_behavior=pending_if_incomplete.

When I call subscriptions->update() to upgrade the plan, Stripe immediately updates the subscription items, even though the Klarna payment is still pending. If the user closes the Klarna window, the invoice remains incomplete and gets canceled ~23h later.

During that time:
Stripe subscription = upgraded plan
My DB = original plan

Since pending_if_incomplete is not supported for Klarna, what is the correct pattern for subscription upgrades with asynchronous methods like Klarna?

topaz trailBOT
azure dove
#

once you update the subscription it will generate an invoice that will be automatically paid using the customer credits

quaint ledge
#

Ok, thank you. I will try

azure dove
#

let me know if you need any more help