#Th3FalleN
1 messages ยท Page 1 of 1 (latest)
example of the dialog (still obviously in heavy development https://p181.p1.n0.cdn.getcloudapp.com/items/JruympJD/f7a07dca-d931-442c-9322-cefff64519a4.jpg?v=1cd23da714565a69018cb3ea56329a28
atm we are creating a new subscription with the payment behavior above but that results in the customer having a TON of incomplete subscriptions, payments, invoices which is less than ideal
Hi ๐
So what is the end result you are looking for?
im more so just seeking what is the "preferred" way get the clientSecret elements needs for this type of checkout, assuming in this case that the customer in question has an active subscription with no payment methods (trial)
the reason i didnt initially go with a payment intent is the amount could still change at this point (on the right side)
Wait a sec, so the customer is already signed up for a Subscription but since they have a free trial period you have not collected payment information?
correct
i guess my root question is for multi product subscriptions what is the "correct" way to get the paymentIntent or setupIntent that your react elements requires
That still depends a lot on what your flow looks like.
For instance, you could collect payment method info at the start of the trial by using the subscription.pending_setup_intent.client_secret
This property is populated when you create a Subscription with a free trial
ah and i could reference that to complete payment info for that
that sounds more like what i want, i was creating a subscription and returning latest_invoice.payment_intent.clientSecret like one of your examples showed
Yeah and that approach works great if you are starting the billing cycle right away (no trial)
is there a better way to get the billing information for a subscription than expanding the customer.invoice_settings.default_payment_method field?
the docs say it bubbles up but it's null at the top in the subscriptions default_payment_method
The subscription.default_payment_method property is used to define a specific default PM for that subscription. If it's null then the default for the Customer is what will apply. So getting it from the Customer is still the recommended approach
๐ thanks so much!
Happy to help ๐
so in this flow say a user has a subscription with billing information already on it, and i want to update the subscription items but still let them update their billing info if they choose to, would that setup intent still exist on the subscription that i could use or would i need to create a new one?
If you had previously used the Setup Intent then that Intent would be consumed. In that case you could create a new Setup Intent and use it to update the Customer's default payment method or the default payment method on the Subscription object itself.
๐ stepping in as Snufkin needs to step away
and i'd do that just with the setup_intents endpoint providing the customer id, gotcha
๐ thanks again Snufkin
Yep
๐ i think for once i know what i need to do ๐
do setup intents expire? or do i manually need to be sure to cancel them?
They don't expire
You can cancel them if you want, but you can also just leave them be as long as you aren't surfacing the client_secret anywhere
sweeeeet
and one last question, if there is already an existing setupintent and i try to create another for a customer is that an issue?
this discord is literally a life saver