balanced 0.7.4 → 0.7.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/.ruby-version +1 -1
- data/balanced.gemspec +2 -2
- data/examples/customers-with-meta-example.rb +141 -0
- data/examples/customers.rb +1 -6
- data/examples/examples.rb +1 -1
- data/lib/balanced/resources/marketplace.rb +1 -1
- data/lib/balanced/version.rb +1 -1
- data/scenario.cache +396 -383
- data/scenarios/account_add_card/ruby.mako +3 -3
- data/scenarios/account_capture_hold/request.rb +1 -1
- data/scenarios/account_capture_hold/ruby.mako +1 -1
- data/scenarios/account_create/ruby.mako +1 -1
- data/scenarios/account_create_buyer/request.rb +2 -1
- data/scenarios/account_create_buyer/ruby.mako +3 -2
- data/scenarios/account_create_debit/request.rb +1 -1
- data/scenarios/account_create_debit/ruby.mako +1 -1
- data/scenarios/account_create_hold/request.rb +1 -1
- data/scenarios/account_create_hold/ruby.mako +1 -1
- data/scenarios/account_create_merchant/ruby.mako +3 -3
- data/scenarios/account_underwrite_business/request.rb +2 -4
- data/scenarios/account_underwrite_business/ruby.mako +14 -4
- data/scenarios/account_underwrite_person/request.rb +1 -1
- data/scenarios/account_underwrite_person/ruby.mako +7 -2
- data/scenarios/bank_account_create/request.rb +1 -1
- data/scenarios/bank_account_create/ruby.mako +5 -2
- data/scenarios/bank_account_delete/ruby.mako +2 -2
- data/scenarios/bank_account_invalid_routing_number/request.rb +4 -1
- data/scenarios/bank_account_invalid_routing_number/ruby.mako +8 -2
- data/scenarios/bank_account_list/ruby.mako +1 -1
- data/scenarios/bank_account_show/ruby.mako +2 -2
- data/scenarios/bank_account_verification_create/ruby.mako +2 -2
- data/scenarios/bank_account_verification_show/ruby.mako +2 -2
- data/scenarios/bank_account_verification_update/request.rb +1 -2
- data/scenarios/bank_account_verification_update/ruby.mako +4 -5
- data/scenarios/callback_create/definition.rb +1 -1
- data/scenarios/callback_create/request.rb +1 -1
- data/scenarios/callback_create/ruby.mako +11 -0
- data/scenarios/callback_delete/definition.rb +1 -1
- data/scenarios/callback_delete/request.rb +1 -1
- data/scenarios/callback_delete/ruby.mako +10 -0
- data/scenarios/callback_list/definition.rb +1 -1
- data/scenarios/callback_list/ruby.mako +10 -0
- data/scenarios/callback_show/definition.rb +1 -1
- data/scenarios/callback_show/ruby.mako +9 -0
- data/scenarios/card_create/request.rb +1 -2
- data/scenarios/card_create/ruby.mako +5 -3
- data/scenarios/card_delete/ruby.mako +2 -2
- data/scenarios/card_invalidate/ruby.mako +2 -2
- data/scenarios/card_list/ruby.mako +1 -1
- data/scenarios/card_show/ruby.mako +2 -2
- data/scenarios/card_update/request.rb +1 -1
- data/scenarios/card_update/ruby.mako +5 -3
- data/scenarios/credit_account_merchant_create/request.rb +1 -1
- data/scenarios/credit_bank_account_list/ruby.mako +2 -2
- data/scenarios/credit_create_existing_bank_account/request.rb +1 -1
- data/scenarios/credit_create_existing_bank_account/ruby.mako +3 -3
- data/scenarios/credit_create_new_bank_account/request.rb +1 -1
- data/scenarios/credit_create_new_bank_account/ruby.mako +5 -2
- data/scenarios/credit_customer_list/ruby.mako +2 -2
- data/scenarios/credit_failed_state/request.rb +2 -2
- data/scenarios/credit_failed_state/ruby.mako +5 -2
- data/scenarios/credit_list/ruby.mako +1 -1
- data/scenarios/credit_paid_state/request.rb +2 -2
- data/scenarios/credit_paid_state/ruby.mako +5 -2
- data/scenarios/credit_pending_state/request.rb +2 -2
- data/scenarios/credit_pending_state/ruby.mako +5 -2
- data/scenarios/credit_show/ruby.mako +2 -2
- data/scenarios/customer_add_bank_account/ruby.mako +3 -3
- data/scenarios/customer_add_card/ruby.mako +3 -3
- data/scenarios/customer_capture_hold/request.rb +1 -1
- data/scenarios/customer_create/ruby.mako +1 -1
- data/scenarios/customer_create_debit/request.rb +1 -1
- data/scenarios/customer_create_debit/ruby.mako +3 -3
- data/scenarios/customer_create_hold/request.rb +1 -1
- data/scenarios/customer_create_hold/ruby.mako +1 -1
- data/scenarios/customer_credit/request.rb +1 -1
- data/scenarios/customer_credit/ruby.mako +2 -2
- data/scenarios/customer_delete/definition.rb +1 -0
- data/scenarios/customer_delete/request.rb +2 -0
- data/scenarios/customer_delete/ruby.mako +8 -0
- data/scenarios/debit_create/request.rb +3 -1
- data/scenarios/debit_create/ruby.mako +7 -3
- data/scenarios/debit_customer_list/ruby.mako +2 -2
- data/scenarios/debit_list/ruby.mako +1 -1
- data/scenarios/debit_refund/ruby.mako +2 -2
- data/scenarios/debit_show/ruby.mako +2 -2
- data/scenarios/debit_update/request.rb +3 -1
- data/scenarios/debit_update/ruby.mako +6 -3
- data/scenarios/event_list/ruby.mako +1 -1
- data/scenarios/event_show/ruby.mako +2 -2
- data/scenarios/helpers.rb +40 -7
- data/scenarios/hold_capture/request.rb +1 -1
- data/scenarios/hold_capture/ruby.mako +4 -3
- data/scenarios/hold_create/definition.rb +1 -1
- data/scenarios/hold_create/request.rb +3 -3
- data/scenarios/hold_create/ruby.mako +7 -6
- data/scenarios/hold_customer_list/ruby.mako +2 -2
- data/scenarios/hold_list/ruby.mako +1 -1
- data/scenarios/hold_show/ruby.mako +2 -2
- data/scenarios/hold_update/request.rb +3 -1
- data/scenarios/hold_update/ruby.mako +6 -3
- data/scenarios/hold_void/ruby.mako +2 -2
- data/scenarios/refund_account_list/ruby.mako +2 -2
- data/scenarios/refund_create/request.rb +4 -2
- data/scenarios/refund_create/ruby.mako +8 -4
- data/scenarios/refund_customer_list/ruby.mako +11 -0
- data/scenarios/refund_list/ruby.mako +1 -1
- data/scenarios/refund_show/ruby.mako +2 -2
- data/scenarios/refund_update/request.rb +3 -1
- data/scenarios/refund_update/ruby.mako +7 -3
- data/scenarios/render_mako.rb +1 -1
- metadata +23 -25
- data/.rbenv-version +0 -1
@@ -3,9 +3,9 @@ Balanced::Account.add_card
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
|
7
7
|
|
8
|
-
account = Balanced::Account.find('/v1/marketplaces/TEST-
|
9
|
-
response = account.add_card('/v1/marketplaces/TEST-
|
8
|
+
account = Balanced::Account.find('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/accounts/CU4WT2fC14gzGQIEcMKs5gm3')
|
9
|
+
response = account.add_card('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/cards/CC4Zor9L2DEKXy0LJJ8PtkMM')
|
10
10
|
|
11
11
|
% endif
|
@@ -6,6 +6,6 @@ require 'balanced'
|
|
6
6
|
Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
|
7
7
|
|
8
8
|
account = Balanced::Account.find('/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/accounts/AC6jdot989BbUks8LFIdRVcX/debits')
|
9
|
-
account.debit(:amount =>
|
9
|
+
account.debit(:amount => 1000, :hold_uri => '/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/holds/HL6t6iMvY9Touhig2PZnCOHk')
|
10
10
|
|
11
11
|
% endif
|
@@ -3,10 +3,11 @@ Balanced::Marketplace.create_buyer
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
|
7
7
|
|
8
8
|
|
9
9
|
buyer = Balanced::Marketplace.my_marketplace.create_buyer(
|
10
|
-
:card_uri => '/v1/marketplaces/TEST-
|
10
|
+
:card_uri => '/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/cards/CC4WeeR0OUiQh9vvqNQvMl1o'
|
11
|
+
)
|
11
12
|
|
12
13
|
% endif
|
@@ -6,6 +6,6 @@ require 'balanced'
|
|
6
6
|
Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
|
7
7
|
|
8
8
|
account = Balanced::Account.find('/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/accounts/AC6jdot989BbUks8LFIdRVcX/debits')
|
9
|
-
account.debit(:amount =>
|
9
|
+
account.debit(:amount => 1000)
|
10
10
|
|
11
11
|
% endif
|
@@ -6,6 +6,6 @@ require 'balanced'
|
|
6
6
|
Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
|
7
7
|
|
8
8
|
account = Balanced::Account.find('/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/accounts/AC6jdot989BbUks8LFIdRVcX')
|
9
|
-
account.hold(:amount =>
|
9
|
+
account.hold(:amount => 1000)
|
10
10
|
|
11
11
|
% endif
|
@@ -3,9 +3,9 @@ Balanced::Account.add_bank_account
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
|
7
7
|
|
8
|
-
account = Balanced::Account.find('/v1/marketplaces/TEST-
|
9
|
-
account.add_bank_account("/v1/bank_accounts/
|
8
|
+
account = Balanced::Account.find('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/accounts/CU4WT2fC14gzGQIEcMKs5gm3')
|
9
|
+
account.add_bank_account("/v1/bank_accounts/BA53NVwHAXYx7fo98SdK41dg")
|
10
10
|
|
11
11
|
% endif
|
@@ -1,11 +1,9 @@
|
|
1
1
|
<%= boiler_plate %>
|
2
2
|
|
3
3
|
merchant_data = {
|
4
|
-
|
5
|
-
:person => {
|
6
|
-
<%= params_to_hash.call(payload['merchant']['person']) %>
|
7
|
-
}
|
4
|
+
<%= params_to_hash.call(payload['merchant']).indent(2) %>,
|
8
5
|
}
|
6
|
+
|
9
7
|
account = Balanced::Marketplace.my_marketplace.create_account
|
10
8
|
|
11
9
|
begin
|
@@ -3,15 +3,25 @@ Balanced::Account.promote_to_merchant
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
|
7
7
|
|
8
8
|
|
9
9
|
merchant_data = {
|
10
|
-
:name => 'Skripts4Kids'
|
10
|
+
:name => 'Skripts4Kids',
|
11
11
|
:person => {
|
12
|
-
|
13
|
-
|
12
|
+
:dob => '1989-12',
|
13
|
+
:name => 'Timmy Q. CopyPasta',
|
14
|
+
:phone_number => '+14089999999',
|
15
|
+
:postal_code => '94110',
|
16
|
+
:street_address => '121 Skriptkid Row'
|
17
|
+
},
|
18
|
+
:phone_number => '+140899188155',
|
19
|
+
:postal_code => '91111',
|
20
|
+
:street_address => '555 VoidMain Road',
|
21
|
+
:tax_id => '211111111',
|
22
|
+
:type => 'business',
|
14
23
|
}
|
24
|
+
|
15
25
|
account = Balanced::Marketplace.my_marketplace.create_account
|
16
26
|
|
17
27
|
begin
|
@@ -3,12 +3,17 @@ Balanced::Account.promote_to_merchant
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
|
7
7
|
|
8
8
|
marketplace = Balanced::Marketplace.my_marketplace
|
9
9
|
|
10
10
|
merchant_data = {
|
11
|
-
:dob => '1989-12'
|
11
|
+
:dob => '1989-12',
|
12
|
+
:name => 'Timmy Q. CopyPasta',
|
13
|
+
:phone_number => '+14089999999',
|
14
|
+
:postal_code => '94110',
|
15
|
+
:street_address => '121 Skriptkid Row',
|
16
|
+
:type => 'person'
|
12
17
|
}
|
13
18
|
|
14
19
|
account = Balanced::Marketplace.my_marketplace.create_account
|
@@ -3,10 +3,13 @@ Balanced::BankAccount.save
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
|
7
7
|
|
8
8
|
bank_account = Balanced::BankAccount.new(
|
9
|
-
:account_number => '9900000001'
|
9
|
+
:account_number => '9900000001',
|
10
|
+
:name => 'Johann Bernoulli',
|
11
|
+
:routing_number => '121000358',
|
12
|
+
:type => 'checking'
|
10
13
|
).save
|
11
14
|
|
12
15
|
% endif
|
@@ -3,9 +3,9 @@ Balanced::BankAccount.unstore
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
|
7
7
|
|
8
|
-
bank_account = Balanced::BankAccount.find('/v1/bank_accounts/
|
8
|
+
bank_account = Balanced::BankAccount.find('/v1/bank_accounts/BA5uvDqG8xk4bGmwX3JTbIee')
|
9
9
|
bank_account.unstore
|
10
10
|
|
11
11
|
% endif
|
@@ -1,5 +1,8 @@
|
|
1
1
|
<%= boiler_plate %>
|
2
|
-
bank_account = Balanced::BankAccount.new(
|
2
|
+
bank_account = Balanced::BankAccount.new(
|
3
|
+
:uri => '<%=request['uri']%>',
|
4
|
+
<%= params_to_hash.call(payload).indent(2) %>
|
5
|
+
)
|
3
6
|
|
4
7
|
begin
|
5
8
|
bank_account.save
|
@@ -3,9 +3,15 @@ Balanced::BadRequest
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('ak-test-1p1Tsac7gHeMQowL2seB7ieliuAJAufyq')
|
7
7
|
|
8
|
-
bank_account = Balanced::BankAccount.new(
|
8
|
+
bank_account = Balanced::BankAccount.new(
|
9
|
+
:uri => '/v1/marketplaces/TEST-MP5FKPQwyjvVgTDt7EiRw3Kq/bank_accounts',
|
10
|
+
:account_number => '9900000001',
|
11
|
+
:name => 'Johann Bernoulli',
|
12
|
+
:routing_number => '100000007',
|
13
|
+
:type => 'checking'
|
14
|
+
)
|
9
15
|
|
10
16
|
begin
|
11
17
|
bank_account.save
|
@@ -3,8 +3,8 @@ Balanced::BankAccount.find()
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
|
7
7
|
|
8
|
-
bank_account = Balanced::BankAccount.find('/v1/bank_accounts/
|
8
|
+
bank_account = Balanced::BankAccount.find('/v1/bank_accounts/BA5A8YcoSCEPQyCaPCTvmFnW')
|
9
9
|
|
10
10
|
% endif
|
@@ -3,9 +3,9 @@
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
|
7
7
|
|
8
|
-
bank_account = Balanced::BankAccount.find('/v1/bank_accounts/
|
8
|
+
bank_account = Balanced::BankAccount.find('/v1/bank_accounts/BA5gy1b8X8dIGaBWFuoWvkxO')
|
9
9
|
verification = bank_account.verify
|
10
10
|
|
11
11
|
% endif
|
@@ -3,8 +3,8 @@ Balanced::Verification.find()
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
|
7
7
|
|
8
|
-
verification = Balanced::Verification.find('/v1/bank_accounts/
|
8
|
+
verification = Balanced::Verification.find('/v1/bank_accounts/BA5nW8SMsXjaU3GVWdhR9d60/verifications/BZ5rcuNvebC49kZyTGAaJu2A')
|
9
9
|
|
10
10
|
% endif
|
@@ -3,14 +3,13 @@ Balanced::Verification.save
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
|
7
7
|
|
8
|
-
verification = Balanced::Verification.find('/v1/bank_accounts/
|
8
|
+
verification = Balanced::Verification.find('/v1/bank_accounts/BA5uvDqG8xk4bGmwX3JTbIee/verifications/BZ5wpXXDTZxqLCHiX6V4XXvA')
|
9
9
|
|
10
|
+
verification.amount_1 = 1
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
verification.amount_2 = 1
|
12
|
+
verification.amount_2 = 1
|
14
13
|
|
15
14
|
verification.save
|
16
15
|
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Balanced::Callback.new
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Balanced::Callback.unstore
|
@@ -0,0 +1,10 @@
|
|
1
|
+
% if mode == 'definition':
|
2
|
+
Balanced::Callback.unstore
|
3
|
+
|
4
|
+
% else:
|
5
|
+
require 'balanced'
|
6
|
+
Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
|
7
|
+
|
8
|
+
callback = Balanced::Callback.find('/v1/callbacks/CB5GFgGfugkhbKueLUJL6hAa')
|
9
|
+
callback.unstore
|
10
|
+
% endif
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Balanced::Callback.all
|
@@ -0,0 +1,10 @@
|
|
1
|
+
% if mode == 'definition':
|
2
|
+
Balanced::Callback.all
|
3
|
+
|
4
|
+
% else:
|
5
|
+
require 'balanced'
|
6
|
+
Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
|
7
|
+
|
8
|
+
marketplace = Balanced::Marketplace.my_marketplace
|
9
|
+
callbacks = Balanced::Callback.all(:limit => 2)
|
10
|
+
% endif
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Balanced::Callback.find
|
@@ -3,11 +3,13 @@ Balanced::Card.new
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
|
7
7
|
|
8
8
|
card = Balanced::Card.new(
|
9
|
-
:
|
10
|
-
:
|
9
|
+
:card_number => '5105105105105100',
|
10
|
+
:expiration_month => '12',
|
11
|
+
:expiration_year => '2020',
|
12
|
+
:security_code => '123'
|
11
13
|
).save
|
12
14
|
|
13
15
|
% endif
|
@@ -3,9 +3,9 @@ Balanced::Card.unstore
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
|
7
7
|
|
8
|
-
card = Balanced::Card.find('/v1/
|
8
|
+
card = Balanced::Card.find('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/cards/CC5N3HHUDrAyvhNwQOoUd3UX')
|
9
9
|
card.unstore
|
10
10
|
|
11
11
|
% endif
|