I have an object trade
returned from Steam's API GetTradeOffer which contains the following:
tradeofferid=697052768, accountid_other=38044877, expiration_time=1443176120, trade_offer_state=7
if I console.log(trade)
I get:
tradeofferid=697052768, accountid_other=38044877, expiration_time=1443176120, trade_offer_state=7
however if I do console.log(trade.trade_offer_state)
I get undefined
Has anyone got any idea as to why?
EDIT:
Here is the full markup for this section:
function checkOffer(offer) {
offers.getOffer({
tradeOfferId: offer.trade_id.toString()
}, function(err, trade) {
if (err) {
throw err;
}
logger.info(trade);
if (trade.trade_offer_state == '7' || trade.trade_offer_state == '4' || trade.trade_offer_state == '5' || trade.trade_offer_state == '6' || trade.trade_offer_state == '9' || trade.trade_offer_state == '10') {
connection.query('UPDATE `trade_queue` SET `offer_sent` = 0 WHERE `id` = ' + "'" + offer.id + "'", function(err, rows, fields) {
if (err) {
throw err;
}
logger.info(rows[0]);
});
}
});
}