Skip to content

Commit

Permalink
Various Fixes
Browse files Browse the repository at this point in the history
- Better CURL error handling
- Fixed cert path issue
- Removed hompage detail from manifest
  • Loading branch information
adamcmoore committed Feb 12, 2018
1 parent 3e90905 commit 1fc06c7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
5 changes: 4 additions & 1 deletion src/ApiClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/InsuranceHub.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}


Expand Down

0 comments on commit 1fc06c7

Please sign in to comment.