Example #1
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;
 }
 /**
  * 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\Resource::init();
     \Balanced\APIKey::init();
     \Balanced\Marketplace::init();
     \Balanced\Credit::init();
     \Balanced\Debit::init();
     \Balanced\Refund::init();
     \Balanced\Reversal::init();
     \Balanced\Card::init();
     \Balanced\BankAccount::init();
     \Balanced\BankAccountVerification::init();
     \Balanced\CardHold::init();
     \Balanced\Callback::init();
     \Balanced\Event::init();
     \Balanced\Customer::init();
     \Balanced\Order::init();
     \Balanced\Dispute::init();
     self::$initialized = true;
 }
Example #3
0
 function testRegistry()
 {
     $result = Resource::getRegistry()->match('/v1/merchants');
     $expected = array('collection' => true, 'class' => 'Balanced\\Merchant');
     $this->assertEquals($expected, $result);
     $result = Resource::getRegistry()->match('/v1/merchants/136asd6713');
     $expected = array('collection' => false, 'class' => 'Balanced\\Merchant', 'ids' => array('id' => '136asd6713'));
     $this->assertEquals($expected, $result);
 }