#oranges13_code
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1251188005763551253
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- oranges13_code, 2 days ago, 24 messages
- oranges13_code, 6 days ago, 12 messages
Hey there! We finally got this flow working ๐ but my problem now is that if there's a failed payment I get multiple subscriptions for the customer โ ๏ธ
Due to where the subscription is created in the flow.. is there a best practice here? Is it ok if the subscriptions are just left ot expire or should I actively be removing them or attempting to pass that value back to retry?
Hi there ๐ if a payment fails your recovery flow should try to reuse the same client secret it did before, rather than creating a new Subscription.
It's fine to leave them to expire if that fits your flows.
OK so in error state, pass back the secret to retry?
Ah, sorry, overlooked that you're doing server-side confirmation
I sort of got it working with createPaymentMethod to simulate the way we currently do it, but apparently that can cause renewal issues, and I believe we are definitely seeing that when our customers renew the next year
Yeah ๐ซ We don't necessarily have to do server side but I'm tyring to modify the code as little as possible.
There's a lot of other logic going on around the subscription creation
Gotcha, and totally get that, just needed to reorient myself a bit ๐
So this is the step that normally creates a Subscription when a Customer goes through your flow.
https://docs.stripe.com/payments/finalize-payments-on-the-server?platform=web&type=subscription#create-and-submit-payment
When trying to process a payment again because the initial payment failed, you can use that same flow to create a new Subscription, but you can also reuse the existing Subscription's first Invoice's Payment Intent to try another confirmation.
You would need to either track the ID of the Subscription, or the ID of it's first Payment Intent, but then you can make another request to confirm that existing payment intent.
OK, thank you. I just wanted to get some confirmation on best practices.