#xPaghkman
1 messages · Page 1 of 1 (latest)
Stripe Checkout
Okay, so you would need to provide a Customer ID when the Checkout Session is created: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer
Usually people will cache this data in their local database so that when the customer navigates to Checkout, you already have it handy and can pass it in to the created Checkout Session. This also prefills the customer info.
@sweet swan I think with this way, I cannot use pricing table right ?
The best side of using pricing table is it is perfect and no need code maintenance for that part.
Is there any way that I can use pricing table and avoid multiple customer creation ?
It doesn't look like it unfortunately
I tested all the methods I could think of on my end, and it looks like it always creates a new customer
I think then, only option left is I need to show my custom UI pricing table and build it.
But is there any endpoint that I can kinda fetch existing pricing table data and at least quickly try to show it with my own ui?
— or maybe I can tell about my own flow so maybe you can suggest something else
So the Pricing Table is kind of intended to be the lowest complexity option for that. Building your own increases the complexity a lot, so it might be worth looking at our docs on building a custom subscription flow and then coming back with questions (if you decide to go that route): https://stripe.com/docs/billing/subscriptions/build-subscriptions
@sweet swan — So as I read, I think I can do like, have my own custom pricing table and when user selects something from my custom pricing table, I will create a session with the stripe customer id, and use the checkout url for that session. And with this way there will be no new customer right ?
Hi, taking over as two-shoes had to step away. Let me catch up
Yes, that is correct. If you do not want to create a new customer, then you'd pass the customer id on the Checkout Creation: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer.