uri; return; } catch (Balanced\Errors\Error $e) { echo $e->getMessage(); return; } } } function create_buyer($email_address, $card_uri) { $marketplace = Balanced\Marketplace::mine(); try { # new buyer $buyer = $marketplace->createBuyer( $email_address, $card_uri); } catch (Balanced\Errors\DuplicateAccountEmailAddress $e) { # oops, account for $email_address already exists so just add the card $buyer = Balanced\Account::get($e->extras->account_uri); $buyer->addCard($card_uri); } return $buyer; } ?>