Add Balanced Payments API
Summary: Adds the Balanced PHP API to externals/. Ref T2787. Test Plan: Used in next diff. Reviewers: btrahan, chad Reviewed By: chad CC: aran, aurelijus Maniphest Tasks: T2787 Differential Revision: https://secure.phabricator.com/D5764
This commit is contained in:
10
externals/restful/src/RESTful/Exceptions/Base.php
vendored
Normal file
10
externals/restful/src/RESTful/Exceptions/Base.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace RESTful\Exceptions;
|
||||
|
||||
/**
|
||||
* Base class for all RESTful\Exceptions.
|
||||
*/
|
||||
class Base extends \Exception
|
||||
{
|
||||
}
|
||||
28
externals/restful/src/RESTful/Exceptions/HTTPError.php
vendored
Normal file
28
externals/restful/src/RESTful/Exceptions/HTTPError.php
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace RESTful\Exceptions;
|
||||
|
||||
/**
|
||||
* Indicates an HTTP level error has occurred. The underlying HTTP response is
|
||||
* stored as response member. The response payload fields if any are stored as
|
||||
* members of the same name.
|
||||
*
|
||||
* @see \Httpful\Response
|
||||
*/
|
||||
class HTTPError extends Base
|
||||
{
|
||||
public $response;
|
||||
|
||||
public function __construct($response)
|
||||
{
|
||||
$this->response = $response;
|
||||
$this->_objectify($this->response->body);
|
||||
}
|
||||
|
||||
protected function _objectify($fields)
|
||||
{
|
||||
foreach ($fields as $key => $val) {
|
||||
$this->$key = $val;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
externals/restful/src/RESTful/Exceptions/MultipleResultsFound.php
vendored
Normal file
11
externals/restful/src/RESTful/Exceptions/MultipleResultsFound.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace RESTful\Exceptions;
|
||||
|
||||
/**
|
||||
* Indicates that a query unexpectedly returned multiple results when at most
|
||||
* one was expected.
|
||||
*/
|
||||
class MultipleResultsFound extends Base
|
||||
{
|
||||
}
|
||||
10
externals/restful/src/RESTful/Exceptions/NoResultFound.php
vendored
Normal file
10
externals/restful/src/RESTful/Exceptions/NoResultFound.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace RESTful\Exceptions;
|
||||
|
||||
/**
|
||||
* Indicates that a query unexpectedly returned no results.
|
||||
*/
|
||||
class NoResultFound extends Base
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user