From 40872c9b9669713b2edd438c4d2d4233de7d6599 Mon Sep 17 00:00:00 2001 From: Adam Giesinger Date: Fri, 24 Jan 2020 08:31:29 +0100 Subject: [PATCH 1/2] Update readme, fix rare bug --- README.md | 36 +++++++++++++++++------------------- src/Api/AbstractCore.php | 2 +- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 9100117..05f595d 100644 --- a/README.md +++ b/README.md @@ -44,11 +44,10 @@ Login parameters: - code: [string] email code for two-step verification (make sure to use string if your code starts with 0). ```php -use FUTApi\Api\Core; -use FUTApi\Exception\FutError; -use FUTApi\Api\Authentication\Account; -use FUTApi\Api\Authentication\Credentials; -use FUTApi\Api\Authentication\Session; +use FShapecode\FUT\Client\Api\Core; +use Shapecode\FUT\Client\Authentication\Credentials; +use Shapecode\FUT\Client\Authentication\Account; +use Shapecode\FUT\Client\Authentication\Session; $credentials = new Credentials($email, $password, $platform); @@ -64,8 +63,8 @@ $fut = new Core($account); try { $login = $fut->login($code); $session = $account->getSession(); -} catch(FutError $e) { - $reason = $e->getReason(); +} catch(Exception $e) { + $reason = $e->getMessage(); die("We have an error logging in: ".$reason); } ``` @@ -76,24 +75,23 @@ After you have initiated your first session, you can then use the API wthout log ### Search Optional parameters: - -- min_price: [int] Minimal price. -- max_price: [int] Maximum price. -- min_buy: [int] Minimal buy now price. -- max_buy: [int] Maximum buy now price. -- level: ['bronze'/'silver'/gold'] Card level. +- micr: [int] Minimal price. +- macr: [int] Maximum price. +- minb: [int] Minimal buy now price. +- maxb: [int] Maximum buy now price. +- lev: ['bronze'/'silver'/gold'] Card level. - start: [int] Start page number. -- category: ['fitness'/'?'] Card category. +- type: ['fitness'/'player'/'?'] Card category. - assetId: [int] assetId. - defId: [int] defId. -- league: [int] League id. -- club: [int] Club id. -- position: [int?/str?] Position. +- leag: [int] League id. +- team: [int] Club id. +- pos: [str] Position. (e.g. "ST") - zone: ['attacker'/'?'] zone. -- nationality: [int] Nation id. +- nat: [int] Nation id. - rare: [boolean] True for searching special cards. - playStyle: [str?] playStyle. -- page_size: [int] Amount of cards on single page (changing this might be risky). +- num: [int] Amount of cards on single page (changing this might be risky). ```php $options = []; diff --git a/src/Api/AbstractCore.php b/src/Api/AbstractCore.php index 7c76de4..1b2a70b 100644 --- a/src/Api/AbstractCore.php +++ b/src/Api/AbstractCore.php @@ -131,7 +131,7 @@ public function login(?string $code = null) : array 'release_type' => 'prod', 'redirect_uri' => 'https://www.easports.com/fifa/ultimate-team/web-app/auth.html', // 'redirect_uri' => 'nucleus:rest', - 'scope' => 'basic.identity offline signin basic.entitlement', + //'scope' => 'basic.identity offline signin basic.entitlement', ], 'headers' => $headers, 'on_stats' => static function (TransferStats $stats) use (&$url) : void { From 877472d055c1b509846eb233412d172b4fab6a38 Mon Sep 17 00:00:00 2001 From: Adam Giesinger Date: Fri, 24 Jan 2020 10:51:11 +0100 Subject: [PATCH 2/2] Change assetId to maskedDefId --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 05f595d..93e7fa5 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ Optional parameters: - lev: ['bronze'/'silver'/gold'] Card level. - start: [int] Start page number. - type: ['fitness'/'player'/'?'] Card category. -- assetId: [int] assetId. +- maskedDefId: [int] Player id. - defId: [int] defId. - leag: [int] League id. - team: [int] Club id.