#Th3FalleN

1 messages ยท Page 1 of 1 (latest)

fair socketBOT
urban urchin
#

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

rancid canopy
#

Hi ๐Ÿ‘‹

So what is the end result you are looking for?

urban urchin
#

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)

rancid canopy
#

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?

urban urchin
#

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

rancid canopy
#

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

urban urchin
#

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

rancid canopy
#

Yeah and that approach works great if you are starting the billing cycle right away (no trial)

urban urchin
#

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

rancid canopy
#

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

urban urchin
#

๐Ÿ‘ thanks so much!

rancid canopy
#

Happy to help ๐Ÿ™‚

urban urchin
rancid canopy
#

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.

timber condor
#

๐Ÿ‘‹ stepping in as Snufkin needs to step away

urban urchin
#

and i'd do that just with the setup_intents endpoint providing the customer id, gotcha

#

๐Ÿ‘‹ thanks again Snufkin

timber condor
#

Yep

urban urchin
#

๐Ÿ‘ 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?

timber condor
#

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

urban urchin
#

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?

timber condor
#

Nope

#

That's fine

urban urchin
#

this discord is literally a life saver