#lkjhgfdsa
1 messages · Page 1 of 1 (latest)
When a person comes to our subscription screen before they have decided to start the subscription they are presented with with Payment Form, to display the payment form I had to create a setupIntent.
But the user could view that page once and then not return to enter their details for weeks.
Currently when the setupIntent is created I'm storing the ID so the next time they come to the form I'm not creating multiple setupIntents.
This is working without any issue, but I'm worried about how long is "long-lived" as stated in the docuemention...
Specifically how long after creating a setupIntent should I be creating a new one if they user did not enter their payment details?
Can you share the doc link where you see this line, "Do not maintain long-lived, unconfirmed SetupIntents as they may no longer be valid."?
I learned that SetupIntents are short-lived objects. They should be created as they are used, and not persisted.
So from Stripes point of view is it fine if I create a new setupIntent every time the page loads? And if so do I need to worry about cancelling setupIntents if they are not used or they will become invalid on their own?
If SetupIntent is created from Subscription, SetupIntent will be valid until its status becomes incomplete_expired or canceled.
Where do I see the docs for creating a setupIntent from a Subscription?
@crisp musk
If you create a subscription, it'll return:
- PaymentIntent if the subscription has amount due (https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements)
- SetupIntent if the subscription has no amount due or in trial (https://stripe.com/docs/billing/subscriptions/trials)