Esempio n. 1
0
 static function _createCard($account = null)
 {
     $card = self::$marketplace->createCard('123 Fake Street', 'Jollywood', null, '90210', 'khalkhalash', '4112344112344113', null, 12, 2013);
     if ($account != null) {
         $account->addCard($card);
         $card = Card::get($card->uri);
     }
     return $card;
 }
Esempio n. 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;
 }
 /**
  * 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;
 }
Esempio n. 4
0
 /**
  * Create a buyer account.
  *
  * @param string email_address Optional email address. There can only be one account with this email address.
  * @param string card_href Href referencing a card to associate with the account.
  * @param array[string]string meta Optional metadata to associate with the account.
  * @param string name Optional name of the account.
  *
  * @return \Balanced\Customer
  */
 public function createBuyer($email_address, $card_href, $meta = null, $name = null)
 {
     $customer = $this->customers->create(array('email' => $email_address, 'meta' => $meta, 'name' => $name));
     $card = Card::get($card_href);
     $card->associateToCustomer($customer);
     return $customer;
 }
 /**
  * @param $uri
  * @return \Balanced\Card
  */
 public function getCard($uri)
 {
     return \Balanced\Card::get($uri);
 }
 function testGetDeletedCard()
 {
     $card_href = $this->testDeleteCard();
     Card::get($card_href);
 }
Esempio n. 7
0
 /**
  * @expectedException \UnexpectedValueException
  */
 function testNotAssociatedDebit()
 {
     $card = new Card(array('uri' => '/some/uri', 'account' => null));
     $card->debit(9911, 'BAL*TANG', 'something tangy');
 }