diff --git a/src/Api.php b/src/Api.php index 11a6216..ac07eed 100644 --- a/src/Api.php +++ b/src/Api.php @@ -165,6 +165,12 @@ class Api { }); } + public function countries() { + return collect($this->http()->get(self::$url."/ica/rest/baseadmin/land")['data'])->map(function($country) { + return Country::fromNami($country); + }); + } + public function feesOf($groupid) { return collect($this->http()->get(self::$url."/ica/rest/namiBeitrag/beitragsartmgl/gruppierung/{$groupid}")['data'])->map(function($fee) { return Fee::fromNami($fee); @@ -223,14 +229,6 @@ class Api { return json_decode((string)$response->getBody()); } - public function countries() { - $response = $this->client->get("/ica/rest/baseadmin/land", [ - 'cookies' => $this->cookie - ]); - - return json_decode((string)$response->getBody()); - } - public function groupForActivity($activityId) { $response = $this->client->get("/ica/rest//nami/untergliederungauftaetigkeit/filtered/untergliederung/taetigkeit/{$activityId}", [ diff --git a/src/Country.php b/src/Country.php new file mode 100644 index 0000000..e7dd313 --- /dev/null +++ b/src/Country.php @@ -0,0 +1,19 @@ + $item['id'], + 'name' => $item['descriptor'] + ]); + } + +}