#maxhenson
1 messages · Page 1 of 1 (latest)
hi, do you have more details like some exact code you're using, product IDs prod_xxx, raw JSON, etc?
Of course!
I am doing this:
stripe.products.retrieve(data.metadata.buyingItem)
console.log(product)```
and it returns
```json
Promise {
{
...
}
}
``` but when I do
```js
console.log(product.name)
``` it returns `undefined`
just imagine all the data is in the Promise
yeah because it's async
let product = await stripe.products.retrieve(data.metadata.buyingItem)
it's no problem!
you can also do stripe.products.retrieve(data.metadata.buyingItem).then(function(product){console.log(product.name)});