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,8 +3,8 @@ Balanced::Card.invalidate()
|
|
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/marketplaces/TEST-
|
8
|
+
card = Balanced::Card.find('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/cards/CC5N3HHUDrAyvhNwQOoUd3UX')
|
9
9
|
card.invalidate
|
10
10
|
% endif
|
@@ -3,7 +3,7 @@ Balanced::Card.find()
|
|
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/marketplaces/TEST-
|
8
|
+
card = Balanced::Card.find('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/cards/CC5N3HHUDrAyvhNwQOoUd3UX')
|
9
9
|
% endif
|
@@ -3,11 +3,13 @@ Balanced::Card.save()
|
|
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/marketplaces/TEST-
|
8
|
+
card = Balanced::Card.find('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/cards/CC5N3HHUDrAyvhNwQOoUd3UX')
|
9
9
|
card.meta = {
|
10
|
-
'facebook.user_id' => '0192837465',
|
10
|
+
'facebook.user_id' => '0192837465',
|
11
|
+
'my-own-customer-id' => '12345',
|
12
|
+
'twitter.id' => '1234987650'
|
11
13
|
}
|
12
14
|
card.save
|
13
15
|
|
@@ -3,10 +3,10 @@ Balanced::BankAccount.credits
|
|
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
|
-
bank_account = Balanced::BankAccount.find('/v1/bank_accounts/
|
10
|
+
bank_account = Balanced::BankAccount.find('/v1/bank_accounts/BA5A8YcoSCEPQyCaPCTvmFnW')
|
11
11
|
credits = bank_account.credits
|
12
12
|
% endif
|
@@ -3,10 +3,10 @@ Balanced::BankAccount.credit
|
|
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
|
-
bank_account = Balanced::BankAccount.find('/v1/bank_accounts/
|
11
|
-
bank_account.credit(10000)
|
10
|
+
bank_account = Balanced::BankAccount.find('/v1/bank_accounts/BA5A8YcoSCEPQyCaPCTvmFnW')
|
11
|
+
bank_account.credit(:amount => 10000)
|
12
12
|
% endif
|
@@ -2,7 +2,7 @@
|
|
2
2
|
marketplace = Balanced::Marketplace.my_marketplace
|
3
3
|
|
4
4
|
bank_account_info = {
|
5
|
-
<%= params_to_hash.call(request['bank_account']) %>
|
5
|
+
<%= params_to_hash.call(request['bank_account']).indent(2) %>
|
6
6
|
}
|
7
7
|
credit = Balanced::Credit.new(
|
8
8
|
:amount => <%= request['amount'] %>,
|
@@ -3,12 +3,15 @@ Balanced::Credit.save
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
|
7
7
|
|
8
8
|
marketplace = Balanced::Marketplace.my_marketplace
|
9
9
|
|
10
10
|
bank_account_info = {
|
11
|
-
:account_number => '9900000001'
|
11
|
+
:account_number => '9900000001',
|
12
|
+
:name => 'Johann Bernoulli',
|
13
|
+
:routing_number => '121000358',
|
14
|
+
:type => 'checking'
|
12
15
|
}
|
13
16
|
credit = Balanced::Credit.new(
|
14
17
|
:amount => 10000,
|
@@ -3,10 +3,10 @@ Balanced::Customer.credits
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
|
7
7
|
|
8
8
|
|
9
|
-
customer = Balanced::Customer.find('/v1/customers/
|
9
|
+
customer = Balanced::Customer.find('/v1/customers/CU5f64LhFMO8cf7N1sQSRVOo')
|
10
10
|
credits = customer.credits
|
11
11
|
|
12
12
|
% endif
|
@@ -2,9 +2,9 @@
|
|
2
2
|
marketplace = Balanced::Marketplace.my_marketplace
|
3
3
|
|
4
4
|
bank_account_info = {
|
5
|
-
<%= params_to_hash.call(request['bank_account']) %>
|
5
|
+
<%= params_to_hash.call(request['payload']['bank_account']).indent(2) %>
|
6
6
|
}
|
7
7
|
credit = Balanced::Credit.new(
|
8
|
-
:amount => <%= request['amount'] %>,
|
8
|
+
:amount => <%= request['payload']['amount'] %>,
|
9
9
|
:bank_account => bank_account_info
|
10
10
|
).save
|
@@ -3,12 +3,15 @@ Balanced::Credit.save
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('ak-test-1p1Tsac7gHeMQowL2seB7ieliuAJAufyq')
|
7
7
|
|
8
8
|
marketplace = Balanced::Marketplace.my_marketplace
|
9
9
|
|
10
10
|
bank_account_info = {
|
11
|
-
:account_number => '
|
11
|
+
:account_number => '9900000005',
|
12
|
+
:name => 'Johann Bernoulli',
|
13
|
+
:routing_number => '121000358',
|
14
|
+
:type => 'checking'
|
12
15
|
}
|
13
16
|
credit = Balanced::Credit.new(
|
14
17
|
:amount => 10000,
|
@@ -2,10 +2,10 @@
|
|
2
2
|
marketplace = Balanced::Marketplace.my_marketplace
|
3
3
|
|
4
4
|
bank_account_info = {
|
5
|
-
<%= params_to_hash.call(request['bank_account']) %>
|
5
|
+
<%= params_to_hash.call(request['payload']['bank_account']).indent(2) %>
|
6
6
|
}
|
7
7
|
|
8
8
|
credit = Balanced::Credit.new(
|
9
|
-
:amount => <%= request['amount'] %>,
|
9
|
+
:amount => <%= request['payload']['amount'] %>,
|
10
10
|
:bank_account => bank_account_info
|
11
11
|
).save
|
@@ -3,12 +3,15 @@ Balanced::Credit.save
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('ak-test-1p1Tsac7gHeMQowL2seB7ieliuAJAufyq')
|
7
7
|
|
8
8
|
marketplace = Balanced::Marketplace.my_marketplace
|
9
9
|
|
10
10
|
bank_account_info = {
|
11
|
-
:account_number => '
|
11
|
+
:account_number => '9900000002',
|
12
|
+
:name => 'Johann Bernoulli',
|
13
|
+
:routing_number => '121000358',
|
14
|
+
:type => 'checking'
|
12
15
|
}
|
13
16
|
|
14
17
|
credit = Balanced::Credit.new(
|
@@ -1,9 +1,9 @@
|
|
1
1
|
<%= boiler_plate %>
|
2
2
|
bank_account_info = {
|
3
|
-
<%= params_to_hash.call(request['bank_account']) %>
|
3
|
+
<%= params_to_hash.call(request['payload']['bank_account']).indent(2) %>
|
4
4
|
}
|
5
5
|
|
6
6
|
credit = Balanced::Credit.new(
|
7
|
-
:amount => <%= request['amount'] %>,
|
7
|
+
:amount => <%= request['payload']['amount'] %>,
|
8
8
|
:bank_account => bank_account_info
|
9
9
|
).save
|
@@ -3,10 +3,13 @@ Balanced::Credit.save
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('ak-test-1p1Tsac7gHeMQowL2seB7ieliuAJAufyq')
|
7
7
|
|
8
8
|
bank_account_info = {
|
9
|
-
:account_number => '9900000001'
|
9
|
+
:account_number => '9900000001',
|
10
|
+
:name => 'Johann Bernoulli',
|
11
|
+
:routing_number => '121000358',
|
12
|
+
:type => 'checking'
|
10
13
|
}
|
11
14
|
|
12
15
|
credit = Balanced::Credit.new(
|
@@ -3,9 +3,9 @@ Balanced::Credit.find
|
|
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
|
-
credit = Balanced::Credit.find('/v1/credits/
|
10
|
+
credit = Balanced::Credit.find('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/credits/CR5YK26rTyl5vlFK928nhxUI')
|
11
11
|
% endif
|
@@ -3,9 +3,9 @@ Balanced::Customer.add_bank_account
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
|
7
7
|
|
8
|
-
customer = Balanced::Customer.find('/v1/customers/
|
9
|
-
customer.add_bank_account("/v1/bank_accounts/
|
8
|
+
customer = Balanced::Customer.find('/v1/customers/CU6n0viWQoT86ttbkCsPgV0Y')
|
9
|
+
customer.add_bank_account("/v1/bank_accounts/BA6oxYWJXxeM63vMorgtSIhI")
|
10
10
|
|
11
11
|
% endif
|
@@ -3,9 +3,9 @@ Balanced::Customer.add_card
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
|
7
7
|
|
8
|
-
customer = Balanced::Customer.find('/v1/customers/
|
9
|
-
response = customer.add_card('/v1/marketplaces/TEST-
|
8
|
+
customer = Balanced::Customer.find('/v1/customers/CU7gMTGKh2yGHYn1lUxH9STS')
|
9
|
+
response = customer.add_card('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/cards/CC7iFRCb5AvLuZ9qzIF0VMmA')
|
10
10
|
|
11
11
|
% endif
|
@@ -3,9 +3,9 @@ Balanced::Customer.debit
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
|
7
7
|
|
8
|
-
customer = Balanced::Customer.find('/v1/customers/
|
9
|
-
customer.debit(:amount =>
|
8
|
+
customer = Balanced::Customer.find('/v1/customers/CU6vs1tjxBtifgTuzKjCGtVS')
|
9
|
+
customer.debit(:amount => 5000)
|
10
10
|
|
11
11
|
% endif
|
@@ -1,2 +1,2 @@
|
|
1
1
|
customer = Balanced::Customer.find('<%=request['customer_uri']%>')
|
2
|
-
customer.credit(:amount =>
|
2
|
+
customer.credit(:amount => <%=payload['amount']%>)
|
@@ -2,7 +2,7 @@
|
|
2
2
|
Balanced::Customer.credit
|
3
3
|
|
4
4
|
% else:
|
5
|
-
customer = Balanced::Customer.find('/v1/customers/
|
6
|
-
customer.credit(:amount =>
|
5
|
+
customer = Balanced::Customer.find('/v1/customers/CU5f64LhFMO8cf7N1sQSRVOo')
|
6
|
+
customer.credit(:amount => 100)
|
7
7
|
|
8
8
|
% endif
|
@@ -0,0 +1 @@
|
|
1
|
+
Balanced::Customer.unstore
|
@@ -3,9 +3,13 @@ Balanced::Customer.debit()
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
|
7
7
|
|
8
|
-
customer = Balanced::Customer.find('')
|
9
|
-
customer.debit(
|
8
|
+
customer = Balanced::Customer.find('/v1/customers/CU7gMTGKh2yGHYn1lUxH9STS')
|
9
|
+
customer.debit(
|
10
|
+
:amount => 5000,
|
11
|
+
:appears_on_statement_as => 'Statement text',
|
12
|
+
:description => 'Some descriptive text for the debit in the dashboard'
|
13
|
+
)
|
10
14
|
|
11
15
|
% endif
|
@@ -3,10 +3,10 @@ Balanced::Customer.debits
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
|
7
7
|
|
8
8
|
|
9
|
-
customer = Balanced::Customer.find('/v1/customers/
|
9
|
+
customer = Balanced::Customer.find('/v1/customers/CU6vs1tjxBtifgTuzKjCGtVS')
|
10
10
|
debits = customer.debits
|
11
11
|
|
12
12
|
% endif
|
@@ -3,8 +3,8 @@ Balanced::Debit.refund()
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
|
7
7
|
|
8
|
-
debit = Balanced::Debit.find('/v1/marketplaces/TEST-
|
8
|
+
debit = Balanced::Debit.find('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/debits/WD6MTAHor9FhO4G2nvZwaXvi')
|
9
9
|
debit.refund
|
10
10
|
% endif
|