#Dave
1 messages · Page 1 of 1 (latest)
Hi 👋 can you tell me more about how you're handling typing? Are you relying on the typing in one of our provided libraries?
In my package.json I have stripe and @stripe/stripe-js installed.
I use let event: Stripe.Event;
In my POST request I have a switch statement which is looking at event.type, and then my session object is constructed using const session = event.data.object as Stripe.Checkout.Session;
All of the other keys in the object work fine, other than session.shipping.
Here is a simplified version of the code I'm running: https://pastebin.com/ntR0XbZU Line 24 is where I get the typescript error. Everything else is fine.
I could extend the Stripe.Checkout.Session interface, but I figure it's best to first see if I'm doing something wrong
Taking a closer look, trying to see if I can find the current list of the contents for Checkout Sessions.
Thanks!
Does shipping_details give you the information you're looking for?
https://github.com/stripe/stripe-node/blob/f390320c754f84c3b99ea6ea0e537a7784d3b8fb/types/Checkout/Sessions.d.ts#L229