#Chiko0401-subscriptions
1 messages ยท Page 1 of 1 (latest)
๐ happy to help
is the Customer Portal a fit for you? https://stripe.com/docs/billing/subscriptions/integrating-customer-portal
Could you explain more briefly?
I use Stripe API from my website (I don't use the Stripe Checkout page)
I used PaymentIntent with subscriptions API
So, now I have an another feature - change a card
and change subscription
yes you can redirect your customer to this Customer Portal where they can manage their subscriptions and their payment methods
in that case you will have to do a lot of development to achieve the same result but I could help guide you through it
Yes, it's what I need
I have already done with it - https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements&card-or-payment-element=card-element#create-subscription
Now I need to add some features only, like as I said
to update the subscription https://stripe.com/docs/api/subscriptions/update
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
to add payment method to customer https://stripe.com/docs/api/payment_methods/attach
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
to remove payment method from user https://stripe.com/docs/api/payment_methods/detach
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
these are the API that you would need to use
So, I need to retrieve client secret, then collect card details, then call SetupIntent and then detach Payment method, correct?
yes this is another and valid way of doing it
Ok. Thank you. What about to change subscription from monthly (X $) to yearly (Y $)?
Could you help with API?
How can I get client secret for existing user?
you need to create a new SetupIntent and pass the client secret to the front end
What about to change subscription from monthly (X $) to yearly (Y $)?
you need to update the price with a yearly price instead of monthly
How do I retrieve client secret?
You create a new SetupIntent in the backend https://stripe.com/docs/api/setup_intents/create and you send to the front end the client_secret field on that SetupIntent object https://stripe.com/docs/api/setup_intents/object#setup_intent_object-client_secret
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
A lot of functions. Only to check with you if I understand correct. Let's say for change card details:
- Call 'SetupIntent' on backend and return client secret to frontend
- Collect card details on frontend and calls confirmCardSetup on frontend
- Change default customer payment
- Detach old customer payment
Correct?
- Collect card details on frontend and calls confirmCardSetup on frontend
Are you using Card Element?
Correct?
It seems so
Yes, card element