Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Commit

Permalink
Merge d02425e into fc4294f
Browse files Browse the repository at this point in the history
  • Loading branch information
tlshaheen committed Jan 30, 2017
2 parents fc4294f + d02425e commit 91f9f36
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions src/Core/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,37 @@ public function getErrorCode() : int
}

/**
* Fetches the Error Message From Response
* Fetches the Error Message (including Extended Error Info) From Response
* @method getError
* @author PA
* @date 2017-01-10
* @return string Error Message
*/
public function getError() : string
{
return (string) $this->response->ErrDesc;
$error = (string) $this->response->ErrDesc;
if ($extendedError = $this->getExtendedError()) {
$error .= " ($extendedError)";
}

return $error;
}

/**
* Fetches the Extended Error from the Response
* @return string
* @author TLS
* @date 1-30-2017
*/
public function getExtendedError() : string
{
return isset($this->response->ExtendedErrorInfo) ? (string) $this->response->ExtendedErrorInfo : '';
}

/**
* Converts the response to an Array
* @method toArray
* @throws YourMembershipRequestException
* @throws YourMembershipResponseException
* @author PA
* @date 2017-01-10
* @return array Response
Expand All @@ -72,7 +88,7 @@ public function toArray() : array
/**
* Converts the response to an Object
* @method toObject
* @throws YourMembershipRequestException
* @throws YourMembershipResponseException
* @author PA
* @date 2017-01-11
* @return stdClass Response
Expand All @@ -87,7 +103,7 @@ public function toObject() : \stdClass
* Lossy conversion, attributes are lost from XML
*
* @method unwrapXMLObject
* @throws YourMembershipRequestException
* @throws YourMembershipResponseException
* @author PA
* @date 2017-01-11
* @param bool $asArray unwrap the object into an array instead of object
Expand Down

0 comments on commit 91f9f36

Please sign in to comment.