Jump to content
McKay Development

Recommended Posts

Posted

Hello, I'm using this to get "getExchangeDetails" but it always give me 

undefined:1
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
 ^

This is the code, thank you!

  offer.getExchangeDetails(function(err, status, tradeInitTime, receivedItems, sentItems) {
    if(!err){
      console.log("Trade status is " + status + ", init time " + tradeInitTime + ", and we received " + receivedItems.length + " items and sent " + sentItems.length + " items.");
    }else{ 
      err;
    }
    });
Posted

If that's supposed to be an error, you've cut off most of the useful part of it.

Thank you for your answer, but I really don't know how to use it. It was an example what I have used. I only want to get the receivedItems as an array, but I don't know how to use getExchangeDetails, can you give me an example? Thanks

Posted (edited)

The way you've used it looks correct to me (although you probably want to console.log that err). I'd need to see more (like more of the error).

undefined:1
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
 ^

SyntaxError: Unexpected token o in JSON at position 1

Only logs this. Thanks <3

Edited by Nacho
Posted

Surely there is more code in your application than just that snippet.

 

Also, provide the entire output please.

It was an error that was before getExchangeDetails, I fix it. But now getExchangeDetails, if I print the receivedItems it only print the hour. Here is the code and the output: 

    offer.getExchangeDetails(function (err, status, receivedItems){
    if(err){
      console.log("probando error");
    }
    else{
      console.log(receivedItems);  
    }
    });

Output

2017-08-06T13:50:17.000Z

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...