Beispiel #1
0
 public static function convertError($response)
 {
     if (property_exists($response->body, 'errors')) {
         $error = Error::createFromResponse($response);
     } else {
         $error = new HTTPError($response);
     }
     return $error;
 }
Beispiel #2
0
 /**
  * Initializes resources (i.e. registers them with Resource::_registry). Note
  * that if you add a Resource then you must initialize it here.
  * 
  * @internal
  */
 private static function initializeResources()
 {
     if (self::$initialized) {
         return;
     }
     \Balanced\Errors\Error::init();
     \Balanced\Resource::init();
     \Balanced\APIKey::init();
     \Balanced\Marketplace::init();
     \Balanced\Account::init();
     \Balanced\Credit::init();
     \Balanced\Debit::init();
     \Balanced\Refund::init();
     \Balanced\Card::init();
     \Balanced\BankAccount::init();
     \Balanced\Hold::init();
     \Balanced\Merchant::init();
     self::$initialized = true;
 }