#yase_best-practices
1 messages · Page 1 of 1 (latest)
👋 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/1364726552021176433
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Ideally, I’d like to avoid extra event handling logic and just sync my DB with the subscription object’s status. Is there a way to achieve this, or is manual intervention required? For reference, I’m following a setup similar to Theo’s: https://github.com/t3dotgg/stripe-recommendations
Hi! I'm not really familiar with Theo's stuff to be honest. From what I can tell (and from what I know) you'll have to do the subscription re-enablement step in your app, and ideally using Events, since that doesn't rely on the user returning to your app after finishing setup.
Right, I see. Thanks for the quick reply
Of course. Does that all make sense?
Yeah for the most part. I'm still struggling with how to apply this to my specific application, but I think it just requires a bit more thinking. It would be really convenient (for my use case) if the subscription automatically resumed after the customer provided their payment details, but I'm sure there are other reasons why this isn't the case.
Definitely hear you. There are so many possible use cases here, so we try to provide the pieces necessary to build them all, which means some of them require extra steps.
In this case, I think you need to listen for the setup_intent.succeeded event and make the change in that handler.
There are actually a fairly wide range of events related to subscriptions you may also want to listen to/for: https://docs.stripe.com/billing/subscriptions/webhooks#events