#mxd
1 messages ยท Page 1 of 1 (latest)
Hi ๐
You can create products through the Dashboard or the API
in the app.py/server.py I modify the thing?
checkout_session = stripe.checkout.Session.create(
line_items=[
{
'price': 'price_1LxHGMLOEVMWAWDDhKcCCxXC',
'quantity': 1,
},
],
mode='subscription',
success_url=YOUR_DOMAIN +
'/success.html?session_id={CHECKOUT_SESSION_ID}',
cancel_url=YOUR_DOMAIN + '/cancel.html',
)#----------------------------------------------create a checkout session```
No you would need to create the Products and their prices in your Stripe Account
i did that part
Okay, so what is the question exactly?
What are you trying to do? Have you read through our docs on how to set up a checkout session?
in the quickstart?
The rest of our docs, not just the quickstart
Oh like this: {
'price': 'price_CBXbz9i7AIOTzr',
},
{
'price': 'price_IFuCu48Snc02bc',
'quantity': 2,
},
We have many more pages on how to do this and I would recommend reading them
so the issue Im running into is the front end
<!-- Add a hidden field with the lookup_key of your price-->
<input type="hidden" name="lookup_key" value="{{PRICE_LOOKUP_KEY}}" />
<button id="checkout-and-portal-button" type="submit">Checkout</button>
</form>```
so the variation will be the value="" ?
i put the price_ndibfiebh thing there ?
it doesn't mention what to do on the frontend side
just the backend
Yup, put the price ID where it says {{PRICE_LOOKUP_KEY}}
That will pass back 1 price ID to server.py
understood, so does name="lookup_key" need to be changed?
All that does is change what the key is that you use to look up the value.
lookup_keys=[request.form['lookup_key']], # <- this is "lookup_key"
Happy to help ๐