#Chiko0401-subscriptions

1 messages ยท Page 1 of 1 (latest)

exotic mirage
#

๐Ÿ‘‹ happy to help

deft scaffold
#

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

exotic mirage
#

yes you can redirect your customer to this Customer Portal where they can manage their subscriptions and their payment methods

deft scaffold
#

I need it inside my website.

#

Without redirection. Using Stripe API ony

#

only

exotic mirage
#

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

deft scaffold
#

Yes, it's what I need

#

Now I need to add some features only, like as I said

exotic mirage
#

these are the API that you would need to use

deft scaffold
#

So, I need to retrieve client secret, then collect card details, then call SetupIntent and then detach Payment method, correct?

exotic mirage
#

yes this is another and valid way of doing it

deft scaffold
#

Ok. Thank you. What about to change subscription from monthly (X $) to yearly (Y $)?

#

Could you help with API?

deft scaffold
exotic mirage
#

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

deft scaffold
#

How do I retrieve client secret?

exotic mirage
#

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

deft scaffold
#

A lot of functions. Only to check with you if I understand correct. Let's say for change card details:

  1. Call 'SetupIntent' on backend and return client secret to frontend
  2. Collect card details on frontend and calls confirmCardSetup on frontend
  3. Change default customer payment
  4. Detach old customer payment
#

Correct?

exotic mirage
#
  1. Collect card details on frontend and calls confirmCardSetup on frontend
    Are you using Card Element?
#

Correct?
It seems so

deft scaffold
#

Yes, card element