#kado-kaelan-subs
1 messages · Page 1 of 1 (latest)
You can check if a Customer has any subscriptions by passing in the ID to customer and using our List Subscriptions endpoint (see https://stripe.com/docs/api/subscriptions/list#list_subscriptions-customer)
gotcha, then from there, if they do have a subscription, how would i get the clientSecret?
A Subscription does not have a client secret so it doesn't really make sense that way. Are you asking about the PaymentIntent's client secret? What's the context of your ask?
so im creating a subscription, then confirming the the card setup
but confirmCardSetup requires clientSecret
I understand createSubscription returns pending_setup_intent.client_secret
but my issue is what if a user signs up, creates a subscription then say, for example, they type in wrong card number. the subscription is created already
so If they try to retype the card number in that session (or come back) I would want to use the same clientSecret as the subscription they previously created
then you get the client secret the same way you would have on creation really
the client secret is inside the SetupIntent in pending_setup_intent which you need to expand like you do on creation
so retrieving the subscription object would have that pending_setup_intent?
okay. So I would check if customer has subscriptions, retrieve subscription with that subscriptionId, then get clientSecret from retrieved subscription object
thanks!
honestly you really should track this in your database instead
seems quite inefficient to make all those API requests
thats what i was thinking
okay I'll do that instead
wasn't sure what id's were a no-go to store
you can store everything from our API
gotcha thanks for the help!
Sure thing!