#dev-mantas_best-practices

1 messages ยท Page 1 of 1 (latest)

minor thistleBOT
#

๐Ÿ‘‹ 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.

wind harnessBOT
fiery wolf
#

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

wide plinth
#

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?

fiery wolf
#

it's for Checkout Session, Payment Links, Subscriptions, and Invoices.

wide plinth
#

Alright, that makes a lot more sense now ๐Ÿ˜„

#

Thank you so much for you help.

fiery wolf
#

happy to help ๐Ÿ™‚

wide plinth
#

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/

fiery wolf
wind harnessBOT
wide plinth
plain pollen
#

๐Ÿ‘‹

#

You can reach out to our Support team via https://support.stripe.com/contact/login to request early access to that beta

#

But what are you trying to do exactly?

wide plinth
#

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.

plain pollen
#

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.

wide plinth
#

Yeah, but with this flow we'd lose the ability to see this in the /payments/

#

the checkout summary :/

plain pollen
#

Why?

#

That flow still uses Stripe Checkout

wide plinth
#

I thought when creating a payment intent you only pass the amount and currency, without the priceId as a line item?

plain pollen
#

Did you read through the doc I linked?

#

You don't create PaymentIntents with that

#

You create and embed Checkout Sessions

wide plinth
#

When I click on the "Custom flow" tab it has this

plain pollen
#

I didn't link the custom flow tab ๐Ÿ˜…

#

I linked the embedded flow

wide plinth
#

Would it be possible to remove the email field from this form?

#

Otherwise I don't think it'll meet clients specification.

plain pollen
#

No that's not possible unfortunately

wide plinth
#

This is how'd they want it idealy.

plain pollen
#

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)

wide plinth
#

That Custom Checkout builder thing is the only thing I can think of that comes close.

plain pollen
#

Gotcha well yeah you can reach out to Support and see if you can get added to the beta

wide plinth
#

Yeaah, they said fill in the email and wait for the specialized team to get to it.