#aabhaskarma_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/1303683459100971018
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- aabhaskarma_code, 1 hour ago, 33 messages
hi! that's just how it works. If you don't want the subscription to be created without the SetupIntent succeeding, you'd have to create and use a separate SetupIntent and use that first and create the Subscription after it succeeds.
Are there any side effects creating separate setupintent and confirming it before creating subscription?
nothing is coming to mind right now
OK
Is it safe to call confirmSetup on free trial starting condition before creating subscription in stripe
ChatGPT said:
ChatGPT
No, calling confirmSetup before creating the subscription in Stripe is not recommended for free trials. Here’s why:
confirmSetup Purpose: The confirmSetup method is typically used to confirm a PaymentMethod setup with the intention of using it for future payments. If you run this without a corresponding Subscription or SetupIntent created on the backend, Stripe may not properly link the PaymentMethod to the Subscription, which can lead to issues later on.
Subscription Setup Process: For a free trial, it’s standard to first create the Subscription on the backend. Even though the initial period has no payment, Stripe still expects a PaymentMethod to be attached for when the trial period ends.
Order of Operations:
First, create the Subscription (which will include the trial period).
Then, use confirmSetup on the client side to set up the PaymentMethod for future payments. This ensures that Stripe links the PaymentMethod with the correct Subscription and applies it once the trial ends.
By following this order, you ensure that Stripe has the necessary context for managing the PaymentMethod and Subscription.
Go this from GPT
Got this from GPT
and?
If you run this without a corresponding Subscription or SetupIntent created on the backend, Stripe may not properly link the PaymentMethod to the Subscription, which can lead to issues later on.
correct
you would notice that when you develop and test your solution and you'd fix it(set default_payment_method on the Customer/Subscription to the PaymentMethod from the SetupIntent).
const updateStripeCustomer = await stripe.customers.update(
req.body.customerId,
{
"invoice_settings": {
"custom_fields": null,
"default_payment_method": req.body.payment_method,
"footer": null,
"rendering_options": null
},
...
something like this?
"default_payment_method": req.body.payment_method,
try it and test mode and see
I will. Thanks. 🙂