Jump to content
McKay Development

Question about offer.getExchangeDetails


Recommended Posts

The getExchangeDetails documentation implies that it works for trades that weren't successful 

Quote

If false and the trade's state is anything but Complete, InEscrow, or EscrowRollback, then the callback will report an error instead of returning the data to you. This is intended to prevent ignorant developers from blindly trusting the data they get without verifying that the trade has completed successfully. Defaults to false.

However, it also requires the tradeID property to be defined

Quote

This can be called for any trade offer that has a tradeID property defined that isn't null, including those that are in escrow or have failed.

which is described as 

Quote

A numeric trade ID, represented as a string, if the offer was accepted. null otherwise. This value won't be very useful to you.

This seems contradictory, and means I can't get call getExchangeDetails on an offer that has been cancelled by the sender, which I require. (I get the error  Error: No trade ID; unable to get trade details)

 

Am I doing something wrong or is this a bug? Thanks

Link to post
Share on other sites

Thinking on this again, I guess that when the offer rolls back it was technically accepted, so that might cause the tradeID property to be defined. In that case, is the only way to differentiate between a rollback and a standard cancelled offer to check if the tradeID property is defined? (Talking about offers that rolled back due to being cancelled after the receiver has accepted and confirmed the offer)

Thanks

Link to post
Share on other sites

You're correct, there will only be a tradeID if the recipient attempted to accept the offer. A situation where there might be a tradeID but the trade did not happen is an error in Steam when attempting to commit the trade, or an escrow cancellation.

I believe that if Steam has an error and rolls back, the trade offer state will go to InvalidItems since the rollback will change the item IDs (for most games). But if it's an escrow cancellation, the trade offer state will be Canceled and escrowEnds will not be null, which allows you to differentiate between cancellations by the sender and escrow cancellations. There's no way to tell which side canceled the trade in escrow though, but you presumably know whether you did it or not.

Link to post
Share on other sites

I occasionally get trades go to the Canceled state with rollback and updated item IDs. I assume this is because cancelTime is set, the trade has been accepted by the recipient and steam is processing it when the cancelTime elapses, however I'm not sure why Steam allows it to be cancelled at that point (I think this because it used to happen more frequently until I increased the cancelTime). It's definitely not to do with escrow because trades aren't sent if it would have an escrow period and I've checked manually that the recipient doesn't have any escrow. Just letting you know because it's not one of your cases.

Link to post
Share on other sites

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...