OmG3r/steam-trade

is it possible to make exchanges with some restrictions on the steam user?

Opened this issue · 2 comments

In tests performed by steam, the error is always given below, and when performing through the web interface, the sending of exchange proposal works, but it is being held back.

  • it is possible to send an example that is working, so that I can understand the operation of exchange using the gem.
def send_offer
     account  = Handler.new(************',**********') 
   

      his = account.normal_get_inventory('Skanby', 570)
      me = account.normal_get_inventory("76561199093280846", 570)

      myarray = [me[8]].compact!
      theirarray = [his[8]].compact!

      # whenever
      trade_url =  "https://steamcommunity.com/tradeoffer/new/?partner=112865394&token=fhoqG7oX"
      account.send_offer(myarray, theirarray, trade_url)
end 

Screenshot5

Screenshot

OmG3r commented

As i have specified in the other issues, the nilClass error is because you are running .compact!, which will return nil if it does not make any modifications to the array

I removed the 'compact!', Now it is giving an error when sending the exchange, does the array of the item to be exchanged need to be treated before sending the exchange? because I'm sending the item as it comes in the normal_get_inventory method.

Screenshot 2020-12-29 215009

def send_offer
     account  = Handler.new(************',**********') 
   

      his = account.normal_get_inventory('Skanby', 570)
      me = account.normal_get_inventory("76561199093280846", 570)
       his_trade_url = account.normal_get_inventory("https://steamcommunity.com/tradeoffer/new/?partner=112865394&token=fhoqG7oX")

      myarray = [his_trade_url[1]]
      theirarray = [his_trade_url [1]]

      # whenever
      trade_url =  "https://steamcommunity.com/tradeoffer/new/?partner=112865394&token=fhoqG7oX"
      account.send_offer(myarray, theirarray, trade_url)
end