SetStartStatus(); //Get the esi configuration $config = config('esi'); //Set caching to null $configuration = Configuration::getInstance(); $configuration->cache = NullCache::class; $token = $esiHelper->GetRefreshToken($config['primary']); if($token == null) { return null; } //Create an ESI authentication container $esi = $esiHelper->SetupEsiAuthentication($token); $esi->setVersion('v4'); //Reference to see if the character is in our look up table for corporations and characters $char = $lookup->GetCharacterInfo($config['primary']); $corpId = $char->corporation_id; //Get the total pages for the journal for the sov bills from the holding corporation $pages = $finance->GetJournalPageCount(6, $config['primary']); //Try to figure it out from the command itself. for($i = 1; $i <= $pages; $i++) { printf("Getting page: " . $i . "\n"); try { $journals = $esi->page($i) ->invoke('get', '/corporations/{corporation_id}/wallets/{division}/journal/', [ 'corporation_id' => $corpId, 'division' => 6, ]); } catch(RequestFailedException $e) { return null; } //Decode the wallet from json into an array $wallet = json_decode($journals->raw, true); dd($wallet); foreach($wallet as $entry) { if($entry['ref_type'] == 'infrastructure_hub_maintenance' && $entry['first_party_id'] == 98287666) { $sovBill->InsertSovBillExpense($entry, $corpId, $division); } } } //Mark the job as finished $task->SetStopStatus(); } }