balanced 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -1
- data/.travis.yml +1 -0
- data/CONTRIBUTORS +3 -1
- data/README.md +19 -3
- data/Rakefile +17 -0
- data/examples/customers.rb +1 -1
- data/lib/balanced/resources.rb +1 -1
- data/lib/balanced/resources/credit.rb +18 -0
- data/lib/balanced/resources/invoice.rb +11 -0
- data/lib/balanced/resources/marketplace.rb +3 -1
- data/lib/balanced/resources/reversal.rb +20 -0
- data/lib/balanced/resources/transaction.rb +1 -2
- data/lib/balanced/version.rb +1 -1
- data/scenario.cache +540 -0
- data/scenarios/account_add_card/definition.rb +1 -0
- data/scenarios/account_add_card/request.rb +3 -0
- data/scenarios/account_add_card/ruby.mako +11 -0
- data/scenarios/account_capture_hold/definition.rb +1 -0
- data/scenarios/account_capture_hold/request.rb +3 -0
- data/scenarios/account_capture_hold/ruby.mako +11 -0
- data/scenarios/account_create/definition.rb +1 -0
- data/scenarios/account_create/request.rb +2 -0
- data/scenarios/account_create/ruby.mako +10 -0
- data/scenarios/account_create_buyer/definition.rb +1 -0
- data/scenarios/account_create_buyer/request.rb +4 -0
- data/scenarios/account_create_buyer/ruby.mako +12 -0
- data/scenarios/account_create_debit/definition.rb +1 -0
- data/scenarios/account_create_debit/request.rb +3 -0
- data/scenarios/account_create_debit/ruby.mako +11 -0
- data/scenarios/account_create_hold/definition.rb +1 -0
- data/scenarios/account_create_hold/request.rb +3 -0
- data/scenarios/account_create_hold/ruby.mako +11 -0
- data/scenarios/account_create_merchant/definition.rb +1 -0
- data/scenarios/account_create_merchant/request.rb +3 -0
- data/scenarios/account_create_merchant/ruby.mako +11 -0
- data/scenarios/account_underwrite_business/definition.rb +1 -0
- data/scenarios/account_underwrite_business/request.rb +19 -0
- data/scenarios/account_underwrite_business/ruby.mako +27 -0
- data/scenarios/account_underwrite_person/definition.rb +1 -0
- data/scenarios/account_underwrite_person/request.rb +18 -0
- data/scenarios/account_underwrite_person/ruby.mako +26 -0
- data/scenarios/bank_account_create/definition.rb +1 -0
- data/scenarios/bank_account_create/request.rb +4 -0
- data/scenarios/bank_account_create/ruby.mako +12 -0
- data/scenarios/bank_account_delete/definition.rb +1 -0
- data/scenarios/bank_account_delete/request.rb +3 -0
- data/scenarios/bank_account_delete/ruby.mako +11 -0
- data/scenarios/bank_account_find_and_credit/definition.rb +1 -0
- data/scenarios/bank_account_find_and_credit/request.rb +5 -0
- data/scenarios/bank_account_find_and_credit/ruby.mako +13 -0
- data/scenarios/bank_account_find_and_delete/definition.rb +1 -0
- data/scenarios/bank_account_find_and_delete/request.rb +3 -0
- data/scenarios/bank_account_find_and_delete/ruby.mako +10 -0
- data/scenarios/bank_account_invalid_routing_number/definition.rb +1 -0
- data/scenarios/bank_account_invalid_routing_number/request.rb +8 -0
- data/scenarios/bank_account_invalid_routing_number/ruby.mako +16 -0
- data/scenarios/bank_account_list/definition.rb +1 -0
- data/scenarios/bank_account_list/request.rb +2 -0
- data/scenarios/bank_account_list/ruby.mako +10 -0
- data/scenarios/bank_account_show/definition.rb +1 -0
- data/scenarios/bank_account_show/request.rb +2 -0
- data/scenarios/bank_account_show/ruby.mako +10 -0
- data/scenarios/bank_account_verification_create/definition.rb +1 -0
- data/scenarios/bank_account_verification_create/request.rb +3 -0
- data/scenarios/bank_account_verification_create/ruby.mako +11 -0
- data/scenarios/bank_account_verification_show/definition.rb +1 -0
- data/scenarios/bank_account_verification_show/request.rb +2 -0
- data/scenarios/bank_account_verification_show/ruby.mako +10 -0
- data/scenarios/bank_account_verification_update/definition.rb +1 -0
- data/scenarios/bank_account_verification_update/request.rb +7 -0
- data/scenarios/bank_account_verification_update/ruby.mako +17 -0
- data/scenarios/callback_create/definition.rb +1 -0
- data/scenarios/callback_create/request.rb +4 -0
- data/scenarios/callback_create/ruby.mako +0 -0
- data/scenarios/callback_delete/definition.rb +1 -0
- data/scenarios/callback_delete/request.rb +3 -0
- data/scenarios/callback_delete/ruby.mako +0 -0
- data/scenarios/callback_list/definition.rb +1 -0
- data/scenarios/callback_list/request.rb +3 -0
- data/scenarios/callback_list/ruby.mako +0 -0
- data/scenarios/callback_show/definition.rb +1 -0
- data/scenarios/callback_show/request.rb +2 -0
- data/scenarios/callback_show/ruby.mako +0 -0
- data/scenarios/card_create/definition.rb +1 -0
- data/scenarios/card_create/request.rb +5 -0
- data/scenarios/card_create/ruby.mako +13 -0
- data/scenarios/card_invalidate/definition.rb +1 -0
- data/scenarios/card_invalidate/request.rb +3 -0
- data/scenarios/card_invalidate/ruby.mako +10 -0
- data/scenarios/card_list/definition.rb +1 -0
- data/scenarios/card_list/request.rb +2 -0
- data/scenarios/card_list/ruby.mako +9 -0
- data/scenarios/card_show/definition.rb +1 -0
- data/scenarios/card_show/request.rb +2 -0
- data/scenarios/card_show/ruby.mako +9 -0
- data/scenarios/card_update/definition.rb +1 -0
- data/scenarios/card_update/request.rb +6 -0
- data/scenarios/card_update/ruby.mako +14 -0
- data/scenarios/credit_account_list/definition.rb +1 -0
- data/scenarios/credit_account_list/request.rb +3 -0
- data/scenarios/credit_account_list/ruby.mako +10 -0
- data/scenarios/credit_account_merchant_create/definition.rb +1 -0
- data/scenarios/credit_account_merchant_create/request.rb +5 -0
- data/scenarios/credit_account_merchant_create/ruby.mako +12 -0
- data/scenarios/credit_bank_account_list/definition.rb +1 -0
- data/scenarios/credit_bank_account_list/request.rb +5 -0
- data/scenarios/credit_bank_account_list/ruby.mako +12 -0
- data/scenarios/credit_create_existing_bank_account/definition.rb +1 -0
- data/scenarios/credit_create_existing_bank_account/request.rb +5 -0
- data/scenarios/credit_create_existing_bank_account/ruby.mako +12 -0
- data/scenarios/credit_create_new_bank_account/definition.rb +1 -0
- data/scenarios/credit_create_new_bank_account/request.rb +10 -0
- data/scenarios/credit_create_new_bank_account/ruby.mako +18 -0
- data/scenarios/credit_customer_list/definition.rb +1 -0
- data/scenarios/credit_customer_list/request.rb +4 -0
- data/scenarios/credit_customer_list/ruby.mako +12 -0
- data/scenarios/credit_failed_state/definition.rb +1 -0
- data/scenarios/credit_failed_state/request.rb +10 -0
- data/scenarios/credit_failed_state/ruby.mako +18 -0
- data/scenarios/credit_list/definition.rb +1 -0
- data/scenarios/credit_list/request.rb +4 -0
- data/scenarios/credit_list/ruby.mako +11 -0
- data/scenarios/credit_paid_state/definition.rb +1 -0
- data/scenarios/credit_paid_state/request.rb +11 -0
- data/scenarios/credit_paid_state/ruby.mako +19 -0
- data/scenarios/credit_pending_state/definition.rb +1 -0
- data/scenarios/credit_pending_state/request.rb +9 -0
- data/scenarios/credit_pending_state/ruby.mako +17 -0
- data/scenarios/credit_show/definition.rb +1 -0
- data/scenarios/credit_show/request.rb +4 -0
- data/scenarios/credit_show/ruby.mako +11 -0
- data/scenarios/customer_add_bank_account/definition.rb +1 -0
- data/scenarios/customer_add_bank_account/request.rb +3 -0
- data/scenarios/customer_add_bank_account/ruby.mako +11 -0
- data/scenarios/customer_add_card/definition.rb +1 -0
- data/scenarios/customer_add_card/request.rb +3 -0
- data/scenarios/customer_add_card/ruby.mako +11 -0
- data/scenarios/customer_capture_hold/definition.rb +1 -0
- data/scenarios/customer_capture_hold/request.rb +3 -0
- data/scenarios/customer_capture_hold/ruby.mako +0 -0
- data/scenarios/customer_create/definition.rb +1 -0
- data/scenarios/customer_create/request.rb +2 -0
- data/scenarios/customer_create/ruby.mako +10 -0
- data/scenarios/customer_create_debit/definition.rb +1 -0
- data/scenarios/customer_create_debit/request.rb +3 -0
- data/scenarios/customer_create_debit/ruby.mako +11 -0
- data/scenarios/customer_create_hold/definition.rb +1 -0
- data/scenarios/customer_create_hold/request.rb +3 -0
- data/scenarios/customer_create_hold/ruby.mako +11 -0
- data/scenarios/customer_credit/definition.rb +1 -0
- data/scenarios/customer_credit/request.rb +2 -0
- data/scenarios/customer_credit/ruby.mako +8 -0
- data/scenarios/debit_account_list/definition.rb +1 -0
- data/scenarios/debit_account_list/request.rb +3 -0
- data/scenarios/debit_account_list/ruby.mako +10 -0
- data/scenarios/debit_create/definition.rb +1 -0
- data/scenarios/debit_create/request.rb +3 -0
- data/scenarios/debit_create/ruby.mako +11 -0
- data/scenarios/debit_customer_list/definition.rb +1 -0
- data/scenarios/debit_customer_list/request.rb +4 -0
- data/scenarios/debit_customer_list/ruby.mako +12 -0
- data/scenarios/debit_list/definition.rb +1 -0
- data/scenarios/debit_list/request.rb +4 -0
- data/scenarios/debit_list/ruby.mako +11 -0
- data/scenarios/debit_refund/definition.rb +1 -0
- data/scenarios/debit_refund/request.rb +3 -0
- data/scenarios/debit_refund/ruby.mako +10 -0
- data/scenarios/debit_show/definition.rb +1 -0
- data/scenarios/debit_show/request.rb +2 -0
- data/scenarios/debit_show/ruby.mako +10 -0
- data/scenarios/debit_update/definition.rb +1 -0
- data/scenarios/debit_update/request.rb +5 -0
- data/scenarios/debit_update/ruby.mako +13 -0
- data/scenarios/delete.rb +7 -0
- data/scenarios/event_list/definition.rb +1 -0
- data/scenarios/event_list/request.rb +3 -0
- data/scenarios/event_list/ruby.mako +10 -0
- data/scenarios/event_replay/definition.rb +0 -0
- data/scenarios/event_replay/request.rb +1 -0
- data/scenarios/event_replay/ruby.mako +0 -0
- data/scenarios/event_show/definition.rb +1 -0
- data/scenarios/event_show/request.rb +2 -0
- data/scenarios/event_show/ruby.mako +10 -0
- data/scenarios/execute.rb +27 -0
- data/scenarios/helpers.rb +15 -0
- data/scenarios/hold_account_list/definition.rb +1 -0
- data/scenarios/hold_account_list/request.rb +3 -0
- data/scenarios/hold_account_list/ruby.mako +10 -0
- data/scenarios/hold_capture/definition.rb +1 -0
- data/scenarios/hold_capture/request.rb +5 -0
- data/scenarios/hold_capture/ruby.mako +13 -0
- data/scenarios/hold_create/definition.rb +1 -0
- data/scenarios/hold_create/request.rb +5 -0
- data/scenarios/hold_create/ruby.mako +13 -0
- data/scenarios/hold_customer_list/definition.rb +1 -0
- data/scenarios/hold_customer_list/request.rb +3 -0
- data/scenarios/hold_customer_list/ruby.mako +11 -0
- data/scenarios/hold_list/definition.rb +1 -0
- data/scenarios/hold_list/request.rb +4 -0
- data/scenarios/hold_list/ruby.mako +11 -0
- data/scenarios/hold_show/definition.rb +1 -0
- data/scenarios/hold_show/request.rb +2 -0
- data/scenarios/hold_show/ruby.mako +10 -0
- data/scenarios/hold_update/definition.rb +1 -0
- data/scenarios/hold_update/request.rb +5 -0
- data/scenarios/hold_update/ruby.mako +13 -0
- data/scenarios/hold_void/definition.rb +1 -0
- data/scenarios/hold_void/request.rb +3 -0
- data/scenarios/hold_void/ruby.mako +10 -0
- data/scenarios/refund_account_list/definition.rb +1 -0
- data/scenarios/refund_account_list/request.rb +3 -0
- data/scenarios/refund_account_list/ruby.mako +10 -0
- data/scenarios/refund_create/definition.rb +1 -0
- data/scenarios/refund_create/request.rb +6 -0
- data/scenarios/refund_create/ruby.mako +14 -0
- data/scenarios/refund_customer_list/definition.rb +1 -0
- data/scenarios/refund_customer_list/request.rb +3 -0
- data/scenarios/refund_list/definition.rb +1 -0
- data/scenarios/refund_list/request.rb +4 -0
- data/scenarios/refund_list/ruby.mako +11 -0
- data/scenarios/refund_show/definition.rb +1 -0
- data/scenarios/refund_show/request.rb +2 -0
- data/scenarios/refund_show/ruby.mako +10 -0
- data/scenarios/refund_update/definition.rb +1 -0
- data/scenarios/refund_update/request.rb +5 -0
- data/scenarios/refund_update/ruby.mako +13 -0
- data/scenarios/render.rb +32 -0
- data/scenarios/render_mako.rb +43 -0
- data/scenarios/render_one.rb +32 -0
- data/spec/balanced/resources/credit_spec.rb +23 -0
- data/spec/scenarios_spec.rb +39 -0
- data/spec/spec_helper.rb +2 -1
- metadata +237 -11
- checksums.yaml +0 -7
@@ -0,0 +1 @@
|
|
1
|
+
Balanced::Account.add_card
|
@@ -0,0 +1,11 @@
|
|
1
|
+
% if mode == 'definition':
|
2
|
+
Balanced::Account.add_card
|
3
|
+
|
4
|
+
% else:
|
5
|
+
require 'balanced'
|
6
|
+
Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
|
7
|
+
|
8
|
+
account = Balanced::Account.find('/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/accounts/AC4FqqEyFyTcd3eHhh2YXL4c')
|
9
|
+
response = account.add_card('/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/cards/CC4GL1SYTyLy6nW6nf4kWw0w')
|
10
|
+
|
11
|
+
% endif
|
@@ -0,0 +1 @@
|
|
1
|
+
Balanced::Account.debit
|
@@ -0,0 +1,11 @@
|
|
1
|
+
% if mode == 'definition':
|
2
|
+
Balanced::Account.debit
|
3
|
+
|
4
|
+
% else:
|
5
|
+
require 'balanced'
|
6
|
+
Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
|
7
|
+
|
8
|
+
account = Balanced::Account.find('/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/accounts/AC6jdot989BbUks8LFIdRVcX/debits')
|
9
|
+
account.debit(:amount => '1000', :hold_uri => '/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/holds/HL6t6iMvY9Touhig2PZnCOHk')
|
10
|
+
|
11
|
+
% endif
|
@@ -0,0 +1 @@
|
|
1
|
+
Balanced::Account.new
|
@@ -0,0 +1 @@
|
|
1
|
+
Balanced::Marketplace.create_buyer
|
@@ -0,0 +1,12 @@
|
|
1
|
+
% if mode == 'definition':
|
2
|
+
Balanced::Marketplace.create_buyer
|
3
|
+
|
4
|
+
% else:
|
5
|
+
require 'balanced'
|
6
|
+
Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
|
7
|
+
|
8
|
+
|
9
|
+
buyer = Balanced::Marketplace.my_marketplace.create_buyer(
|
10
|
+
:card_uri => '/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/cards/CC6iQ3QzBhyegVguKpz9ooAi',)
|
11
|
+
|
12
|
+
% endif
|
@@ -0,0 +1 @@
|
|
1
|
+
Balanced::Account.debit
|
@@ -0,0 +1,11 @@
|
|
1
|
+
% if mode == 'definition':
|
2
|
+
Balanced::Account.debit
|
3
|
+
|
4
|
+
% else:
|
5
|
+
require 'balanced'
|
6
|
+
Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
|
7
|
+
|
8
|
+
account = Balanced::Account.find('/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/accounts/AC6jdot989BbUks8LFIdRVcX/debits')
|
9
|
+
account.debit(:amount => '1000')
|
10
|
+
|
11
|
+
% endif
|
@@ -0,0 +1 @@
|
|
1
|
+
Balanced::Account.hold
|
@@ -0,0 +1,11 @@
|
|
1
|
+
% if mode == 'definition':
|
2
|
+
Balanced::Account.hold
|
3
|
+
|
4
|
+
% else:
|
5
|
+
require 'balanced'
|
6
|
+
Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
|
7
|
+
|
8
|
+
account = Balanced::Account.find('/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/accounts/AC6jdot989BbUks8LFIdRVcX')
|
9
|
+
account.hold(:amount => '1000')
|
10
|
+
|
11
|
+
% endif
|
@@ -0,0 +1 @@
|
|
1
|
+
Balanced::Account.add_bank_account
|
@@ -0,0 +1,11 @@
|
|
1
|
+
% if mode == 'definition':
|
2
|
+
Balanced::Account.add_bank_account
|
3
|
+
|
4
|
+
% else:
|
5
|
+
require 'balanced'
|
6
|
+
Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
|
7
|
+
|
8
|
+
account = Balanced::Account.find('/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/accounts/AC4FqqEyFyTcd3eHhh2YXL4c')
|
9
|
+
account.add_bank_account("/v1/bank_accounts/BA4JrubjRE0vqvWWDBB5Kv1w")
|
10
|
+
|
11
|
+
% endif
|
@@ -0,0 +1 @@
|
|
1
|
+
Balanced::Account.promote_to_merchant
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<%= boiler_plate %>
|
2
|
+
|
3
|
+
merchant_data = {
|
4
|
+
<%="".tap { |s| payload['merchant'].each {|k, v| s << ":#{k} => '#{v}'," unless k == 'person'} }%>
|
5
|
+
:person => {
|
6
|
+
<%= params_to_hash.call(payload['merchant']['person']) %>
|
7
|
+
}
|
8
|
+
}
|
9
|
+
account = Balanced::Marketplace.my_marketplace.create_account
|
10
|
+
|
11
|
+
begin
|
12
|
+
account.promote_to_merchant(merchant_data)
|
13
|
+
rescue Balanced::MoreInformationRequired => error
|
14
|
+
# could not identify this account.
|
15
|
+
puts 'redirect merchant to: ' + error.redirect_uri
|
16
|
+
rescue Balanced::Error => error
|
17
|
+
# TODO: handle 400 and 409 exceptions as required
|
18
|
+
raise
|
19
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
% if mode == 'definition':
|
2
|
+
Balanced::Account.promote_to_merchant
|
3
|
+
|
4
|
+
% else:
|
5
|
+
require 'balanced'
|
6
|
+
Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
|
7
|
+
|
8
|
+
|
9
|
+
merchant_data = {
|
10
|
+
:name => 'Skripts4Kids',:phone_number => '+140899188155',:postal_code => '91111',:street_address => '555 VoidMain Road',:tax_id => '211111111',:type => 'business',
|
11
|
+
:person => {
|
12
|
+
:dob => '1989-12',:name => 'Timmy Q. CopyPasta',:phone_number => '+14089999999',:postal_code => '94110',:street_address => '121 Skriptkid Row',
|
13
|
+
}
|
14
|
+
}
|
15
|
+
account = Balanced::Marketplace.my_marketplace.create_account
|
16
|
+
|
17
|
+
begin
|
18
|
+
account.promote_to_merchant(merchant_data)
|
19
|
+
rescue Balanced::MoreInformationRequired => error
|
20
|
+
# could not identify this account.
|
21
|
+
puts 'redirect merchant to: ' + error.redirect_uri
|
22
|
+
rescue Balanced::Error => error
|
23
|
+
# TODO: handle 400 and 409 exceptions as required
|
24
|
+
raise
|
25
|
+
end
|
26
|
+
|
27
|
+
% endif
|
@@ -0,0 +1 @@
|
|
1
|
+
Balanced::Account.promote_to_merchant
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<%= boiler_plate %>
|
2
|
+
marketplace = Balanced::Marketplace.my_marketplace
|
3
|
+
|
4
|
+
merchant_data = {
|
5
|
+
<%= params_to_hash.call(payload['merchant']) %>
|
6
|
+
}
|
7
|
+
|
8
|
+
account = Balanced::Marketplace.my_marketplace.create_account
|
9
|
+
|
10
|
+
begin
|
11
|
+
account.promote_to_merchant(merchant_data)
|
12
|
+
rescue Balanced::MoreInformationRequired => error
|
13
|
+
# could not identify this account.
|
14
|
+
puts 'redirect merchant to: ' + error.redirect_uri
|
15
|
+
rescue Balanced::Error => error
|
16
|
+
# TODO: handle 400 and 409 exceptions as required
|
17
|
+
raise
|
18
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
% if mode == 'definition':
|
2
|
+
Balanced::Account.promote_to_merchant
|
3
|
+
|
4
|
+
% else:
|
5
|
+
require 'balanced'
|
6
|
+
Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
|
7
|
+
|
8
|
+
marketplace = Balanced::Marketplace.my_marketplace
|
9
|
+
|
10
|
+
merchant_data = {
|
11
|
+
:dob => '1989-12',:name => 'Timmy Q. CopyPasta',:phone_number => '+14089999999',:postal_code => '94110',:street_address => '121 Skriptkid Row',:type => 'person',
|
12
|
+
}
|
13
|
+
|
14
|
+
account = Balanced::Marketplace.my_marketplace.create_account
|
15
|
+
|
16
|
+
begin
|
17
|
+
account.promote_to_merchant(merchant_data)
|
18
|
+
rescue Balanced::MoreInformationRequired => error
|
19
|
+
# could not identify this account.
|
20
|
+
puts 'redirect merchant to: ' + error.redirect_uri
|
21
|
+
rescue Balanced::Error => error
|
22
|
+
# TODO: handle 400 and 409 exceptions as required
|
23
|
+
raise
|
24
|
+
end
|
25
|
+
|
26
|
+
% endif
|
@@ -0,0 +1 @@
|
|
1
|
+
Balanced::BankAccount.save
|
@@ -0,0 +1,12 @@
|
|
1
|
+
% if mode == 'definition':
|
2
|
+
Balanced::BankAccount.save
|
3
|
+
|
4
|
+
% else:
|
5
|
+
require 'balanced'
|
6
|
+
Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
|
7
|
+
|
8
|
+
bank_account = Balanced::BankAccount.new(
|
9
|
+
:account_number => '9900000001',:name => 'Johann Bernoulli',:routing_number => '121000358',:type => 'checking',
|
10
|
+
).save
|
11
|
+
|
12
|
+
% endif
|
@@ -0,0 +1 @@
|
|
1
|
+
Balanced::BankAccount.destroy
|
@@ -0,0 +1,11 @@
|
|
1
|
+
% if mode == 'definition':
|
2
|
+
Balanced::BankAccount.destroy
|
3
|
+
|
4
|
+
% else:
|
5
|
+
require 'balanced'
|
6
|
+
Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
|
7
|
+
|
8
|
+
bank_account = Balanced::BankAccount.find('/v1/bank_accounts/BA4eTWiY1VPXkGpjaU6XPBhu')
|
9
|
+
bank_account.destroy
|
10
|
+
|
11
|
+
% endif
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
% if mode == 'definition':
|
2
|
+
|
3
|
+
|
4
|
+
% else:
|
5
|
+
require 'balanced'
|
6
|
+
Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
|
7
|
+
|
8
|
+
marketplace = Balanced::Marketplace.my_marketplace
|
9
|
+
|
10
|
+
bank_account = Balanced::BankAccount.find('/v1/bank_accounts/BA5ONs53HNn1Od9g99v0GNFJ')
|
11
|
+
bank_account.credit('1000')
|
12
|
+
|
13
|
+
% endif
|
@@ -0,0 +1 @@
|
|
1
|
+
% if request is not UNDEFINED:
|
@@ -0,0 +1 @@
|
|
1
|
+
Balanced::BadRequest
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<%= boiler_plate %>
|
2
|
+
bank_account = Balanced::BankAccount.new( :uri => '<%=request['uri']%>', <%= payload.map {|k,v| ":#{k} => '#{v}'"}.join(",") %>)
|
3
|
+
|
4
|
+
begin
|
5
|
+
bank_account.save
|
6
|
+
rescue Balanced::BadRequest => ex
|
7
|
+
raise "Key is not returned!" unless ex.extras.has_key? "routing_number"
|
8
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
% if mode == 'definition':
|
2
|
+
Balanced::BadRequest
|
3
|
+
|
4
|
+
% else:
|
5
|
+
require 'balanced'
|
6
|
+
Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
|
7
|
+
|
8
|
+
bank_account = Balanced::BankAccount.new( :uri => '/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/bank_accounts', :account_number => '9900000001',:name => 'Johann Bernoulli',:routing_number => '100000007',:type => 'checking')
|
9
|
+
|
10
|
+
begin
|
11
|
+
bank_account.save
|
12
|
+
rescue Balanced::BadRequest => ex
|
13
|
+
raise "Key is not returned!" unless ex.extras.has_key? "routing_number"
|
14
|
+
end
|
15
|
+
|
16
|
+
% endif
|
@@ -0,0 +1 @@
|
|
1
|
+
Balanced::BankAccount.all
|
@@ -0,0 +1 @@
|
|
1
|
+
Balanced::BankAccount.find()
|
@@ -0,0 +1 @@
|
|
1
|
+
Balanced::Verification.new.save
|
@@ -0,0 +1,11 @@
|
|
1
|
+
% if mode == 'definition':
|
2
|
+
Balanced::Verification.new.save
|
3
|
+
|
4
|
+
% else:
|
5
|
+
require 'balanced'
|
6
|
+
Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
|
7
|
+
|
8
|
+
bank_account = Balanced::BankAccount.find('/v1/bank_accounts/BA4p71EIOhci5Z6leAjFthCq')
|
9
|
+
verification = bank_account.verify
|
10
|
+
|
11
|
+
% endif
|
@@ -0,0 +1 @@
|
|
1
|
+
Balanced::Verification.find()
|