#ahemadabbas-d_docs
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1313442510336561183
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi! have you considered passing an existing Customer object cus_xxx when creating the CheckoutSession, then?
No, i dont want to pass
then what do you want? A Subscription requires the existence of a Customer object.
Because i have no information of the customer until the checkout is completed
I'm totally lost, sorry.
if you use mode:subscription we will create a Customer object automatically for you as part of the Checkout process. Otherwise, you can pass an existing Customer object if you already have one.
Example:-
xyz@gmail.com makes a checkout for the subscription
Stripe creates a new customer
now again
xyz@gmail.com make a checkout for the other subscription
Still stripes create a new customer
Instead of it i want to attach the subscription to that existing customer
Just like payment mode
then you need to build something in your website that authenticates the user, for example they log into an account before they can pay, and in your user database you store the ID cus_xxx of their existing Customer. And then you can pass that existing ID when creating a CheckoutSession for the logged-in user.
or even better, don't use Checkout at all for the existing user and instead redirect them to the customer portal to edit their existing Subscription. https://docs.stripe.com/customer-management/portal-deep-links
Right, but i want a single page checkout so the stripe element is mounted from the start
Without any pre details
makes sense but there isn't really a solution like that; if you want to avoid something like this then you will need some user authentication.
So summarizing stripe can't attach the customer from the email in subscription mode like payment mode when checkout session is completed
I'm not aware of what functionality you're talking about in mode:payment that works differently, I'm not aware of anything like that.
Example of payment mode:-
xyz@gmail.com makes a checkout for the payment mode
Stripe checks from the email if a customer is already existed if yes then attach the payment to it otherwise create new
While in subscription mode customer are always newly created
Stripe checks from the email if a customer is already existed if yes then attach the payment to it otherwise create new
that's what I mean, I don't think we do that.
Well i have tested both the scenario and i can confirm it
fair enough! I think there's confusion and you're thinking of https://docs.stripe.com/payments/checkout/guest-customers , which is not quite the same thing.
either way, for subscriptions(and mode:payment where you're using customer_creation:"always" ) , you need to build your own authentication layer for your use case.
I'm not using customer_creation:"always"
And i know about guest customers and yes those are different things
I know you're probably not, I was just giving a complete answer. It's relevant because mode:subscription always uses customer_creation:"always" implicitly.
fair enough if you believe we have a feature like this which is automatically de-duping customers and so on, I can't say much without seeing an example of what you're talking about. Like I said, for Subscriptions nothing like that exists really and you need your own authentication layer.
How can i show you the example?
maybe an example cus_xxx Customer ID where you say we detected that Customer existed already and attached a new payment intiated via Checkout to that customer instead of creating a new one?
Okay, please wait