function testGetBuyer() { $buyer1 = self::_createBuyer(); $buyer2 = Account::get($buyer1->uri); $this->assertEquals($buyer1->id, $buyer2->id); }
/** * Find or create a role-less account by email address. You can later turn * this into a buyer by adding a funding source (e.g a card) or a merchant * using \Balanced\Account->promoteToMerchant. * * @param string email_address Email address. There can only be one account with this email address. * * @return \Balanced\Account */ function findOrCreateAccountByEmailAddress($email_address) { $marketplace = Marketplace::mine(); try { $account = $this->accounts->create(array('email_address' => $email_address)); } catch (Errors\DuplicateAccountEmailAddress $e) { $account = Account::get($e->extras->account_uri); } return $account; }