Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error making offer! Server response code: 500 #22

Open
vento333 opened this issue Mar 22, 2016 · 23 comments
Open

Error making offer! Server response code: 500 #22

vento333 opened this issue Mar 22, 2016 · 23 comments

Comments

@vento333
Copy link

 $itemsID = [ [
    "appid" => 730,
    "contextid" => "2",
    "amount" => 1,
    "assetid" => "5267345149"
    ]];

$result = $steam->makeOffer([
'partnerSteamId' => "76561198126733719",
'itemsFromMe' => [],
'itemsFromThem' => $itemsID,
'message' => "TEST"
]);

Return:

Notice: Undefined index: partnerAccountId in C:\xampp\htdocs\php-steam-tradeoffers-master\classes\steam.class.php on line 201

Notice: Undefined index: accessToken in C:\xampp\htdocs\php-steam-tradeoffers-master\classes\steam.class.php on line 204

Notice: Undefined index: counteredTradeOffer in C:\xampp\htdocs\php-steam-tradeoffers-master\classes\steam.class.php on line 210
Error making offer! Server response code: 500

Where is error?

@vento333
Copy link
Author

Full code:

<?php
require_once('classes/steam.class.php');
define('php-steamlogin', true);
require('main.php');
$SteamLogin = new SteamLogin(array(
    'username' => 'User',
    'password' => 'Password',
    'datapath' => dirname(__FILE__) //path to saving cache files
));
if($SteamLogin->success){
    $authcode = "VYDM7";
    $logindata = $SteamLogin->login($authcode); 

   $steam = new SteamTrade();
   $steam->setup($logindata['sessionId'], $logindata['cookies']);

$itemsID = [ [
"appid" => "730",
"contextid" => "2",
"amount" => "1",
"assetid" => "5267345149"
]];

$result = $steam->makeOffer([
    'partnerSteamId' => "76561198126733719",
    'accessToken' => "0vajzrOn",
    'itemsFromMe' => [],
    'itemsFromThem' => $itemsID,
    'message' => "TEST"
]);






    if($SteamLogin->error != '') echo $SteamLogin->error;
}else{
    echo $SteamLogin->error;
}
?>

@emdy
Copy link

emdy commented Mar 22, 2016

awd

@vento333
Copy link
Author

Parse error: syntax error, unexpected '') echo $SteamLogin->error;' (T_ENCAPSED_AND_WHITESPACE), expecting ')' in C:\xampp\htdocs\php-steam-tradeoffers-master\index.php on line 44

I have error again

@emdy
Copy link

emdy commented Mar 22, 2016

Updated now

@vento333
Copy link
Author

Parse error: syntax error, unexpected 'POST' (T_STRING), expecting ')' in C:\xampp\htdocs\php-steam-tradeoffers-master\index.php on line 37

Line 37:

curl_setopt($c, CURLOPT_CUSTOMREQUEST, strtoupper('POST'));

@emdy
Copy link

emdy commented Mar 22, 2016

Dude i think your low to think about errors and dont tried to solve it. I post code, but seems your localhost php version is older or something..
TRY NOW

@vento333
Copy link
Author

Notice: Undefined variable: url in C:\xampp\htdocs\php-steam-tradeoffers-master\index.php on line 27

Lane 27:
curl_setopt($c, CURLOPT_URL, $url);

Relax, I appreciate your help.

@emdy
Copy link

emdy commented Mar 22, 2016

Try now i missed url paramenter.

@vento333
Copy link
Author

Code is work, but return is NULL value.

It's good settings?

  $data = array(
            'sessionid' => $sessionId,
            'serverid' => '1',
            'partner' => '{166467991}',
            'tradeoffermessage' => 'test',
            'trade_offer_create_params' => '{"trade_offer_access_token": "{0vajzrOn}"}', // use if its not vento333 friend
            'json_tradeoffer' => '{"newversion":true,"version":2,"them":{"assets":[],"currency":[],"ready":false},"me":{"assets":[{"appid":730,"contextid":"2","amount":1,"assetid":"{5267345149}"}],"currency":[],"ready":false}}'
        );

@emdy
Copy link

emdy commented Mar 22, 2016

your so funny :D
replace {0vajzrOn} to 0vajzrOn every varible i typed you need to put
partner value bellow serverid is steamid not partner id

@vento333
Copy link
Author

OMG I LOVE YOU!!!!!!!!!

Now i know what is happened!

Thanks dude
You have logged in from a new device. In order to protect the items in your inventory, you will be unable to trade from this device for 7 days."}

Thank again!

@vento333
Copy link
Author

But it's work i think!
Thank you!

@emdy
Copy link

emdy commented Mar 22, 2016

ye you need wait 7 days and it will be ok
Use mobileauth because you get tradehold.

@vento333
Copy link
Author

I know.
Thanks you!

@vento333 vento333 reopened this Mar 22, 2016
@vento333
Copy link
Author

I use e-mail for accept a offer. I must change it to mobileauth?

@emdy
Copy link

emdy commented Mar 22, 2016

Ye because if you dont you get tradehold(when trade was accepted) and if you cancel tradehold trade than you get trade ban.

@vento333
Copy link
Author

Ok, last question.
If i change it to mobileauth then i musn't accept any offer in mobilephone?

@vento333
Copy link
Author

And what is this?
http://steamcommunity.com/dev/managegameservers

@vento333
Copy link
Author

I set it and i get this

http://screenshot.sh/m2evT2A1MZZBb

@emdy
Copy link

emdy commented Mar 22, 2016

If you dont want to wait tradehold than you need mobile auth on.

@sebastianlew
Copy link

Accepting mobile confirmations in PHP: https://github.com/S3baso/php-steam-mobile-offer-accept - done yet! Enjoy!

@emdy
Copy link

emdy commented Apr 27, 2016

@S3baso you just copy lib lol

@AllTerrainAction
Copy link

@emdy added you on steam, want to chat. Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants