#soumya
1 messages ยท Page 1 of 1 (latest)
Hi if the user is new and he is doing the subscription first time how will he be able to add a card ? because add-card needs client secret key which is generated via subscription api can some once help me here
Hello
Hello ๐
We have a doc here that covers it in detail
https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
If first time the customer needs to do subscription am calling subscription api but tht gives this error
without calling subscription api client secret key is not retrived which is used to add card
Did you read the doc I shared?
how can we proceed?
Please read the doc I shared. It covers everything you need
Yes we have read
and lots of queries
using this as well
payment_settings: { save_default_payment_method: 'on_subscription' }
which means which ever card we add it will be the defualt one right
Can you share the request ID where you're seeing the error?
You are not setting a payment_behavior when making the API request
https://dashboard.stripe.com/test/logs/req_8WpYOKCldzqTue
You clearly didn't read/follow the docs, this step explains what you need
https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements#create-subscription
I'd highly recommend reading and following the docs thoroughly first.
If u can see the request am passing the Setting save_default_payment_method to on_subscription to save the payment method as per docs
Hence payment_behavior=default_incomplete will be completed from Frontend payment sheet?
and is this required to be set for subscriptoon with trail data?
Not sure what you mean by that, can you elaborate? Have you tested what the docs are explaining first?
payment_behavior=default_incomplete shd we pass this while calling subscription api with trail period
That parameter is more relevant to subscriptions without trials as far as I know. The API reference explains what each of those settings do https://stripe.com/docs/api/subscriptions/create#create_subscription-payment_behavior
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Basically, you can tell a subscription to start in an incomplete state if it requires an immediate payment but no payment method is provided. Trialing subscriptions should go in to a trialing status though so I don't think it is as relevant.
I would reccommend testing this with a test clock to see if the subscription behaves how you want once the trial ends
I just want to create subscription with no payment menthod pass client secret key to FE and they will add card