I'm using stripe and I'm trying to list all items the customer has bought, but logging those items returns undefined. What did I do wrong? And how does the listLineItems function work? (The session object is a stripe checkout session object.)
if(event.type === "checkout.session.completed") {
const session = event.data.object;
var items = await stripe.checkout.sessions.listLineItems(
session.id,
function(err, lineItems) {
console.log(err);
}
);
console.log(items);
}