examples/examples.rb in balanced-0.7.5 vs examples/examples.rb in balanced-0.8.1
- old
+ new
@@ -1,7 +1,8 @@
-cwd = File.dirname(File.dirname(File.absolute_path(__FILE__)))
+cwd = File.dirname(File.dirname(File.expand_path(__FILE__)))
$:.unshift(cwd + "/lib")
+require 'rubygems'
require 'balanced'
begin
Balanced::Card
rescue NameError
@@ -50,11 +51,11 @@
puts "cool! let's create a new card."
card = Balanced::Card.new(
:card_number => "5105105105105100",
:expiration_month => "12",
- :expiration_year => "2015",
+ :expiration_year => "2015"
).save
puts "Our card uri: #{card.uri}"
puts "create our **buyer** account"
buyer = marketplace.create_buyer(
@@ -81,11 +82,11 @@
"first, lets create their bank account."
bank_account = marketplace.create_bank_account(
:account_number => "1234567890",
:routing_number => "322271627",
- :name => "Jack Q Merchant",
+ :name => "Jack Q Merchant"
)
merchant = marketplace.create_merchant(
:email_address => "merchant@example.org",
:merchant => {
@@ -93,13 +94,13 @@
:name => "Billy Jones",
:street_address => "801 High St.",
:postal_code => "94301",
:country => "USA",
:dob => "1842-01",
- :phone_number => "+16505551234",
+ :phone_number => "+16505551234"
},
:bank_account_uri => bank_account.uri,
- :name => "Jack Q Merchant",
+ :name => "Jack Q Merchant"
)
puts "oh our buyer is interested in buying something for 530.00$"
another_debit = buyer.debit(
:amount => 53000,