diff --git a/composer.json b/composer.json index f675fa2..1507003 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,6 @@ { "name": "adamcmoore/insurance-hub", "description": "API wrapper for Insurance Hub, based on https://github.com/Insure-Tech/InsuranceHub.Client.Php", - "homepage": "https://smccoachhire.com", "authors": [ { "name": "Adam Moore", diff --git a/src/ApiClient.php b/src/ApiClient.php index 81fca04..a8cbd93 100644 --- a/src/ApiClient.php +++ b/src/ApiClient.php @@ -33,8 +33,11 @@ public function execute($request) $response = curl_exec($ch); - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); + if ($response === false) { + throw new \Exception(curl_error($ch), curl_errno($ch)); + } + $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); switch ($httpCode) { case 401: throw new ApiAuthenticationException(); diff --git a/src/InsuranceHub.php b/src/InsuranceHub.php index c0da83e..57d4990 100644 --- a/src/InsuranceHub.php +++ b/src/InsuranceHub.php @@ -21,7 +21,7 @@ public function __construct($vendorId, $apiKey, $offeringRequestURL, $offeringRe $this->apiKey = $apiKey; $this->offeringRequestURL = $offeringRequestURL; $this->offeringResultURL = $offeringResultURL; - $this->certPath = getcwd()."/ComodoCACert.cer";; + $this->certPath = __DIR__.'/../ComodoCACert.cer'; }