testing seat api

This commit is contained in:
2018-11-21 23:41:03 -06:00
parent cf0996ee66
commit f872445ae5
3 changed files with 7 additions and 3 deletions

View File

@@ -29,8 +29,9 @@ class FinancesController extends Controller
} }
public function displayWallet() { public function displayWallet() {
$helper = new SeatHelper(); $helper = new Finances();
$helper->GetCorpJournal(98287666, 3);
$data = $helper->GetWalletJournal(1, 92626011);
} }
public function displayTaxes() { public function displayTaxes() {

View File

@@ -98,6 +98,7 @@ class Finances {
} }
//Decode the journal from json into an array for future processing //Decode the journal from json into an array for future processing
$journals = json_decode($journal->raw, true); $journals = json_decode($journal->raw, true);
dd($journals);
//For each journal array, attempt to store in the database //For each journal array, attempt to store in the database
foreach($journals as $entry) { foreach($journals as $entry) {
if($entry['ref_type'] == 'brokers_fee' || $entry['ref_type'] == 'reprocessing_tax') { if($entry['ref_type'] == 'brokers_fee' || $entry['ref_type'] == 'reprocessing_tax') {

View File

@@ -25,7 +25,9 @@ class SeatHelper {
]); ]);
$data = $guzzle->request('GET', 'https://seat.warpedintentions.com/api/v2/corporation/wallet-journal/' . $corporationId . '?page=' . $page); $data = $guzzle->request('GET', 'https://seat.warpedintentions.com/api/v2/corporation/wallet-journal/' . $corporationId . '?page=' . $page);
$body = $data->getBody()->getContents(); $body = $data->getBody()->getContents();
dd($body); $response = json_decode($body);
return $response;
} }
private function DecodeDate($date) { private function DecodeDate($date) {