#Yarrik_b-checkout

1 messages ยท Page 1 of 1 (latest)

light viper
#

Hello! Let me take a look

#

When you say 'list_items' what are you referring to? and what language are you using?

west loom
#

I am using Node.js

#

i use create method on session.checkout object. when i using create method, i pass an object of parameters, and one of them is list_items. but when i try to call it (e.g. console.log(session.list_items)), i get undefined.
i was using this section of documentation: https://stripe.com/docs/api/checkout/sessions/create

viscid crown
#

Hi there ๐Ÿ‘‹ taking over here

There are a lot of reasons that you could be getting undefined for that object. Do you get anything back for the session? In other words, does console.log(session); give you anything?

west loom
#

yes, it gives me full session object

#

and also i used Expanding request where i passed id of the session and object {expand:['line_items'],}, i've got my another session with my needed property line_items. but i still can't understand why i can't get line_items directly from my initial session object
i used this guidance: https://stripe.com/docs/api/expanding_objects

heavy cradle
#

Hey stepping in for two-shoes as server is busy

#

Can you share your relevant code here so I can take a look?

heavy cradle
#

@west loom happen to still be around?

#

The issue here is that you want to log out line_items from the Session

#

It sounds like you are passing a list_items variable for the line_items param?

#

So you should try console.log(session.line_items) instead