#rhy-checkout-quantity

1 messages · Page 1 of 1 (latest)

jade capeBOT
queen forge
#

rhy-checkout-quantity

waxen cave
#

I want them to select the pixels/grids beforehand, which determines the quantity, and then plug this quantity into stripe

queen forge
#

I'm sorry, the buy button is on our Checkout page so what's the problem?

#

Do you mean you want them to pick the quantity before you send them to Checkout?

waxen cave
#

kind of, I want them to select the number of pixels (aka quantity) which is stored by a selectedPixels.length variable, and I want to use this as the quantity in checkout

queen forge
#

I'm sorry you're being super specific an talking about some kind of variable that isn't a Stripe thing, just seems to be your code so I don't really get what any of that could mean

But if you have a payment page, where they pick the quantity and then you send them to Checkout, then I don't get what's the issue. You write your code, send the quantity to your server, there you create a Checkout Session with the right quantity and you're all set

waxen cave
#

Sorry if I'm not explaining well enough; here's a quick demo of what I mean; the user can select let's say 5 grids in this example (they want to buy these exact 5 grids), let's say for example each grid is $1, then when they click the checkout button, it counts the quantity of grids selected (which is 5 in this case) and then uses that as the quantity for payment

#

and once they click checkout, they can't change the quantity purchased unless they cancel the transaction

queen forge
#

The "checkout button" is your own button right? So you write Javascript code that sends a request to your server with the list of pixels. You store that information in your database and you call the Create Checkout Session API with the right quantity. There isn't more to it than this I think

waxen cave
queen forge
#

That is a feature you explicitly have to enable. By default they can't change the quantity!

waxen cave
queen forge
waxen cave
queen forge
#

I'll keep it open for a bit, but not long, we have lots of people asking questions in parallel so it will be archived if it stays inactive. You are welcome to just ask new questions again in #dev-help if so

waxen cave
queen forge
waxen cave
#

so I'm following the quickstart pre-built checkout page you mentioned https://stripe.com/docs/checkout/quickstart but encountering some issues; when I click the checkout button nothing happens and the page is just loading - I copied and pasted the code in new components, (fyi I moved the index.js and checkout_sessions.js are in the same folder) the only things I changed in the code are the following:

price: 'price_1NxXosB5oiepJ50uC81tllmt',
<form action="/checkout_sessions" method="POST">

queen forge
#

I'm sorry, you sahred nothing actionable. Step 1 is to add logs to your code and debug this on your own, you're the developer writing all of this so you need to understand the pieces and where things are failing

waxen cave
#

alright will do some more digging around and test it out, but just to clarify, the price should be entered like this right?

price: 'price_1NxXosB5oiepJ50uC81tllmt',

queen forge
#

yes