#Hugos

1 messages ยท Page 1 of 1 (latest)

drowsy oasisBOT
gentle hatch
#

Can you type the event.data.object to Stripe.Checkout.Session? For example,

const checkoutSession = event.data.object as Stripe.Checkout.Session;
regal escarp
#

Thanks for the quick response! Let me give it a shot

regal escarp
#

Let me give you an example that isnt metadata, since metadata can indeed be null ๐Ÿ˜„

gentle hatch
#

The error message showed that shipping_address can be undefined

#

So you'd need to handle undefined case

regal escarp
#

I guess it'd be easier to create the type for my use case then?

gentle hatch
#

For example,

checkoutSession.shipping_details?.address?.city;
regal escarp
#

Or that yeah

gentle hatch
#

You can use ? for undefined object and it will check for undefined

regal escarp
#

Thanks you so much, works perfectly

#

no red = bedtime ๐Ÿ˜„

gentle hatch
#

No problem! Happy to help ๐Ÿ˜„

regal escarp
#

Thanks, love Stripe so far, amazed me how much it handled for me within my web app ๐Ÿ˜„

#

not sure if you are a developer or not, but either way im sure you are helping to make stripe better