balanced 0.7.5 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/.rbenv-version +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +1 -0
- data/balanced.gemspec +2 -2
- data/examples/bank_account_debits.rb +2 -1
- data/examples/customers.rb +8 -4
- data/examples/events_and_callbacks.rb +2 -1
- data/examples/examples.rb +6 -5
- data/examples/exception_handling.rb +2 -1
- data/lib/balanced/client.rb +3 -3
- data/lib/balanced/resources/account.rb +5 -3
- data/lib/balanced/resources/card.rb +3 -1
- data/lib/balanced/resources/credit.rb +12 -13
- data/lib/balanced/resources/customer.rb +1 -1
- data/lib/balanced/resources/debit.rb +1 -1
- data/lib/balanced/resources/resource.rb +83 -93
- data/lib/balanced/utils.rb +13 -4
- data/lib/balanced/version.rb +1 -1
- data/scenario.cache +299 -380
- 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/ruby.mako +2 -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/ruby.mako +1 -1
- data/scenarios/account_underwrite_person/request.rb +1 -1
- data/scenarios/account_underwrite_person/ruby.mako +7 -7
- data/scenarios/bank_account_create/request.rb +1 -1
- data/scenarios/bank_account_create/ruby.mako +5 -5
- data/scenarios/bank_account_delete/ruby.mako +2 -2
- data/scenarios/bank_account_invalid_routing_number/ruby.mako +2 -8
- 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/ruby.mako +2 -2
- data/scenarios/callback_create/definition.rb +1 -1
- data/scenarios/callback_create/request.rb +1 -1
- data/scenarios/callback_create/ruby.mako +0 -11
- data/scenarios/callback_delete/definition.rb +1 -1
- data/scenarios/callback_delete/request.rb +1 -1
- data/scenarios/callback_delete/ruby.mako +0 -10
- data/scenarios/callback_list/definition.rb +1 -1
- data/scenarios/callback_list/ruby.mako +0 -10
- data/scenarios/callback_show/definition.rb +1 -1
- data/scenarios/callback_show/ruby.mako +0 -9
- data/scenarios/card_create/request.rb +2 -1
- data/scenarios/card_create/ruby.mako +6 -5
- 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/ruby.mako +2 -2
- data/scenarios/credit_bank_account_list/ruby.mako +2 -2
- data/scenarios/credit_create_existing_bank_account/ruby.mako +3 -3
- 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 +2 -5
- data/scenarios/credit_list/ruby.mako +1 -1
- data/scenarios/credit_paid_state/request.rb +2 -2
- data/scenarios/credit_paid_state/ruby.mako +2 -5
- data/scenarios/credit_pending_state/request.rb +2 -2
- data/scenarios/credit_pending_state/ruby.mako +2 -5
- 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/ruby.mako +1 -1
- data/scenarios/debit_create/ruby.mako +3 -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/ruby.mako +2 -2
- data/scenarios/event_list/ruby.mako +1 -1
- data/scenarios/event_show/ruby.mako +2 -2
- data/scenarios/helpers.rb +1 -5
- data/scenarios/hold_capture/ruby.mako +4 -3
- data/scenarios/hold_create/request.rb +2 -2
- data/scenarios/hold_create/ruby.mako +6 -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/ruby.mako +2 -2
- data/scenarios/hold_void/ruby.mako +2 -2
- data/scenarios/refund_create/ruby.mako +2 -2
- data/scenarios/refund_customer_list/ruby.mako +2 -2
- data/scenarios/refund_list/ruby.mako +1 -1
- data/scenarios/refund_show/ruby.mako +2 -2
- data/scenarios/refund_update/ruby.mako +2 -2
- data/scenarios/render.rb +1 -1
- data/scenarios/render_mako.rb +0 -1
- data/spec/balanced/error_spec.rb +4 -4
- data/spec/balanced/pager_spec.rb +7 -7
- data/spec/balanced/resources/account_spec.rb +51 -30
- data/spec/balanced/resources/bank_account_spec.rb +2 -2
- data/spec/balanced/resources/card_spec.rb +8 -8
- data/spec/balanced/resources/customer_spec.rb +11 -11
- data/spec/balanced/resources/hold_spec.rb +1 -1
- data/spec/balanced/resources/marketplace_spec.rb +12 -10
- data/spec/balanced/resources/resource_spec.rb +1 -1
- data/spec/scenarios_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +16 -15
- data/examples/customers-with-meta-example.rb +0 -141
@@ -3,9 +3,9 @@ Balanced::Account.add_card
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
|
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-MP4h8BxozeLxe7VAllP6b5gj/accounts/AC4SoZJ23TvXIUcUOBSTXYHQ')
|
9
|
+
response = account.add_card('/v1/marketplaces/TEST-MP4h8BxozeLxe7VAllP6b5gj/cards/CC4Y12fGIP0HQ1jhcDgE9cFi')
|
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 => 1000, :hold_uri => '/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/holds/HL6t6iMvY9Touhig2PZnCOHk')
|
9
|
+
account.debit(:amount => '1000', :hold_uri => '/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/holds/HL6t6iMvY9Touhig2PZnCOHk')
|
10
10
|
|
11
11
|
% endif
|
@@ -3,11 +3,11 @@ Balanced::Marketplace.create_buyer
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
|
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-MP4h8BxozeLxe7VAllP6b5gj/cards/CC4KUcbT2dmJRIYoG0hBpO6S'
|
11
11
|
)
|
12
12
|
|
13
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 => 1000)
|
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 => 1000)
|
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('8c3aeeb80e9e11e38901026ba7f8ec28')
|
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-MP4h8BxozeLxe7VAllP6b5gj/accounts/AC4SoZJ23TvXIUcUOBSTXYHQ')
|
9
|
+
account.add_bank_account("/v1/bank_accounts/BA5hNwwQFEWByAcdf1U5D5ok")
|
10
10
|
|
11
11
|
% endif
|
@@ -3,17 +3,17 @@ Balanced::Account.promote_to_merchant
|
|
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
|
merchant_data = {
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
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'
|
17
17
|
}
|
18
18
|
|
19
19
|
account = Balanced::Marketplace.my_marketplace.create_account
|
@@ -3,13 +3,13 @@ Balanced::BankAccount.save
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
|
7
7
|
|
8
8
|
bank_account = Balanced::BankAccount.new(
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
:account_number => '9900000001',
|
10
|
+
:name => 'Johann Bernoulli',
|
11
|
+
:routing_number => '121000358',
|
12
|
+
:type => 'checking'
|
13
13
|
).save
|
14
14
|
|
15
15
|
% endif
|
@@ -3,9 +3,9 @@ Balanced::BankAccount.unstore
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
|
7
7
|
|
8
|
-
bank_account = Balanced::BankAccount.find('/v1/bank_accounts/
|
8
|
+
bank_account = Balanced::BankAccount.find('/v1/bank_accounts/BA5LOM1tiKeY4HOVU9XqOpHi')
|
9
9
|
bank_account.unstore
|
10
10
|
|
11
11
|
% endif
|
@@ -3,15 +3,9 @@ Balanced::BadRequest
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
|
7
7
|
|
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
|
-
)
|
8
|
+
bank_account = Balanced::BankAccount.new( :uri => '/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/bank_accounts', :account_number => '9900000001',:name => 'Johann Bernoulli',:routing_number => '100000007',:type => 'checking')
|
15
9
|
|
16
10
|
begin
|
17
11
|
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('8c3aeeb80e9e11e38901026ba7f8ec28')
|
7
7
|
|
8
|
-
bank_account = Balanced::BankAccount.find('/v1/bank_accounts/
|
8
|
+
bank_account = Balanced::BankAccount.find('/v1/bank_accounts/BA5S3reJdyJBbAYKepbneBe2')
|
9
9
|
|
10
10
|
% endif
|
@@ -3,9 +3,9 @@
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
|
7
7
|
|
8
|
-
bank_account = Balanced::BankAccount.find('/v1/bank_accounts/
|
8
|
+
bank_account = Balanced::BankAccount.find('/v1/bank_accounts/BA5BveXWeSilJaZGTX3P6g9x')
|
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('8c3aeeb80e9e11e38901026ba7f8ec28')
|
7
7
|
|
8
|
-
verification = Balanced::Verification.find('/v1/bank_accounts/
|
8
|
+
verification = Balanced::Verification.find('/v1/bank_accounts/BA5Frg9td6vFAzSIwx9aShjW/verifications/BZ5IyyZBbFCVWMaNzHwiq5bx')
|
9
9
|
|
10
10
|
% endif
|
@@ -3,9 +3,9 @@ Balanced::Verification.save
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
|
7
7
|
|
8
|
-
verification = Balanced::Verification.find('/v1/bank_accounts/
|
8
|
+
verification = Balanced::Verification.find('/v1/bank_accounts/BA5LOM1tiKeY4HOVU9XqOpHi/verifications/BZ5OeVKxqc8c1ne4qZzi9LJl')
|
9
9
|
|
10
10
|
verification.amount_1 = 1
|
11
11
|
|
@@ -1 +1 @@
|
|
1
|
-
Balanced::Callback.
|
1
|
+
Balanced::Callback.save
|
@@ -1 +1 @@
|
|
1
|
-
Balanced::Callback.
|
1
|
+
Balanced::Callback.destroy
|
@@ -1,10 +0,0 @@
|
|
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
|
-
Balanced::Callback.all
|
1
|
+
Balanced::Callback.all
|
@@ -1,10 +0,0 @@
|
|
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
|
-
Balanced::Callback.find
|
1
|
+
Balanced::Callback.find()
|
@@ -3,13 +3,14 @@ Balanced::Card.new
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
|
7
7
|
|
8
8
|
card = Balanced::Card.new(
|
9
|
-
:
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
:uri => '/v1/marketplaces/TEST-MP4h8BxozeLxe7VAllP6b5gj/cards',
|
10
|
+
:card_number => '5105105105105100',
|
11
|
+
:expiration_month => '12',
|
12
|
+
:expiration_year => '2020',
|
13
|
+
:security_code => '123'
|
13
14
|
).save
|
14
15
|
|
15
16
|
% endif
|
@@ -3,9 +3,9 @@ Balanced::Card.unstore
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
|
7
7
|
|
8
|
-
card = Balanced::Card.find('/v1/marketplaces/TEST-
|
8
|
+
card = Balanced::Card.find('/v1/marketplaces/TEST-MP4h8BxozeLxe7VAllP6b5gj/accounts/AC4SoZJ23TvXIUcUOBSTXYHQ/cards/CC4Y12fGIP0HQ1jhcDgE9cFi')
|
9
9
|
card.unstore
|
10
10
|
|
11
11
|
% endif
|
@@ -3,8 +3,8 @@ Balanced::Card.invalidate()
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
|
7
7
|
|
8
|
-
card = Balanced::Card.find('/v1/marketplaces/TEST-
|
8
|
+
card = Balanced::Card.find('/v1/marketplaces/TEST-MP4h8BxozeLxe7VAllP6b5gj/cards/CC5ZP031cwTSKE3pSIHNNMRi')
|
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('8c3aeeb80e9e11e38901026ba7f8ec28')
|
7
7
|
|
8
|
-
card = Balanced::Card.find('/v1/marketplaces/TEST-
|
8
|
+
card = Balanced::Card.find('/v1/marketplaces/TEST-MP4h8BxozeLxe7VAllP6b5gj/cards/CC5ZP031cwTSKE3pSIHNNMRi')
|
9
9
|
% endif
|
@@ -3,9 +3,9 @@ Balanced::Card.save()
|
|
3
3
|
|
4
4
|
% else:
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('
|
6
|
+
Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
|
7
7
|
|
8
|
-
card = Balanced::Card.find('/v1/marketplaces/TEST-
|
8
|
+
card = Balanced::Card.find('/v1/marketplaces/TEST-MP4h8BxozeLxe7VAllP6b5gj/cards/CC5ZP031cwTSKE3pSIHNNMRi')
|
9
9
|
card.meta = {
|
10
10
|
'facebook.user_id' => '0192837465',
|
11
11
|
'my-own-customer-id' => '12345',
|
@@ -3,10 +3,10 @@ Balanced::BankAccount.credits
|
|
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
|
-
bank_account = Balanced::BankAccount.find('/v1/bank_accounts/
|
10
|
+
bank_account = Balanced::BankAccount.find('/v1/bank_accounts/BA5S3reJdyJBbAYKepbneBe2')
|
11
11
|
credits = bank_account.credits
|
12
12
|
% endif
|