Skip to content

v0.9.0

Pre-release
Pre-release

Choose a tag to compare

@petehamilton petehamilton released this 30 Oct 13:10
· 1097 commits to master since this release

This release brings us closer to a v1.0.0 release and brings the general interface of the client in line with the existing ruby and python clients.

Notable Changes:

Params

Query and request params as now nested under a params key.

For example:

$customers = $client->customers()->list(['params' => ['limit' => 400]]);

Exceptions

We've renamed the exception classes:

  • GoCardlessError -> GoCardlessProException
  • InvalidApiUsageError -> InvalidApiUsageException
  • InvalidStateError -> InvalidStateException
  • ValidationFailedError -> ValidationFailedException

and altered the available api error methods slightly:

print_r($e->api_error)
/*
* stdClass Object
* (
*     [message] => Payment cannot be cancelled
*     [errors] => Array
*         (
*             [0] => stdClass Object
*                 (
*                     [reason] => cancellation_failed
*                     [message] => Payment cannot be cancelled
*                 )
* 
*         )
* 
*     [documentation_url] => https://developer.gocardless.com/pro#cancellation_failed
*     [type] => invalid_state
*     [request_id] => 262edcc8-8fdc-4b89-8040-c3d066cea430
*     [code] => 422
* )
*/

$e->getType() // invalid_state
$e->getErrors() // Array of API errors
$e->getDocumentationUrl() // https://developer.gocardless.com/pro#cancellation_failed
$e->getRequestId() // 262edcc8-8fdc-4b89-8040-c3d066cea431
$e->getMessage() // Payment cannot be cancelled
$e->getCode() // 422