#mckeemi
1 messages · Page 1 of 1 (latest)
Why are you using a setupintent prior to creating the subscription?
Generally that's an unnecessary step
You could just create the subscription first and accept payment on that
Because some some subscriptions do not take the payment straight away but are on trial and the payment is taken in the future
If I create a subscription using paymentintents will the first payment be taken straight away or will it wait till TrialEndDate?
Yes but there's still no need to create a setupintent. When a subscription has a trial attached to it, a setupintent will be automatically created for you, which you can find here: https://stripe.com/docs/api/subscriptions/object#subscription_object-pending_setup_intent
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Then just use that setupintent to collect payment info
Sorry I'm not sure what you mean, the user chooses to buy a subscription/payment plan enters the card details and creates a setup intent, when we get the setupintent succeeded webhook we then create the subscription using the setup intent payment method etc ... Is this not the correct flow?
Yeah that's not the correct flow
You'd want to create the subscription object, then collect payment
And if you have a trial, use the pending_setup_intent instead of the invoice.payment_intent client secret to initialize elements
Thank you so much I will re-arrange the flow and see if that works, appreciate the help thanks