#vladP - Checkout
1 messages ยท Page 1 of 1 (latest)
Hello! Not sure I understand your question, can you provide more details, such as an example scenario with example URLs and behavior?
So in my success page url I have the checkout session id
and when I change it I still am on the success page
And so I dont want my customer to be able to change the checkout session id in my url
Ah, gotcha. This is something you would need to handle on your end. The behavior of your success page is entirely up to you.
Copy/pasting your question here for convenience: "Hello again, is there any way I could retrieve the quantity from my checkout session"
Yup! You can either retrieve the line items from your checkout session (https://stripe.com/docs/api/checkout/sessions/line_items) or you can expand line_items when you retrieve the whole Checkout Session (https://stripe.com/docs/api/checkout/sessions/retrieve) and that should tell you the quantity for each line item
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Sorry for the late reply but how do I expand the line_items when I retrieve the whole checkout session
We actually have an example of this in our docs! https://stripe.com/docs/expand#includable-properties
Thank you so much I got it now
๐ awesome!
actually I have a problem. When I try to append the quantity to a textbox it just says that its undefined.
this is the code that I used
session.line_items.data is an array - you need to do something like session.line_items.data[0].quantity instead