forked from LiveCarta/PayPal-PHP-Server-SDK
Release 0.7.0
Beta Release 0.7.0 including: - Bug fixes - Updated model/function names - Updated models to reflect changes in APIs
This commit is contained in:
@@ -11,6 +11,7 @@ declare(strict_types=1);
|
||||
namespace PaypalServerSdkLib\Exceptions;
|
||||
|
||||
use CoreInterfaces\Sdk\ExceptionInterface;
|
||||
use PaypalServerSdkLib\ApiHelper;
|
||||
use PaypalServerSdkLib\Http\HttpResponse;
|
||||
use PaypalServerSdkLib\Http\HttpRequest;
|
||||
|
||||
@@ -68,4 +69,20 @@ class ApiException extends \Exception implements ExceptionInterface
|
||||
{
|
||||
return !\is_null($this->response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the ApiException object to a human-readable string representation.
|
||||
*
|
||||
* @return string The string representation of the ApiException object.
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return ApiHelper::stringify(
|
||||
'ApiException',
|
||||
[
|
||||
'statusCode' => $this->getCode(),
|
||||
'message' => $this->getMessage()
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace PaypalServerSdkLib\Exceptions;
|
||||
|
||||
use PaypalServerSdkLib\ApiHelper;
|
||||
|
||||
/**
|
||||
* The error details.
|
||||
*/
|
||||
@@ -172,4 +174,24 @@ class ErrorException extends ApiException
|
||||
{
|
||||
$this->links = $links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the ErrorException object to a human-readable string representation.
|
||||
*
|
||||
* @return string The string representation of the ErrorException object.
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return ApiHelper::stringify(
|
||||
'ErrorException',
|
||||
[
|
||||
'name' => $this->name,
|
||||
'messageProperty' => $this->messageProperty,
|
||||
'debugId' => $this->debugId,
|
||||
'details' => $this->details,
|
||||
'links' => $this->links
|
||||
],
|
||||
parent::__toString()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace PaypalServerSdkLib\Exceptions;
|
||||
|
||||
use PaypalServerSdkLib\ApiHelper;
|
||||
|
||||
/**
|
||||
* OAuth 2 Authorization endpoint exception.
|
||||
*/
|
||||
@@ -111,4 +113,18 @@ class OAuthProviderException extends ApiException
|
||||
{
|
||||
$this->errorUri = $errorUri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the OAuthProviderException object to a human-readable string representation.
|
||||
*
|
||||
* @return string The string representation of the OAuthProviderException object.
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return ApiHelper::stringify(
|
||||
'OAuthProviderException',
|
||||
['error' => $this->error, 'errorDescription' => $this->errorDescription, 'errorUri' => $this->errorUri],
|
||||
parent::__toString()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user