#BilalSaeedAlam
1 messages · Page 1 of 1 (latest)
👋 Hi there, Happy to help!
Basically i am using this document for future payment with card.
https://stripe.com/docs/payments/save-and-reuse?platform=web&ui=checkout#create-checkout-session
So i want to ask one thing, if there is no user means customer id we have already then from frontend we will pass name and email and then first create customer and pass that customer id to setup intent?
?
You should passing the CustomerId if you are creating a Checkout Session for setup mode.
Or you can configure the Checkout Session to create one customer_creation: always
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer_creation
Yep that's why i am asking should i take input from user like email and name and then pass these params to backend to create customer if there is no customer id?
No i thinks that's not a good option to create everytime a new customer id for same user?
??
Hey man where di you go?
Sorry it's quiet busy, I'm monitoring your thread, please be mindfull
ALright
Yes ideally in your backend you create a customer only if necessary
and pass that Stripe CustomerId into your checkout session
Perfect and on which step it will take card info from user?
And just last thing like if we have users in our database and one of them is creating payment method, in which is passing email and name for creating customer. So if he delete is payment method and want to add new one, so should we need to create new customer with new email or we can use old one?
Perfect and on which step it will take card info from user?
Not sure I'm following here. Once the Checkout session is completed, a payment_method will be created and attached to the customer.
You should be using the same Stripe Customer object.
Alright it means no need to update customer object if he changes his name or email
?
You can update it via Stripe API https://stripe.com/docs/api/customers/update
And keep using the same customerId for your Stripe Checkout Sessions
Happy to help!
Have a good day
Thanks you too!