Skip to content

Commit

Permalink
cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewfl committed Mar 7, 2014
1 parent 6d1959d commit 91f541d
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 255 deletions.
2 changes: 1 addition & 1 deletion src/Balanced/APIKey.php
Expand Up @@ -45,7 +45,7 @@
*/
class APIKey extends Resource
{
//protected static $_uri_spec = null;
protected static $_uri_spec = null;

public static function init()
{
Expand Down
26 changes: 0 additions & 26 deletions src/Balanced/BankAccount.php
Expand Up @@ -56,22 +56,6 @@ public function credit(
$appears_on_statement_as = null,
$order = null)
{
/* if (!property_exists($this, 'account') || $this->account == null) { */
/* $credit = $this->credits->create(array( */
/* 'amount' => $amount, */
/* 'description' => $description, */
/* )); */
/* } else { */
/* $credit = $this->account->credit( */
/* $amount, */
/* $description, */
/* $meta, */
/* $this->uri, */
/* $appears_on_statement_as */
/* ); */
/* } */
/* return $credit; */

return $this->credits->create(array(
'amount' => $amount,
'description' => $description,
Expand Down Expand Up @@ -117,9 +101,6 @@ public function verify()
$response->body->bank_account_verifications[0],
$response->body->links);
return $verification;
//print_r($this);
//return $this->bank_account_verifications->create();
//return $this->bank_account_verifications->create();
}

public function confirm($amount_1, $amount_2)
Expand All @@ -131,14 +112,7 @@ public function confirm($amount_1, $amount_2)
public function invalidate()
{
return $this->unstore();
/* $this->is_valid = False; */
/* return $this->save(); */
}

/* public function unstore() */
/* { */
/* return $this->delete(); */
/* } */
}

/**
Expand Down
2 changes: 0 additions & 2 deletions src/Balanced/Bootstrap.php
Expand Up @@ -59,7 +59,6 @@ private static function initializeResources()

\Balanced\APIKey::init();
\Balanced\Marketplace::init();
//\Balanced\Account::init();
\Balanced\Credit::init();
\Balanced\Debit::init();
\Balanced\Refund::init();
Expand All @@ -68,7 +67,6 @@ private static function initializeResources()
\Balanced\BankAccount::init();
\Balanced\BankAccountVerification::init();
\Balanced\Hold::init();
//\Balanced\Merchant::init();
\Balanced\Callback::init();
\Balanced\Event::init();
\Balanced\Customer::init();
Expand Down
10 changes: 0 additions & 10 deletions src/Balanced/Card.php
Expand Up @@ -49,16 +49,6 @@ public function debit(
'meta' => $meta,
'order' => $order
));

/* if ($this->account == null) { */
/* throw new \UnexpectedValueException('Card is not associated with an account.'); */
/* } */
/* return $this->account->debit( */
/* $amount, */
/* $appears_on_statement_as, */
/* $description, */
/* $meta, */
/* $this->uri); */
}

public function hold(
Expand Down
188 changes: 0 additions & 188 deletions src/Balanced/Customer.php
Expand Up @@ -44,192 +44,4 @@ public static function init()
self::$_registry->add(get_called_class());
}

/* /\** */
/* * Creates or associates a created card with the account. The default */
/* * funding source for the account will be this card. */
/* * */
/* * @see \Balanced\Marketplace->createCard */
/* * */
/* * @param mixed card \Balanced\Card or URI referencing a card to associate with the account. Alternatively it can be an associative array describing a card to create and associate with the account. */
/* * */
/* * @return \Balanced\Account */
/* *\/ */
/* public function addCard($card) */
/* { */
/* if (is_string($card)) */
/* $this->card_uri = $card; */
/* else if (is_array($card)) */
/* $this->card = $card; */
/* else */
/* $this->card_uri = $card->uri; */
/* return $this->save(); */
/* } */

/* /\** */
/* * Retieves the most recently added, active \Balanced\Card or null if this */
/* * customer has no active cards. */
/* * */
/* * @return \Balanced\Card */
/* *\/ */
/* public function activeCard() */
/* { */
/* $card = ( */
/* $this->cards->query() */
/* ->filter(Card::$f->is_valid->eq(True)) */
/* ->sort(Card::$f->created_at->desc()) */
/* ->first() */
/* ); */
/* return $card; */
/* } */


/* /\** */
/* * Creates or associates a created bank account with the account. The */
/* * new default funding destination for the account will be this bank account. */
/* * */
/* * @see \Balanced\Marketplace->createBankAccount */
/* * */
/* * @param mixed bank_account \Balanced\BankAccount or URI for a bank account to associate with the account. Alternatively it can be an associative array describing a bank account to create and associate with the account. */
/* * */
/* * @return \Balanced\Account */
/* *\/ */
/* public function addBankAccount($bank_account) */
/* { */
/* if (is_string($bank_account)) */
/* $this->bank_account_uri = $bank_account; */
/* else if (is_array($bank_account)) */
/* $this->bank_account = $bank_account; */
/* else */
/* $this->bank_account_uri = $bank_account->uri; */
/* return $this->save(); */
/* } */

/* /\** */
/* * Retrieves the most recently added, active \Balanced\BankAccount or null */
/* * if this customer has no active bank accounts. */
/* * */
/* * @return \Balanced\BankAccount */
/* *\/ */
/* public function activeBankAccount() */
/* { */
/* $bank_account = ( */
/* $this->bank_accounts->query() */
/* ->filter(BankAccount::$f->is_valid->eq(True)) */
/* ->sort(BankAccount::$f->created_at->desc()) */
/* ->first() */
/* ); */
/* return $bank_account; */
/* } */

/* /\** */
/* * Transfer money from this Customer to your Marketplace's escrow account. */
/* * */
/* * @param int amount Amount to debit in cents, must be >= 50. */
/* * @param appears_on_statement_as Description of the payment as it needs */
/* * to appear on this customer's statement. */
/* * @param array[string]string Key/value collection. */
/* * @param string description Human readable description. */
/* * @param mixed source A specific funding source, such as a `Card`, */
/* * associated with this customer. If not specified */
/* * the `Card` most recently added to this */
/* * \Balanced\Customer is used. */
/* * @param mixed on_behalf_of The \Balanced\Customer providing the service */
/* * or delivering the */
/* * */
/* * @return \Balanced\Debit */
/* *\/ */
/* public function debit( */
/* $amount = null, */
/* $appears_on_statement_as = null, */
/* $meta = null, */
/* $description = null, */
/* $source = null, */
/* $on_behalf_of = null) */
/* { */
/* if ($on_behalf_of == null) { */
/* $on_behalf_of_uri = null; */
/* } else if (is_string($on_behalf_of)) { */
/* $on_behalf_of_uri = $on_behalf_of; */
/* } else { */
/* $on_behalf_of_uri = $on_behalf_of->uri; */
/* } */

/* if ($source == null) { */
/* $source_uri = null; */
/* } else if (is_string($source)) { */
/* $source_uri = $source; */
/* } else { */
/* $source_uri = $source->uri; */
/* } */

/* if (isset($this->uri) && $on_behalf_of_uri == $this->uri) */
/* throw new \InvalidArgumentException( */
/* 'The on_behalf_of parameter MAY NOT be the same account as the account you are debiting!' */
/* ); */

/* return $this->debits->create(array( */
/* 'amount' => $amount, */
/* 'description' => $description, */
/* 'meta' => $meta, */
/* 'source_uri' => $source_uri, */
/* 'on_behalf_of_uri' => $on_behalf_of_uri, */
/* 'appears_on_statement_as' => $appears_on_statement_as */
/* )); */
/* } */

/* /\** */
/* * Transfer money from your Marketplace's escrow account to this Customer. */
/* * */
/* * @param int amount Amount to credit in cents. */
/* * @param string description Human readable description. */
/* * @param array[string]string meta Key/value collection. */
/* * @param string destination A specific funding destination, such as a */
/* * \Balanced\BankAccount, associated with this */
/* * customer. */
/* * @param string appears_on_statement_as Description of the payment as it */
/* * needs. */
/* * @param mixed debit The \Balanced\Debit corresponding to this particular */
/* * credit. */
/* * */
/* * @return \Balanced\Credit */
/* *\/ */
/* public function credit( */
/* $amount = null, */
/* $description = null, */
/* $meta = null, */
/* $destination = null, */
/* $appears_on_statement_as = null, */
/* $debit = null) */
/* { */
/* if ($destination == null) { */
/* $destination_uri = null; */
/* } else if (is_string($destination)) { */
/* $destination_uri = $destination; */
/* } else { */
/* $destination_uri = $destination->uri; */
/* } */

/* if ($debit == null) { */
/* $debit_uri = null; */
/* } else if (is_string($debit)) { */
/* $debit_uri = $debit; */
/* } else { */
/* $debit_uri = $debit->uri; */
/* } */

/* return $this->credits->create(array( */
/* 'amount' => $amount, */
/* 'description' => $description, */
/* 'meta' => $meta, */
/* 'destination_uri' => $destination_uri, */
/* 'appears_on_statement_as' => $appears_on_statement_as, */
/* 'debit_uri' => $debit_uri */
/* )); */
/* } */


/* public function unstore() */
/* { */
/* return $this->delete(); */
/* } */
}
2 changes: 1 addition & 1 deletion src/Balanced/Debit.php
Expand Up @@ -9,7 +9,7 @@
* Represents an account debit transaction.
*
* <code>
* $customer->debit(
* $card->debit(
* "5000",
* "Statement text",
* null,
Expand Down
12 changes: 0 additions & 12 deletions src/Balanced/Hold.php
Expand Up @@ -45,14 +45,7 @@ public function void()
{
$this->unstore();

//print_r($resp);
//$this->voided_at = $resp->voided_at;
//$this->_objectify($this->unstore());
return $this;
//$this->is_void = true;

/* $this->is_void = true; */
/* return $this->save(); */
}

/**
Expand All @@ -71,10 +64,5 @@ public function capture($amount = null)
return $this->debit = $this->debits->create(array(
'amount' => $amount
));
/* $this->debit = $this->account->debits->create(array( */
/* 'hold_uri' => $this->uri, */
/* 'amount' => $amount, */
/* )); */
/* return $this->debit; */
}
}
14 changes: 0 additions & 14 deletions src/Balanced/Marketplace.php
Expand Up @@ -163,15 +163,6 @@ function findOrCreateCustomerByEmailAddress($email_address)
return $customer;
}
return $this->createCustomer($email_address);
/* try { */
/* $account = $this->accounts->create(array( */
/* 'email_address' => $email_address */
/* )); */
/* } */
/* catch (Errors\DuplicateAccountEmailAddress $e) { */
/* $account = Account::get($e->extras->account_uri); */
/* } */
/* return $account; */
}

/**
Expand All @@ -192,7 +183,6 @@ public function createBuyer(
{
$customer = $this->customers->create(array(
'email' => $email_address,
//'card_uri' => $card_uri,
'meta' => $meta,
'name' => $name
));
Expand Down Expand Up @@ -309,15 +299,11 @@ public function createMerchant(
$email_address = null,
$merchant = null,
$bank_account_href = null,
//$merchant_uri = null,
$name = null,
$meta = null)
{
$params = array(
'email_address' => $email_address,
//'merchant' => $merchant,
//'merchant_uri' => $merchant_uri,
//'bank_account_uri' => $bank_account_uri,
'name' => $name,
'meta' => $meta,
);
Expand Down
1 change: 0 additions & 1 deletion src/Balanced/Resource.php
Expand Up @@ -20,7 +20,6 @@ public static function init()

public static function convertError($response)
{
//if (property_exists($response->body, 'category_code'))
if (property_exists($response->body, 'errors'))
$error = Error::createFromResponse($response);
else
Expand Down

0 comments on commit 91f541d

Please sign in to comment.