#pedro-reis_api

1 messages ¡ Page 1 of 1 (latest)

silver forgeBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1309559575363715113

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

karmic dove
#

Why not just end the trial early?

#

That will create the first paid invoice for the sub

#

And you can use its client secret

nova vector
#

I was doing that, however the subscription was getting cancelled immediately because the user doesn't have a payment method

nova vector
#

currentl I have the following when adding the subscription to the user:

trial_settings: {
end_behavior: {
missing_payment_method: 'cancel',
},
},

#

so if the user doesn't add their payment details I want the subscription to cancel at the end of the trial period

#

but when I try to add a payment method, the subscription get cancelled right away

karmic dove
#

but when I try to add a payment method, the subscription get cancelled right away
What do you mean by this

#

You should be able to collect payment method first

#

Then end trial early

#

And subscription should not cancel

nova vector
#

that's the issue I'm having: I'm trying to figure out the flow for this

#

I'm using the PaymentElement from Stripe Elements on the frontend

karmic dove
#

To collect payment method

#

Before trial ends

nova vector
#

then how should my Elements options be? which mode should I use? setup?

#

and then stripe.confirmSetup()?

#

i believe this - pending_setup_intent - is an id?

#

sorry, I've read a lot of documentation but the more I read, the more lost I am

karmic dove
#

pending_setup_intent is a setup intent id

#

You need to retrieve it to get its client secret

nova vector
#

ok, that makes sense

karmic dove
#

For how to collect details with elements

#

via setupintent

nova vector
#

ok, I will try that! thank you very much

karmic dove
#

No problem