#geferon_code
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/1400199787063541903
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there
Hi!
Yeah so for your Price you want to use custom_unit_amount: https://docs.stripe.com/api/prices/create#create_price-custom_unit_amount
Oh great so there is a way! Only that it's serverside but that's not a problem
I was confused since in this page
https://docs.stripe.com/payments/checkout/pay-what-you-want?payment-ui=embedded-components
It just straight up says that they're not supported when using Elements, and knowing how customizable stripe is I was thinking surely there must be a way of doing it
Oh oh
I missed above you said you were using Embedded components.
Sorry, yeah no custom_unit_amount Prices aren't yet supported with Embedded Components.
So in this case you would want to allow your customer to input the amount and then you would generate a Price for that amount and render Payment Element (with Embedded Components) after that.
You can use price_data to create that Price inline when you create the Checkout Session
Ah I see, and there is no way of doing this on the go during checkout instead of whenever creating the checkout session?
Or is there perhaps a better way of doing this that I'm not aware of? Because maybe I'm just overcomplicating it
If you want to use Embedded Components then no there isn't really a better way than what I just described.
If you don't use Embedded Components -- you either use the Stripe-hosted page or the Embedded form, or you use a custom integration (https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=payment) then you can do this during the checkout flow as your Customer designates the amount.
Ah fair, yeah I guess that would be easier
The difference here though is that the products aren't managed through stripe, but only the payment no?
You mean with the custom integration?
Yeah
Yeah you don't use Products/Prices but you can always set metadata on the PaymentIntent to indicate your own product that was associated.
Just depends on how you want to set it up.
Okay, good to know, thanks for the help! ๐
Sure thing!
Also, one last thing, you said yet, does that mean that they might be supported on the future or is that uncertain?
We hope to bring Embedded Components to parity with our other Checkout flows, yes. But unfortunately I don't have a timeline for when custom_unit_amount might be supported.
Good to know ๐ Thanks for the help nonetheless โค๏ธ