#dev-mantas_best-practices
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/1230493810031726629
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there!
When using Stripe Elements with PaymentIntent flow, from what I'm understanding we don't pass priceIds like in the Stipe Checkouts?
correct
If this is true doesn't that mean when a payment is made with Stripe Elements the payment fully relies on meta-data to know what product was purchased?
either the amount itself, or some metadata yes
Interesting so the product and PriceIds system is mainly to be used with Stripe Checkouts?
And then if you wanna do custom flows, should handle products on my own side mainly?
it's for Checkout Session, Payment Links, Subscriptions, and Invoices.
happy to help ๐
What would you recommend for this kind of flow?
When a user selects their products we take them to the checkout page,
If the user is logged in it would have prefilled email and would show that they are logged in(I'm not sure if stripe checkouts can provide this kind of functionality, apart from prefilling the email section),
Otherwise it would have a username and password field for them to create an account on the same page as the login form.
This is an example for what I'm trying to achieve.
https://we.learn.community/checkout/learn-community-membership
It seems like their using embedded checkout form? Or is this a subscription only flow/
if you create a Checkout Session with an existing customer ID, then yes the email will be prefilled: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-customer
https://docs.stripe.com/checkout/custom-checkout
I found this and I think it would be perfect for what I was already trying to do ๐ Sadly its in private beta.
๐
You can reach out to our Support team via https://support.stripe.com/contact/login to request early access to that beta
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
But what are you trying to do exactly?
https://we.learn.community/checkout/learn-community-membership
My client has asked me to build something similar to this.
When they are logged in they have a custom thing with the users icon and username, and got the "Already have an account, sign in" thing there.
I know I can prefill just the email as of now with the checkouts, but my client insists on keeping the usage of stripe products and priceIds, which is not possible for what I know with the Stripe Elements system.
Gotcha, yeah then the above seems like mostly what you want, however the closest thing right now that is GA would be using the Embedded Checkout form: https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=embedded-form
In this case though I would wait to actually render that until the login occurs for a new user (when you would create the Customer object and pass that to the Checkout Session), otherwise they will fill in the same info twice.
Yeah, but with this flow we'd lose the ability to see this in the /payments/
the checkout summary :/
I thought when creating a payment intent you only pass the amount and currency, without the priceId as a line item?
Did you read through the doc I linked?
You don't create PaymentIntents with that
You create and embed Checkout Sessions
Would it be possible to remove the email field from this form?
Otherwise I don't think it'll meet clients specification.
No that's not possible unfortunately
This is how'd they want it idealy.
Yep you can't have both things you want here. Just not possible
You should just build your own custom form and not use Products/Prices (and instead use metadata)
Yeah this is what I suggested to them...
That Custom Checkout builder thing is the only thing I can think of that comes close.
Gotcha well yeah you can reach out to Support and see if you can get added to the beta
Yeaah, they said fill in the email and wait for the specialized team to get to it.