Currently when running this, I get an error saying that lineItems is not defined. How can I get the console.log to work here?
My Code:
await stripe.checkout.sessions.listLineItems(
session.id,
{ limit: 5 },
function lineItems(err, lineItems) {
if (err) {
console.log(err);
} else {
var price = lineItems.data[0].price.id;
}
return price;
}
);
const priceId = lineItems();
// console log price from line items
console.log(priceId);
Any help is appreciated, thanks!