Closed esprajwol closed 7 years ago
The package could not connect to your MoIP account. You have the set?
How do you trying to get the message?
Because "Exceptions\ValidationException" save errors in an array.
And $exception->getMessage() return nothing. the correct way (just in moip) is $exception->getErrors().
You can see an example in moip-sdk-php/tests/MoipTest.php
This code
give error as Moip \ Exceptions \ ValidationException No message
$code = $http_response->status_code; $response_body = $http_response->body; if ($code >= 200 && $code < 300) { return json_decode($response_body); } elseif ($code == 401) { throw new Exceptions\UnautorizedException(); } elseif ($code >= 400 && $code <= 499) { $errors = Exceptions\Error::parseErrors($response_body); throw new Exceptions\ValidationException($code, $errors); } throw new Exceptions\UnexpectedException(); }