#Hugos
1 messages ยท Page 1 of 1 (latest)
Can you type the event.data.object to Stripe.Checkout.Session? For example,
const checkoutSession = event.data.object as Stripe.Checkout.Session;
Thanks for the quick response! Let me give it a shot
This is the result
Let me give you an example that isnt metadata, since metadata can indeed be null ๐
The error message showed that shipping_address can be undefined
So you'd need to handle undefined case
I guess it'd be easier to create the type for my use case then?
For example,
checkoutSession.shipping_details?.address?.city;
Or that yeah
You can use ? for undefined object and it will check for undefined
No problem! Happy to help ๐