Beispiel #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;
     }
     \infiniteLabs\BalancedPayments\Resource::init();
     \infiniteLabs\BalancedPayments\APIKey::init();
     \infiniteLabs\BalancedPayments\Marketplace::init();
     \infiniteLabs\BalancedPayments\Credit::init();
     \infiniteLabs\BalancedPayments\Debit::init();
     \infiniteLabs\BalancedPayments\Refund::init();
     \infiniteLabs\BalancedPayments\Reversal::init();
     \infiniteLabs\BalancedPayments\Card::init();
     \infiniteLabs\BalancedPayments\BankAccount::init();
     \infiniteLabs\BalancedPayments\BankAccountVerification::init();
     \infiniteLabs\BalancedPayments\CardHold::init();
     \infiniteLabs\BalancedPayments\Callback::init();
     \infiniteLabs\BalancedPayments\Event::init();
     \infiniteLabs\BalancedPayments\Customer::init();
     \infiniteLabs\BalancedPayments\Order::init();
     \infiniteLabs\BalancedPayments\Dispute::init();
     self::$initialized = true;
 }
Beispiel #2
0
 /**
  * Credit an unstored bank account.
  *
  * @param int amount Amount to credit in USD pennies.
  * @param mixed bank_account Associative array describing a bank account to credit. The bank account will *not* be stored.
  * @param string description Optional description of the credit.
  *
  * @return \infiniteLabs\BalancedPayments\Credit
  *
  * <code>
  * $bank_account_info = array(
  *   "account_number" => "9900000001",
  *   "name" => "Johann Bernoulli",
  *   "routing_number" => "121000358",
  *   "type" => "checking",
  * );
  * $credit = infiniteLabs\BalancedPayments\Credit::bankAccount(
  *   10000,
  *   $bank_account_info
  * );
  * </code>
  */
 public static function bankAccount($amount, $bank_account, $description = null)
 {
     $credit = new Credit(array('amount' => $amount, 'destination' => $bank_account, 'description' => $description));
     $credit->save();
     return $credit;
 }