#daviddd_code
1 messages ยท Page 1 of 1 (latest)
๐ 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/1340985114351636481
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Because when there is a trial there is no payment. Instead you want to get the pending_setup_intent field from the Subscription object
๐ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
I want to call create subscription to purchase a 7-day free trial SKU. The create subscription returns a client secret, and the client uses stripe.js to confirm the payment method.
when you start a subscription in trial period, there won't be any payment until the trial period has ended
to collect the payment method to be charged later for the first payment after the trial period, you need to use the pending_setup_intent's client_secret and confirm the setup on the front end
so you need to add both latest_invoice.payment_intent and pending_setup_intent to the expand
and based on whether the pending_setup_intent is null or not, you send the corresponding client_secret and type of confirmation (setup or payment) to the frontend to correctly collect the payment methods and confirm the SetupIntent or the PaymentIntent