balanced 1.1.1 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +10 -6
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/lib/balanced/resources.rb +2 -0
- data/lib/balanced/resources/account.rb +33 -0
- data/lib/balanced/resources/card.rb +1 -1
- data/lib/balanced/resources/customer.rb +8 -0
- data/lib/balanced/resources/resource.rb +4 -6
- data/lib/balanced/resources/settlement.rb +12 -0
- data/lib/balanced/response/balanced_exception_middleware.rb +1 -1
- data/lib/balanced/utils.rb +1 -1
- data/lib/balanced/version.rb +1 -1
- data/scenarios/account_credit/definition.rb +1 -0
- data/scenarios/account_credit/request.rb +5 -0
- data/scenarios/account_credit/ruby.mako +49 -0
- data/scenarios/account_list/definition.rb +1 -0
- data/scenarios/account_list/request.rb +2 -0
- data/scenarios/account_list/ruby.mako +64 -0
- data/scenarios/account_list_customer/definition.rb +1 -0
- data/scenarios/account_list_customer/request.rb +3 -0
- data/scenarios/account_list_customer/ruby.mako +38 -0
- data/scenarios/account_show/definition.rb +1 -0
- data/scenarios/account_show/request.rb +2 -0
- data/scenarios/account_show/ruby.mako +37 -0
- data/scenarios/api_key_create/ruby.mako +6 -6
- data/scenarios/api_key_delete/ruby.mako +2 -2
- data/scenarios/api_key_list/ruby.mako +10 -10
- data/scenarios/api_key_show/ruby.mako +6 -6
- data/scenarios/bank_account_associate_to_customer/ruby.mako +16 -14
- data/scenarios/bank_account_create/ruby.mako +13 -11
- data/scenarios/bank_account_credit/ruby.mako +16 -16
- data/scenarios/bank_account_debit/ruby.mako +21 -18
- data/scenarios/bank_account_debit_order/definition.rb +1 -0
- data/scenarios/bank_account_debit_order/request.rb +7 -0
- data/scenarios/bank_account_debit_order/ruby.mako +52 -0
- data/scenarios/bank_account_delete/ruby.mako +2 -2
- data/scenarios/bank_account_list/ruby.mako +26 -22
- data/scenarios/bank_account_show/ruby.mako +14 -12
- data/scenarios/bank_account_update/ruby.mako +14 -12
- data/scenarios/bank_account_verification_create/ruby.mako +10 -10
- data/scenarios/bank_account_verification_show/ruby.mako +10 -10
- data/scenarios/bank_account_verification_update/ruby.mako +9 -9
- data/scenarios/callback_create/ruby.mako +4 -4
- data/scenarios/callback_delete/ruby.mako +2 -2
- data/scenarios/callback_list/ruby.mako +4 -4
- data/scenarios/callback_show/ruby.mako +5 -5
- data/scenarios/card_associate_to_customer/ruby.mako +26 -26
- data/scenarios/card_create/ruby.mako +13 -15
- data/scenarios/card_create_creditable/ruby.mako +11 -11
- data/scenarios/card_create_dispute/ruby.mako +13 -13
- data/scenarios/card_credit/ruby.mako +16 -14
- data/scenarios/card_credit_order/definition.rb +1 -0
- data/scenarios/card_credit_order/request.rb +7 -0
- data/scenarios/card_credit_order/ruby.mako +45 -0
- data/scenarios/card_debit/ruby.mako +20 -17
- data/scenarios/card_debit_dispute/ruby.mako +20 -17
- data/scenarios/card_delete/ruby.mako +2 -2
- data/scenarios/card_hold_capture/ruby.mako +20 -17
- data/scenarios/card_hold_create/ruby.mako +16 -14
- data/scenarios/card_hold_list/ruby.mako +33 -27
- data/scenarios/card_hold_order/definition.rb +1 -0
- data/scenarios/card_hold_order/request.rb +6 -0
- data/scenarios/card_hold_order/ruby.mako +45 -0
- data/scenarios/card_hold_show/ruby.mako +16 -14
- data/scenarios/card_hold_update/ruby.mako +16 -14
- data/scenarios/card_hold_void/ruby.mako +17 -15
- data/scenarios/card_list/ruby.mako +25 -29
- data/scenarios/card_show/ruby.mako +14 -16
- data/scenarios/card_update/ruby.mako +14 -16
- data/scenarios/credit_list/ruby.mako +44 -14
- data/scenarios/credit_list_bank_account/ruby.mako +3 -3
- data/scenarios/credit_order/request.rb +2 -2
- data/scenarios/credit_order/ruby.mako +35 -14
- data/scenarios/credit_show/ruby.mako +16 -16
- data/scenarios/credit_update/ruby.mako +16 -16
- data/scenarios/customer_create/ruby.mako +22 -20
- data/scenarios/customer_delete/ruby.mako +1 -1
- data/scenarios/customer_list/ruby.mako +43 -39
- data/scenarios/customer_show/ruby.mako +23 -21
- data/scenarios/customer_update/ruby.mako +23 -21
- data/scenarios/debit_dispute_show/ruby.mako +12 -12
- data/scenarios/debit_list/ruby.mako +43 -37
- data/scenarios/debit_order/ruby.mako +22 -19
- data/scenarios/debit_show/ruby.mako +20 -17
- data/scenarios/debit_update/ruby.mako +20 -17
- data/scenarios/dispute_list/ruby.mako +11 -11
- data/scenarios/dispute_show/ruby.mako +12 -12
- data/scenarios/event_list/ruby.mako +55 -81
- data/scenarios/event_show/ruby.mako +35 -45
- data/scenarios/order_create/ruby.mako +16 -14
- data/scenarios/order_list/ruby.mako +33 -29
- data/scenarios/order_show/ruby.mako +16 -14
- data/scenarios/order_update/ruby.mako +16 -14
- data/scenarios/refund_create/ruby.mako +13 -13
- data/scenarios/refund_list/ruby.mako +12 -12
- data/scenarios/refund_show/ruby.mako +13 -13
- data/scenarios/refund_update/ruby.mako +13 -13
- data/scenarios/reversal_create/ruby.mako +13 -13
- data/scenarios/reversal_list/ruby.mako +12 -12
- data/scenarios/reversal_show/ruby.mako +13 -13
- data/scenarios/reversal_update/ruby.mako +13 -13
- data/scenarios/settlement_create/definition.rb +1 -0
- data/scenarios/settlement_create/request.rb +5 -0
- data/scenarios/settlement_create/ruby.mako +48 -0
- data/scenarios/settlement_list/definition.rb +1 -0
- data/scenarios/settlement_list/request.rb +2 -0
- data/scenarios/settlement_list/ruby.mako +40 -0
- data/scenarios/settlement_list_account/definition.rb +1 -0
- data/scenarios/settlement_list_account/request.rb +3 -0
- data/scenarios/settlement_list_account/ruby.mako +41 -0
- data/scenarios/settlement_show/definition.rb +1 -0
- data/scenarios/settlement_show/request.rb +2 -0
- data/scenarios/settlement_show/ruby.mako +40 -0
- data/snippets/account-balance.rb +1 -0
- data/snippets/bank-account-create.rb +6 -0
- data/snippets/bank-account-debit.rb +9 -0
- data/snippets/bank-account-verification-confirm.rb +5 -0
- data/snippets/bank-account-verification-create.rb +1 -0
- data/snippets/callback-create.rb +4 -0
- data/snippets/card-associate-to-customer.rb +2 -0
- data/snippets/card-create-dispute.rb +6 -0
- data/snippets/card-create.rb +7 -0
- data/snippets/card-credit.rb +9 -0
- data/snippets/card-debit.rb +9 -0
- data/snippets/card-hold-capture.rb +6 -0
- data/snippets/card-hold-create.rb +6 -0
- data/snippets/card-hold-void.rb +3 -0
- data/snippets/create-buyer-and-card.rb +13 -0
- data/snippets/credit-create.rb +8 -0
- data/snippets/credit-fetch.rb +1 -0
- data/snippets/credit-marketplace-escrow.rb +4 -0
- data/snippets/credit-reverse.rb +1 -0
- data/snippets/credit-soft-descriptor.rb +9 -0
- data/snippets/credit-split.rb +13 -0
- data/snippets/customer-create.rb +8 -0
- data/snippets/debit-dispute-show.rb +3 -0
- data/snippets/debit-fetch.rb +1 -0
- data/snippets/debit-marketplace-escrow.rb +4 -0
- data/snippets/debit-refund.rb +1 -0
- data/snippets/dispute-list.rb +1 -0
- data/snippets/dispute-show.rb +2 -0
- data/snippets/examine-order-after-refund.rb +3 -0
- data/snippets/examine-order-after-reversal.rb +3 -0
- data/snippets/example.rb +1 -0
- data/snippets/marketplace-in-escrow.rb +1 -0
- data/snippets/merchant-payable-account-fetch.rb +2 -0
- data/snippets/order-amount-escrowed.rb +3 -0
- data/snippets/order-bank-account-create.rb +8 -0
- data/snippets/order-create.rb +1 -0
- data/snippets/order-credit-marketplace.rb +5 -0
- data/snippets/order-credit-merchant-payable-account.rb +4 -0
- data/snippets/order-credit.rb +4 -0
- data/snippets/order-credits-fetch.rb +1 -0
- data/snippets/order-debit.rb +4 -0
- data/snippets/order-debits-fetch.rb +1 -0
- data/snippets/order-fetch.rb +1 -0
- data/snippets/order-update.rb +5 -0
- data/snippets/refund-create.rb +13 -0
- data/snippets/reversal-create.rb +13 -0
- data/snippets/settlement-create.rb +5 -0
- data/spec/balanced/resources/account_spec.rb +265 -0
- data/spec/balanced/resources/card_spec.rb +6 -6
- metadata +86 -2
@@ -2,9 +2,9 @@
|
|
2
2
|
Balanced::ApiKey.unstore
|
3
3
|
% elif mode == 'request':
|
4
4
|
require 'balanced'
|
5
|
-
Balanced.configure('ak-test-
|
5
|
+
Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
|
6
6
|
|
7
|
-
key = Balanced::ApiKey.fetch('/api_keys/
|
7
|
+
key = Balanced::ApiKey.fetch('/api_keys/AK6gw2iNQrFpQk7jb8ONNjdb')
|
8
8
|
key.unstore
|
9
9
|
|
10
10
|
% elif mode == 'response':
|
@@ -2,27 +2,27 @@
|
|
2
2
|
Balanced::ApiKey.all
|
3
3
|
% elif mode == 'request':
|
4
4
|
require 'balanced'
|
5
|
-
Balanced.configure('ak-test-
|
5
|
+
Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
|
6
6
|
|
7
7
|
card = Balanced::ApiKey.all
|
8
8
|
|
9
9
|
% elif mode == 'response':
|
10
|
-
[#<Balanced::ApiKey:
|
10
|
+
[#<Balanced::ApiKey:0x007fcde3ae3c20
|
11
11
|
@attributes=
|
12
|
-
{"created_at"=>"2014-
|
13
|
-
"href"=>"/api_keys/
|
14
|
-
"id"=>"
|
12
|
+
{"created_at"=>"2014-12-17T21:24:11.308489Z",
|
13
|
+
"href"=>"/api_keys/AK6gw2iNQrFpQk7jb8ONNjdb",
|
14
|
+
"id"=>"AK6gw2iNQrFpQk7jb8ONNjdb",
|
15
15
|
"links"=>{},
|
16
16
|
"meta"=>{}},
|
17
17
|
@hyperlinks={}>,
|
18
|
-
#<Balanced::ApiKey:
|
18
|
+
#<Balanced::ApiKey:0x007fcde3ae3a68
|
19
19
|
@attributes=
|
20
|
-
{"created_at"=>"2014-
|
21
|
-
"href"=>"/api_keys/
|
22
|
-
"id"=>"
|
20
|
+
{"created_at"=>"2014-12-17T21:23:56.753175Z",
|
21
|
+
"href"=>"/api_keys/AK609iYW4vCKAiy9TqR73hDi",
|
22
|
+
"id"=>"AK609iYW4vCKAiy9TqR73hDi",
|
23
23
|
"links"=>{},
|
24
24
|
"meta"=>{},
|
25
|
-
"secret"=>"ak-test-
|
25
|
+
"secret"=>"ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX"},
|
26
26
|
@hyperlinks={}>]
|
27
27
|
|
28
28
|
% endif
|
@@ -2,15 +2,15 @@
|
|
2
2
|
Balanced::ApiKey.fetch
|
3
3
|
% elif mode == 'request':
|
4
4
|
require 'balanced'
|
5
|
-
Balanced.configure('ak-test-
|
5
|
+
Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
|
6
6
|
|
7
|
-
card = Balanced::ApiKey.fetch('/api_keys/
|
7
|
+
card = Balanced::ApiKey.fetch('/api_keys/AK6gw2iNQrFpQk7jb8ONNjdb')
|
8
8
|
% elif mode == 'response':
|
9
|
-
#<Balanced::ApiKey:
|
9
|
+
#<Balanced::ApiKey:0x007fcde3af2658
|
10
10
|
@attributes=
|
11
|
-
{"created_at"=>"2014-
|
12
|
-
"href"=>"/api_keys/
|
13
|
-
"id"=>"
|
11
|
+
{"created_at"=>"2014-12-17T21:24:11.308489Z",
|
12
|
+
"href"=>"/api_keys/AK6gw2iNQrFpQk7jb8ONNjdb",
|
13
|
+
"id"=>"AK6gw2iNQrFpQk7jb8ONNjdb",
|
14
14
|
"links"=>{},
|
15
15
|
"meta"=>{}},
|
16
16
|
@hyperlinks={}>
|
@@ -3,13 +3,13 @@ Balanced::BankAccount.associate_to_customer
|
|
3
3
|
|
4
4
|
% elif mode == 'request':
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('ak-test-
|
6
|
+
Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
|
7
7
|
|
8
|
-
bank_account = Balanced::BankAccount.fetch("/bank_accounts/
|
9
|
-
bank_account.associate_to_customer("/customers/
|
8
|
+
bank_account = Balanced::BankAccount.fetch("/bank_accounts/BA6FZjm2W2mK0DIQibA1sjHv")
|
9
|
+
bank_account.associate_to_customer("/customers/CU68iUpvvUwpRpuuBL3u9Slq")
|
10
10
|
|
11
11
|
% elif mode == 'response':
|
12
|
-
#<Balanced::BankAccount:
|
12
|
+
#<Balanced::BankAccount:0x007fcde18f7da0
|
13
13
|
@attributes=
|
14
14
|
{"account_number"=>"xxxxxx0001",
|
15
15
|
"account_type"=>"checking",
|
@@ -23,27 +23,29 @@ bank_account.associate_to_customer("/customers/CU2L981m9AtPY8pjpGpjnjnf")
|
|
23
23
|
"bank_name"=>"BANK OF AMERICA, N.A.",
|
24
24
|
"can_credit"=>true,
|
25
25
|
"can_debit"=>false,
|
26
|
-
"created_at"=>"2014-
|
26
|
+
"created_at"=>"2014-12-17T21:24:33.958576Z",
|
27
27
|
"fingerprint"=>
|
28
28
|
"5f0ba9fa3f1122ef13b944a40abfe44e7eba9e16934e64200913cb4c402ace14",
|
29
|
-
"href"=>"/bank_accounts/
|
30
|
-
"id"=>"
|
29
|
+
"href"=>"/bank_accounts/BA6FZjm2W2mK0DIQibA1sjHv",
|
30
|
+
"id"=>"BA6FZjm2W2mK0DIQibA1sjHv",
|
31
31
|
"links"=>
|
32
|
-
{"bank_account_verification"=>nil, "customer"=>"
|
32
|
+
{"bank_account_verification"=>nil, "customer"=>"CU68iUpvvUwpRpuuBL3u9Slq"},
|
33
33
|
"meta"=>{},
|
34
34
|
"name"=>"Johann Bernoulli",
|
35
35
|
"routing_number"=>"121000358",
|
36
|
-
"updated_at"=>"2014-
|
36
|
+
"updated_at"=>"2014-12-17T21:24:34.483147Z"},
|
37
37
|
@hyperlinks=
|
38
38
|
{"bank_account_verification"=>
|
39
|
-
#<Proc:
|
39
|
+
#<Proc:0x007fcde18f7238/lib/balanced/utils.rb:6 (lambda)>,
|
40
40
|
"bank_account_verifications"=>
|
41
|
-
#<Proc:
|
41
|
+
#<Proc:0x007fcde18f52f8/lib/balanced/utils.rb:6 (lambda)>,
|
42
42
|
"credits"=>
|
43
|
-
#<Proc:
|
43
|
+
#<Proc:0x007fcde18ff348/lib/balanced/utils.rb:6 (lambda)>,
|
44
44
|
"customer"=>
|
45
|
-
#<Proc:
|
45
|
+
#<Proc:0x007fcde18fd9a8/lib/balanced/resources/resource.rb:56 (lambda)>,
|
46
46
|
"debits"=>
|
47
|
-
#<Proc:
|
47
|
+
#<Proc:0x007fcde1907a20/lib/balanced/utils.rb:6 (lambda)>,
|
48
|
+
"settlements"=>
|
49
|
+
#<Proc:0x007fcde1905ae0/lib/balanced/utils.rb:6 (lambda)>}>
|
48
50
|
|
49
51
|
% endif
|
@@ -3,7 +3,7 @@ Balanced::BankAccount.new
|
|
3
3
|
|
4
4
|
% elif mode == 'request':
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('ak-test-
|
6
|
+
Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
|
7
7
|
|
8
8
|
bank_account = Balanced::BankAccount.new(
|
9
9
|
:account_number => '9900000001',
|
@@ -13,7 +13,7 @@ bank_account = Balanced::BankAccount.new(
|
|
13
13
|
).save
|
14
14
|
|
15
15
|
% elif mode == 'response':
|
16
|
-
#<Balanced::BankAccount:
|
16
|
+
#<Balanced::BankAccount:0x007fcde19251d8
|
17
17
|
@attributes=
|
18
18
|
{"account_number"=>"xxxxxx0001",
|
19
19
|
"account_type"=>"checking",
|
@@ -27,26 +27,28 @@ bank_account = Balanced::BankAccount.new(
|
|
27
27
|
"bank_name"=>"BANK OF AMERICA, N.A.",
|
28
28
|
"can_credit"=>true,
|
29
29
|
"can_debit"=>false,
|
30
|
-
"created_at"=>"2014-
|
30
|
+
"created_at"=>"2014-12-17T21:24:33.958576Z",
|
31
31
|
"fingerprint"=>
|
32
32
|
"5f0ba9fa3f1122ef13b944a40abfe44e7eba9e16934e64200913cb4c402ace14",
|
33
|
-
"href"=>"/bank_accounts/
|
34
|
-
"id"=>"
|
33
|
+
"href"=>"/bank_accounts/BA6FZjm2W2mK0DIQibA1sjHv",
|
34
|
+
"id"=>"BA6FZjm2W2mK0DIQibA1sjHv",
|
35
35
|
"links"=>{"bank_account_verification"=>nil, "customer"=>nil},
|
36
36
|
"meta"=>{},
|
37
37
|
"name"=>"Johann Bernoulli",
|
38
38
|
"routing_number"=>"121000358",
|
39
|
-
"updated_at"=>"2014-
|
39
|
+
"updated_at"=>"2014-12-17T21:24:33.958578Z"},
|
40
40
|
@hyperlinks=
|
41
41
|
{"bank_account_verification"=>
|
42
|
-
#<Proc:
|
42
|
+
#<Proc:0x007fcde1924670/lib/balanced/utils.rb:6 (lambda)>,
|
43
43
|
"bank_account_verifications"=>
|
44
|
-
#<Proc:
|
44
|
+
#<Proc:0x007fcde192e710/lib/balanced/utils.rb:6 (lambda)>,
|
45
45
|
"credits"=>
|
46
|
-
#<Proc:
|
46
|
+
#<Proc:0x007fcde192c7a8/lib/balanced/utils.rb:6 (lambda)>,
|
47
47
|
"customer"=>
|
48
|
-
#<Proc:
|
48
|
+
#<Proc:0x007fcde1937d88/lib/balanced/utils.rb:6 (lambda)>,
|
49
49
|
"debits"=>
|
50
|
-
#<Proc:
|
50
|
+
#<Proc:0x007fcde1935e48/lib/balanced/utils.rb:6 (lambda)>,
|
51
|
+
"settlements"=>
|
52
|
+
#<Proc:0x007fcde193fec0/lib/balanced/utils.rb:6 (lambda)>}>
|
51
53
|
|
52
54
|
% endif
|
@@ -3,40 +3,40 @@ Balanced::BankAccount.credit
|
|
3
3
|
|
4
4
|
% elif mode == 'request':
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('ak-test-
|
6
|
+
Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
|
7
7
|
|
8
|
-
bank_account = Balanced::BankAccount.fetch('/bank_accounts/
|
8
|
+
bank_account = Balanced::BankAccount.fetch('/bank_accounts/BA6FZjm2W2mK0DIQibA1sjHv')
|
9
9
|
bank_account.credit(:amount => 5000)
|
10
10
|
% elif mode == 'response':
|
11
|
-
#<Balanced::Credit:
|
11
|
+
#<Balanced::Credit:0x007fcde195f158
|
12
12
|
@attributes=
|
13
13
|
{"amount"=>5000,
|
14
14
|
"appears_on_statement_as"=>"example.com",
|
15
|
-
"created_at"=>"2014-
|
15
|
+
"created_at"=>"2014-12-17T21:26:05.270762Z",
|
16
16
|
"currency"=>"USD",
|
17
17
|
"description"=>nil,
|
18
18
|
"failure_reason"=>nil,
|
19
19
|
"failure_reason_code"=>nil,
|
20
|
-
"href"=>"/credits/
|
21
|
-
"id"=>"
|
20
|
+
"href"=>"/credits/CRxBIVaPCDZEbVgE1Jb0jkc",
|
21
|
+
"id"=>"CRxBIVaPCDZEbVgE1Jb0jkc",
|
22
22
|
"links"=>
|
23
|
-
{"customer"=>"
|
24
|
-
"destination"=>"
|
23
|
+
{"customer"=>"CU68iUpvvUwpRpuuBL3u9Slq",
|
24
|
+
"destination"=>"BA6FZjm2W2mK0DIQibA1sjHv",
|
25
25
|
"order"=>nil},
|
26
26
|
"meta"=>{},
|
27
|
-
"status"=>"
|
28
|
-
"transaction_number"=>"
|
29
|
-
"updated_at"=>"2014-
|
27
|
+
"status"=>"pending",
|
28
|
+
"transaction_number"=>"CRO2C-OJ8-PQSK",
|
29
|
+
"updated_at"=>"2014-12-17T21:26:05.739244Z"},
|
30
30
|
@hyperlinks=
|
31
31
|
{"customer"=>
|
32
|
-
#<Proc:
|
32
|
+
#<Proc:0x007fcde195d628/lib/balanced/resources/resource.rb:56 (lambda)>,
|
33
33
|
"destination"=>
|
34
|
-
#<Proc:
|
34
|
+
#<Proc:0x007fcde1967c90/lib/balanced/resources/resource.rb:56 (lambda)>,
|
35
35
|
"events"=>
|
36
|
-
#<Proc:
|
36
|
+
#<Proc:0x007fcde1965ee0/lib/balanced/utils.rb:6 (lambda)>,
|
37
37
|
"order"=>
|
38
|
-
#<Proc:
|
38
|
+
#<Proc:0x007fcde1965508/lib/balanced/utils.rb:6 (lambda)>,
|
39
39
|
"reversals"=>
|
40
|
-
#<Proc:
|
40
|
+
#<Proc:0x007fcde196f710/lib/balanced/utils.rb:6 (lambda)>}>
|
41
41
|
|
42
42
|
% endif
|
@@ -3,9 +3,9 @@ Balanced::BankAccount.debit
|
|
3
3
|
|
4
4
|
% elif mode == 'request':
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('ak-test-
|
6
|
+
Balanced.configure('ak-test-25ZY8HQwZPuQtDecrxb671LilUya5t5G0')
|
7
7
|
|
8
|
-
bank_account = Balanced::BankAccount.fetch('/bank_accounts/
|
8
|
+
bank_account = Balanced::BankAccount.fetch('/bank_accounts/BA17zYxBNrmg9isvicjz9Ae4')
|
9
9
|
bank_account.debit(
|
10
10
|
:amount => 5000,
|
11
11
|
:appears_on_statement_as => 'Statement text',
|
@@ -13,38 +13,41 @@ bank_account.debit(
|
|
13
13
|
)
|
14
14
|
|
15
15
|
% elif mode == 'response':
|
16
|
-
#<Balanced::Debit:
|
16
|
+
#<Balanced::Debit:0x007fb1e9473a68
|
17
17
|
@attributes=
|
18
18
|
{"amount"=>5000,
|
19
19
|
"appears_on_statement_as"=>"BAL*Statement text",
|
20
|
-
"created_at"=>"2014-
|
20
|
+
"created_at"=>"2014-11-14T19:28:20.531858Z",
|
21
21
|
"currency"=>"USD",
|
22
22
|
"description"=>"Some descriptive text for the debit in the dashboard",
|
23
23
|
"failure_reason"=>nil,
|
24
24
|
"failure_reason_code"=>nil,
|
25
|
-
"href"=>"/debits/
|
26
|
-
"id"=>"
|
25
|
+
"href"=>"/debits/WD2rNbc5IxoDIyiumypsUMtv",
|
26
|
+
"id"=>"WD2rNbc5IxoDIyiumypsUMtv",
|
27
27
|
"links"=>
|
28
|
-
{"
|
28
|
+
{"card_hold"=>nil,
|
29
|
+
"customer"=>nil,
|
29
30
|
"dispute"=>nil,
|
30
31
|
"order"=>nil,
|
31
|
-
"source"=>"
|
32
|
+
"source"=>"BA17zYxBNrmg9isvicjz9Ae4"},
|
32
33
|
"meta"=>{},
|
33
|
-
"status"=>"
|
34
|
-
"transaction_number"=>"
|
35
|
-
"updated_at"=>"2014-
|
34
|
+
"status"=>"pending",
|
35
|
+
"transaction_number"=>"WSVJ-8FD-G2UK",
|
36
|
+
"updated_at"=>"2014-11-14T19:28:20.985200Z"},
|
36
37
|
@hyperlinks=
|
37
|
-
{"
|
38
|
-
#<Proc:
|
38
|
+
{"card_hold"=>
|
39
|
+
#<Proc:0x007fb1e9472f28@/Users/ben/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/balanced-1.1.1/lib/balanced/utils.rb:6 (lambda)>,
|
40
|
+
"customer"=>
|
41
|
+
#<Proc:0x007fb1e94725a0@/Users/ben/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/balanced-1.1.1/lib/balanced/utils.rb:6 (lambda)>,
|
39
42
|
"dispute"=>
|
40
|
-
#<Proc:
|
43
|
+
#<Proc:0x007fb1e9471c18@/Users/ben/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/balanced-1.1.1/lib/balanced/utils.rb:6 (lambda)>,
|
41
44
|
"events"=>
|
42
|
-
#<Proc:
|
45
|
+
#<Proc:0x007fb1e947bd58@/Users/ben/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/balanced-1.1.1/lib/balanced/utils.rb:6 (lambda)>,
|
43
46
|
"order"=>
|
44
|
-
#<Proc:
|
47
|
+
#<Proc:0x007fb1e947b380@/Users/ben/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/balanced-1.1.1/lib/balanced/utils.rb:6 (lambda)>,
|
45
48
|
"refunds"=>
|
46
|
-
#<Proc:
|
49
|
+
#<Proc:0x007fb1e9479530@/Users/ben/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/balanced-1.1.1/lib/balanced/utils.rb:6 (lambda)>,
|
47
50
|
"source"=>
|
48
|
-
#<Proc:
|
51
|
+
#<Proc:0x007fb1e9483b48@/Users/ben/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/balanced-1.1.1/lib/balanced/resources/resource.rb:60 (lambda)>}>
|
49
52
|
|
50
53
|
% endif
|
@@ -0,0 +1 @@
|
|
1
|
+
Balanced::Order.debit_from
|
@@ -0,0 +1,52 @@
|
|
1
|
+
% if mode == 'definition':
|
2
|
+
Balanced::Order.debit_from
|
3
|
+
% elif mode == 'request':
|
4
|
+
require 'balanced'
|
5
|
+
Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
|
6
|
+
|
7
|
+
order = Balanced::Order.fetch('/orders/OR6c6n11zKSFfjE6kGNKtsE8')
|
8
|
+
bank_account = Balanced::BankAccount.fetch('/bank_accounts/BA6m4zboF7ocvKbkhjszP5NS')
|
9
|
+
order.debit_from(
|
10
|
+
:source => bank_account,
|
11
|
+
:amount => 5000
|
12
|
+
)
|
13
|
+
|
14
|
+
% elif mode == 'response':
|
15
|
+
#<Balanced::Debit:0x007fcde1984598
|
16
|
+
@attributes=
|
17
|
+
{"amount"=>5000,
|
18
|
+
"appears_on_statement_as"=>"BAL*example.com",
|
19
|
+
"created_at"=>"2014-12-17T21:24:36.080525Z",
|
20
|
+
"currency"=>"USD",
|
21
|
+
"description"=>"Order #12341234",
|
22
|
+
"failure_reason"=>nil,
|
23
|
+
"failure_reason_code"=>nil,
|
24
|
+
"href"=>"/debits/WD6InqCi6JBE8YNoH0co1Wla",
|
25
|
+
"id"=>"WD6InqCi6JBE8YNoH0co1Wla",
|
26
|
+
"links"=>
|
27
|
+
{"card_hold"=>nil,
|
28
|
+
"customer"=>nil,
|
29
|
+
"dispute"=>nil,
|
30
|
+
"order"=>"OR6c6n11zKSFfjE6kGNKtsE8",
|
31
|
+
"source"=>"BA6m4zboF7ocvKbkhjszP5NS"},
|
32
|
+
"meta"=>{},
|
33
|
+
"status"=>"pending",
|
34
|
+
"transaction_number"=>"WC7M-IMJ-2SSI",
|
35
|
+
"updated_at"=>"2014-12-17T21:24:36.328328Z"},
|
36
|
+
@hyperlinks=
|
37
|
+
{"card_hold"=>
|
38
|
+
#<Proc:0x007fcde198fa10/lib/balanced/utils.rb:6 (lambda)>,
|
39
|
+
"customer"=>
|
40
|
+
#<Proc:0x007fcde198f088/lib/balanced/utils.rb:6 (lambda)>,
|
41
|
+
"dispute"=>
|
42
|
+
#<Proc:0x007fcde198e700/lib/balanced/utils.rb:6 (lambda)>,
|
43
|
+
"events"=>
|
44
|
+
#<Proc:0x007fcde198c888/lib/balanced/utils.rb:6 (lambda)>,
|
45
|
+
"order"=>
|
46
|
+
#<Proc:0x007fcde1996e78/lib/balanced/resources/resource.rb:56 (lambda)>,
|
47
|
+
"refunds"=>
|
48
|
+
#<Proc:0x007fcde1995028/lib/balanced/utils.rb:6 (lambda)>,
|
49
|
+
"source"=>
|
50
|
+
#<Proc:0x007fcde199f668/lib/balanced/resources/resource.rb:56 (lambda)>}>
|
51
|
+
|
52
|
+
% endif
|
@@ -3,9 +3,9 @@ Balanced::BankAccount.unstore
|
|
3
3
|
|
4
4
|
% elif mode == 'request':
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('ak-test-
|
6
|
+
Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
|
7
7
|
|
8
|
-
bank_account = Balanced::BankAccount.fetch('/bank_accounts/
|
8
|
+
bank_account = Balanced::BankAccount.fetch('/bank_accounts/BA6z9hDVGj7utvQSiIhHuuhf')
|
9
9
|
bank_account.unstore
|
10
10
|
|
11
11
|
% elif mode == 'response':
|
@@ -3,12 +3,12 @@ Balanced::BankAccount.all
|
|
3
3
|
|
4
4
|
% elif mode == 'request':
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('ak-test-
|
6
|
+
Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
|
7
7
|
|
8
8
|
Balanced::BankAccount.all
|
9
9
|
|
10
10
|
% elif mode == 'response':
|
11
|
-
[#<Balanced::BankAccount:
|
11
|
+
[#<Balanced::BankAccount:0x007fcde197e7d8
|
12
12
|
@attributes=
|
13
13
|
{"account_number"=>"xxxxxx0001",
|
14
14
|
"account_type"=>"checking",
|
@@ -22,28 +22,30 @@ Balanced::BankAccount.all
|
|
22
22
|
"bank_name"=>"BANK OF AMERICA, N.A.",
|
23
23
|
"can_credit"=>true,
|
24
24
|
"can_debit"=>false,
|
25
|
-
"created_at"=>"2014-
|
25
|
+
"created_at"=>"2014-12-17T21:24:27.877249Z",
|
26
26
|
"fingerprint"=>
|
27
27
|
"5f0ba9fa3f1122ef13b944a40abfe44e7eba9e16934e64200913cb4c402ace14",
|
28
|
-
"href"=>"/bank_accounts/
|
29
|
-
"id"=>"
|
28
|
+
"href"=>"/bank_accounts/BA6z9hDVGj7utvQSiIhHuuhf",
|
29
|
+
"id"=>"BA6z9hDVGj7utvQSiIhHuuhf",
|
30
30
|
"links"=>{"bank_account_verification"=>nil, "customer"=>nil},
|
31
31
|
"meta"=>{},
|
32
32
|
"name"=>"Johann Bernoulli",
|
33
33
|
"routing_number"=>"121000358",
|
34
|
-
"updated_at"=>"2014-
|
34
|
+
"updated_at"=>"2014-12-17T21:24:27.877250Z"},
|
35
35
|
@hyperlinks=
|
36
36
|
{"bank_account_verification"=>
|
37
|
-
#<Proc:
|
37
|
+
#<Proc:0x007fcde197dc70/lib/balanced/utils.rb:6 (lambda)>,
|
38
38
|
"bank_account_verifications"=>
|
39
|
-
#<Proc:
|
39
|
+
#<Proc:0x007fcde195fc48/lib/balanced/utils.rb:6 (lambda)>,
|
40
40
|
"credits"=>
|
41
|
-
#<Proc:
|
41
|
+
#<Proc:0x007fcde195dce0/lib/balanced/utils.rb:6 (lambda)>,
|
42
42
|
"customer"=>
|
43
|
-
#<Proc:
|
43
|
+
#<Proc:0x007fcde195d330/lib/balanced/utils.rb:6 (lambda)>,
|
44
44
|
"debits"=>
|
45
|
-
#<Proc:
|
46
|
-
|
45
|
+
#<Proc:0x007fcde19272d0/lib/balanced/utils.rb:6 (lambda)>,
|
46
|
+
"settlements"=>
|
47
|
+
#<Proc:0x007fcde19252f0/lib/balanced/utils.rb:6 (lambda)>}>,
|
48
|
+
#<Balanced::BankAccount:0x007fcde19252a0
|
47
49
|
@attributes=
|
48
50
|
{"account_number"=>"xxxxxx0001",
|
49
51
|
"account_type"=>"checking",
|
@@ -57,28 +59,30 @@ Balanced::BankAccount.all
|
|
57
59
|
"bank_name"=>"BANK OF AMERICA, N.A.",
|
58
60
|
"can_credit"=>true,
|
59
61
|
"can_debit"=>true,
|
60
|
-
"created_at"=>"2014-
|
62
|
+
"created_at"=>"2014-12-17T21:24:16.246660Z",
|
61
63
|
"fingerprint"=>
|
62
64
|
"5f0ba9fa3f1122ef13b944a40abfe44e7eba9e16934e64200913cb4c402ace14",
|
63
|
-
"href"=>"/bank_accounts/
|
64
|
-
"id"=>"
|
65
|
+
"href"=>"/bank_accounts/BA6m4zboF7ocvKbkhjszP5NS",
|
66
|
+
"id"=>"BA6m4zboF7ocvKbkhjszP5NS",
|
65
67
|
"links"=>
|
66
|
-
{"bank_account_verification"=>"
|
68
|
+
{"bank_account_verification"=>"BZ6tLSIRoUIhzntA96EfMaQl",
|
67
69
|
"customer"=>nil},
|
68
70
|
"meta"=>{},
|
69
71
|
"name"=>"Johann Bernoulli",
|
70
72
|
"routing_number"=>"121000358",
|
71
|
-
"updated_at"=>"2014-
|
73
|
+
"updated_at"=>"2014-12-17T21:24:26.167634Z"},
|
72
74
|
@hyperlinks=
|
73
75
|
{"bank_account_verification"=>
|
74
|
-
#<Proc:
|
76
|
+
#<Proc:0x007fcde18f77b0/lib/balanced/resources/resource.rb:56 (lambda)>,
|
75
77
|
"bank_account_verifications"=>
|
76
|
-
#<Proc:
|
78
|
+
#<Proc:0x007fcde18f5898/lib/balanced/utils.rb:6 (lambda)>,
|
77
79
|
"credits"=>
|
78
|
-
#<Proc:
|
80
|
+
#<Proc:0x007fcde18ef920/lib/balanced/utils.rb:6 (lambda)>,
|
79
81
|
"customer"=>
|
80
|
-
#<Proc:
|
82
|
+
#<Proc:0x007fcde18eef70/lib/balanced/utils.rb:6 (lambda)>,
|
81
83
|
"debits"=>
|
82
|
-
#<Proc:
|
84
|
+
#<Proc:0x007fcde18ecef0/lib/balanced/utils.rb:6 (lambda)>,
|
85
|
+
"settlements"=>
|
86
|
+
#<Proc:0x007fcde3af2fb8/lib/balanced/utils.rb:6 (lambda)>}>]
|
83
87
|
|
84
88
|
% endif
|