diff --git a/src/Mailgun/Connection/HttpBroker.php b/src/Mailgun/Connection/HttpBroker.php index 485cd2f..b7433e8 100644 --- a/src/Mailgun/Connection/HttpBroker.php +++ b/src/Mailgun/Connection/HttpBroker.php @@ -51,8 +51,8 @@ class HttpBroker{ public function getRequest($endpointUrl, $queryString = array()){ $request = $this->mgClient->get($endpointUrl); - foreach($queryString as $queryKey=>$queryValue){ - $request->getQuery()->set($queryKey, $queryValue); + foreach($queryString as $key=>$value){ + $request->getQuery()->set($key, $value); } $response = $request->send(); return $this->responseHandler($response); diff --git a/src/Mailgun/Lists/Lists.php b/src/Mailgun/Lists/Lists.php index 4a62667..d289dbe 100644 --- a/src/Mailgun/Lists/Lists.php +++ b/src/Mailgun/Lists/Lists.php @@ -14,7 +14,7 @@ class Lists{ public function __construct($httpBroker){ $this->httpBroker = $httpBroker; - $this->endpointUrl = $this->httpBroker->returnWorkingDomain() . "/lists"; + $this->endpointUrl = "lists"; } diff --git a/src/Mailgun/Routes/Routes.php b/src/Mailgun/Routes/Routes.php index c964ff0..bd2ae5c 100644 --- a/src/Mailgun/Routes/Routes.php +++ b/src/Mailgun/Routes/Routes.php @@ -15,7 +15,7 @@ class Routes{ public function __construct($httpBroker){ $this->httpBroker = $httpBroker; - $this->endpointUrl = $this->httpBroker->returnWorkingDomain() . "/routes"; + $this->endpointUrl = "routes"; } public function getRoutes($limit, $skip){ diff --git a/src/Mailgun/Stats/Stats.php b/src/Mailgun/Stats/Stats.php index 561c5cd..1a11a2f 100644 --- a/src/Mailgun/Stats/Stats.php +++ b/src/Mailgun/Stats/Stats.php @@ -25,8 +25,8 @@ class Stats{ return $response; } - public function getStats($limit, $skip){ - $response = $this->httpBroker->getRequest($this->statsEndpointUrl, array($limit, $skip, $event, $start-date)); + public function getStats($filterParams = array()){ + $response = $this->httpBroker->getRequest($this->statsEndpointUrl, $filterParams); return $response; } } \ No newline at end of file