#B33fb0n3
1 messages ยท Page 1 of 1 (latest)
What is a 'custom order'? What data do you need to track/store?
I custom order contains the basic item and you can order extras to it. For example an ice: you can define what size the ice cream should have (thats the basic product). Then you can choose if you want sprinkles with it, for example. Or you want to have sauce with it and so on.
Got it. The only API that supports line items is Checkout (Payment Intents does not). You'll likely need to create your own API/use a third-party if you want to create 'orders' in that respect.
yeah, I would build my api around it, because of private keys and so on. The customer can only buy one item at once. I forgot to say this. I thought the example shows this (normaly if u go alone and buy ice cream, u only buy one xD)
I know, that you can define the price for a Payment Intent. If the customer choose the extras on the website and the price will be calculated in frontend. Than the paymentintent will be created for the frontend price?
Sure, then I guess you'd use a direct Payment Intents integration with Elements where you charge for the total amount of your customer order
where do I define the price?
There's no specific guidance on how you compute the total/line items, but you'd pass the total to the amount parameter when creating your Payment Intent: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#web-create-intent
oh when I just use these payment elements, I can do everything around it and just on the loading from the elements I use the created paymentintent, right?
Exactly, you pass the client_secret from your created PI to initiate the Payment Element
So in your scenario I guess you'd have a cart where they configure their ice cream, and then they proceed to a checkout/payment page where you create the Payment Intent with their cart total and initialise the Payment Element to take payment
This may be of interest to you: https://stripe.com/docs/elements/cart-element
It's in beta right now, but you can sign up for early access
wow, that looks beautiful ๐ฎ
I gonna test this and else I go back to the payment elements ๐
Well you need to be given access to that (via the form on that page). But it leverages Payment Element too for the actual payment
ah ok. It's like the combination from checkout and payment elements, to provide multiple items and also easy workflow to proceed right?
Exactly! A prebuilt cart UI that integrates with Payment Element to facilitate the payment