examples/examples.rb in balanced-0.2.5 vs examples/examples.rb in balanced-0.3.0
- old
+ new
@@ -4,10 +4,20 @@
Balanced::Card
rescue NameError
raise "wtf"
end
+host = ENV['BALANCED_HOST'] or nil
+options = {}
+if host then
+ options[:scheme] = 'http'
+ options[:host] = host
+ options[:port] = 5000
+end
+
+Balanced.configure(nil, options)
+
puts "create our new api key"
api_key = Balanced::ApiKey.new.save
puts "Our secret is: ", api_key.secret
puts "configure with our secret #{api_key}"
@@ -97,8 +107,14 @@
puts "ok lets invalid a card"
card['is_valid'] = false
card.save
-raise "This card is NOT VALID" if card.is_valid
+raise "This card is INCORRECTLY VALID" if card.is_valid
-puts "and there you have it :)"
\ No newline at end of file
+puts "invalidating a bank account"
+bank_account['is_valid'] = false
+bank_account.save
+
+raise "This card is INCORRECTLY VALID" if bank_account.is_valid
+
+puts "and there you have it :)"