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

unexpected '.', expecting ' #38

Closed
ToniKuipers opened this issue Apr 7, 2017 · 16 comments
Closed

unexpected '.', expecting ' #38

ToniKuipers opened this issue Apr 7, 2017 · 16 comments
Assignees
Labels

Comments

@ToniKuipers
Copy link

I got this error:
Parse error: syntax error, unexpected '.', expecting ')
On this line:
/src/JKetelaar/fut/api/API.php on line 118

How to fix it?

@JKetelaar JKetelaar self-assigned this Apr 7, 2017
@JKetelaar JKetelaar added the bug label Apr 7, 2017
@JKetelaar
Copy link
Owner

I cannot reproduce this error, is there a bigger exception log or do you have the example code you're trying to execute?

@JKetelaar JKetelaar added question and removed bug labels Apr 10, 2017
@JKetelaar
Copy link
Owner

Closed due to no response.

@ToniKuipers
Copy link
Author

Sorry had no time to respond. Still got the error!

@JKetelaar
Copy link
Owner

Please provide the entire stack trace.

@JKetelaar JKetelaar reopened this Apr 21, 2017
@ToniKuipers
Copy link
Author

ToniKuipers commented Apr 21, 2017

New error!

Fatal error: Uncaught JKetelaar\fut\api\errors\login\MainLogin: Unable to login with unknown response With the following message: Incorrect verification code With error code: 295712 in /home4/tonikuipers/public_html/mydomain.com/src/JKetelaar/fut/api/user/Login.php:396 Stack trace: #0 /home4/tonikuipers/public_html/mydomain.com/src/JKetelaar/fut/api/user/Login.php(98): JKetelaar\fut\api\user\Login->postTwoFactorForm('https://signin....') #1 /home4/tonikuipers/public_html/mydomain.com/src/JKetelaar/fut/api/API.php(123): JKetelaar\fut\api\user\Login->login() #2 /home4/tonikuipers/public_html/mydomain.com/index.php(11): JKetelaar\fut\api\API->login() #3 {main} thrown in /home4/tonikuipers/public_html/mydomain.com/src/JKetelaar/fut/api/user/Login.php on line 396

Update: I received the verification code by mail and used the example form README.md

@JKetelaar
Copy link
Owner

The verification code provided is incorrect

@ToniKuipers
Copy link
Author

Where should i provide that verification code?

@JKetelaar
Copy link
Owner

Within the method that returns the code, as a parameter for the login class.

@ToniKuipers
Copy link
Author

So it should be like this?

function totp_callback() {
    return 'MY_MAIL_CODE';
}

@JKetelaar
Copy link
Owner

Yes

@ToniKuipers
Copy link
Author

ToniKuipers commented Apr 21, 2017

Still not working. I'am using this code as my index php.

<?php
require_once('vendor/autoload.php');

define('DATA_DIR', __DIR__ . '/data/');

$api = new \JKetelaar\fut\api\API('my_mail', 'my_pass', 'secret_answer', 'totp_callback (not changed)', 'ps4', true);

if($api->login() === true) {
    echo('We\'re logged in!' . "\n");

    $handler = $api->getHandler();
    foreach($handler->getTradepile() as $trade) {
        // Interact with $trade here
    }
}

function totp_callback() {
    return 'my_mail_code';
}

This is the error.

Fatal error: Uncaught JKetelaar\fut\api\errors\login\MainLogin: Unable to login with unknown response With the following message: Incorrect verification code With error code: 295712 in /home4/tonikuipers/public_html/mydomain.com/src/JKetelaar/fut/api/user/Login.php:396 Stack trace: #0 /home4/tonikuipers/public_html/mydomain.com/src/JKetelaar/fut/api/user/Login.php(98): JKetelaar\fut\api\user\Login->postTwoFactorForm('https://signin....') #1 /home4/tonikuipers/public_html/mydomain.com/src/JKetelaar/fut/api/API.php(123): JKetelaar\fut\api\user\Login->login() #2 /home4/tonikuipers/public_html/mydomain.com/index.php(11): JKetelaar\fut\api\API->login() #3 {main} thrown in /home4/tonikuipers/public_html/mydomain.com/src/JKetelaar/fut/api/user/Login.php on line 396

@ToniKuipers
Copy link
Author

If i try to login with a Backup code it's giving me another error. But the backup code is used in the Customer portal of EA.

This is the error.

Fatal error: Uncaught JKetelaar\fut\api\errors\login\MainLogin: Unable to login with unknown response With the following message: HTTP/1.1 500 Internal Server Error With error code: 500 in /home4/tonikuipers/public_html/mydomain.com/src/JKetelaar/fut/api/user/Login.php:210 Stack trace: #0 /home4/tonikuipers/public_html/mydomain.com/src/JKetelaar/fut/api/user/Login.php(185): JKetelaar\fut\api\user\Login->getAccountInformation() #1 /home4/tonikuipers/public_html/mydomain.com/src/JKetelaar/fut/api/user/Login.php(146): JKetelaar\fut\api\user\Login->getShards('0') #2 /home4/tonikuipers/public_html/mydomain.com/src/JKetelaar/fut/api/user/Login.php(392): JKetelaar\fut\api\user\Login->getFUTPage() #3 /home4/tonikuipers/public_html/mydomain.com/src/JKetelaar/fut/api/user/Login.php(98): JKetelaar\fut\api\user\Login->postTwoFactorForm('https://signin....') #4 /home4/tonikuipers/public_html/mydomain.com/src/JKetelaar/fut/api/API.php(123): JKetelaar\fut\api\user\Login->login() #5 /home4/tonikuipers/public_html/mydomain.com/login.php(18): JKetelaar\fut\api\API->login() in /home4/tonikuipers/public_html/mydomain.com/src/JKetelaar/fut/api/user/Login.php on line 210

@JKetelaar
Copy link
Owner

Fatal error: Uncaught JKetelaar\fut\api\errors\login\MainLogin: Unable to login with unknown response With the following message: Incorrect verification code With error code: 295712

With the following message: Incorrect verification code

Seems like either a wrong code or a wrong piece of code.
Could you provide your login staging method, to see we could trace this down?

@ToniKuipers
Copy link
Author

I'am trying to use email verification. But now i switched to Authenticator and it's working fine. (still want to use email verification or backupcodes).

An other quenstion, how to (echo) display the current amount of coins on the account when i logged in? Could you give me any example?

@JKetelaar
Copy link
Owner

The Market class has a method getCredits which returns the amount of credits/coins on the account

I'll try to use email verification as a test soon, to see if that works properly.

@ToniKuipers
Copy link
Author

Thanks!

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

No branches or pull requests

2 participants