#mateo2345-custom-success
1 messages · Page 1 of 1 (latest)
so on my success page I am trying to retrieve the checkout session so I can get the costumers name for example and on the document that I just sent it gets the checkout session by the id of the session that is passed into the url, but I dont want to have the checkout session id in my url so I am asking if there is an other way I could get the checkout session id on my success page so I can display the costumers name for example
That is the only way I am aware of. Is there a reason you do not like having it in your URL?
I just prefer to have an order id that is created after the checkout in my URL
What order info would you like? You can look it up through the Session ID
The email, quantity and name
You can get all of these from the Session object. When you retrieve it make sure to expand the "customer" property https://stripe.com/docs/api/expanding_objects
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Then you can get those as:
session.customer.name session.customer.email session.line_items.data[SOME_INDEX].quantity
Ok thanks, but how can I retrieve it
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ok thanks I am going to try it
Sounds good, let me know if you have any further questions