<?php

require __DIR__ . '/vendor/autoload.php';
Httpful\Bootstrap::init();
RESTful\Bootstrap::init();
Balanced\Bootstrap::init();
Balanced\Settings::$api_key = "ak-test-22IOkhevjZlmRP2do6CZixkkDshTiOjTV";
$api_key = Balanced\APIKey::get("/api_keys/AK3DgZwSCD2ggxGSw1bsiyDX");
$api_key->unstore();
<?php

//
// Create, verify, and debit a bank account.
//
require __DIR__ . '/vendor/autoload.php';
Httpful\Bootstrap::init();
RESTful\Bootstrap::init();
Balanced\Bootstrap::init();
// Create a new marketplace
$key = new Balanced\APIKey();
$key->save();
Balanced\Settings::$api_key = $key->secret;
$marketplace = new Balanced\Marketplace();
$marketplace->save();
// Create a bank account
$bank_account = new \Balanced\BankAccount(array("account_number" => "9900000001", "name" => "Johann Bernoulli", "routing_number" => "121000358", "type" => "checking"));
$bank_account->save();
print "The BankAccount: " . $bank_account->uri;
// Create a Customer
$customer = new \Balanced\Customer(array("name" => "William Henry Cavendish III", "email" => "*****@*****.**"));
$customer->save();
// Add the bank account to the Customer
$customer->addBankAccount($bank_account);
print "You can't debit from a bank account until you verify it\n";
try {
    $customer->debit(100);
} catch (Exception $e) {
    printf("Debit failed, %s\n", $e->description);
}
// Initiate a bank account verification
Example #3
0
<?php

require __DIR__ . '/vendor/autoload.php';
Httpful\Bootstrap::init();
RESTful\Bootstrap::init();
Balanced\Bootstrap::init();
Balanced\Settings::$api_key = "ak-test-2eKlj1ZDfAcZSARMf3NMhBHywDej0avSY";
$api_key = Balanced\APIKey::get("/api_keys/AK3DQGzROuoRYulKXMQdHBxX");
$api_key->unstore();