#harolold
1 messages · Page 1 of 1 (latest)
Are you following this guide to get set up?
https://stripe.com/docs/payments/save-and-reuse?platform=web&ui=elements
If so, what step are you stuck on? What error are you getting?
Sounds like your client secret might be null or undefined. I would recommend creating console logs (e.g. console.log()); at each step of the process that uses the clientSecret and client_secret variables to see where it is working and where it isn't.
so do I have to make a subscription separately for the customer
and add their setupintent to the subscription
?
There are Subscription objects and there are Customer objects. They're separate objects that interact together.
Not sure if that answers your question though
The Setup Intent is used to setup a Payment Method for recurring payments
aren't subscriptions recurring payments?
Yep. That's why Setup Intents are used with Subscriptions
so following the subscription guide I should change step 5 to use a setup intent instead of payment intent? https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements#collect-payment
It depends. If you follow that guide step by step, you can use a Payment Intent to setup the Payment Method for future usage instead. That requires you to create a Payment within the workflow though. If you wanted to create the Payment Method and set it up for future usage without charging it, then you would use Setup Intents or simply accept the Payment Method credentials without either a Setup Intent or Payment Intent (which is mentioned here:https://stripe.com/docs/payments/accept-a-payment-deferred?type=subscription)
There are a lot of ways to setup subscriptions, so it's worth being specific about exactly how you want the workflow to work
I want to collect the payment info and not charge them for the first time because of a 14 day free trial
what would be best for that
Do you want to still collect Payment Method details and set them up for payment? Or do you want to wait until the end of the trial to do that?
at the beginning
In that case, you could follow along with this guide (https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements) and include a trial_end parameter when you create the Subscription during step 4. Here's more on trials that might give you some good context: https://stripe.com/docs/billing/subscriptions/trials