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::Credit.reverse
|
3
3
|
% elif mode == 'request':
|
4
4
|
require 'balanced'
|
5
|
-
Balanced.configure('ak-test-
|
5
|
+
Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
|
6
6
|
|
7
|
-
reversal = Balanced::Credit.fetch('/credits/
|
7
|
+
reversal = Balanced::Credit.fetch('/credits/CRxBIVaPCDZEbVgE1Jb0jkc')
|
8
8
|
credit.reverse(
|
9
9
|
:amount => 3000,
|
10
10
|
:description => 'Reversal for Order #1111',
|
@@ -16,30 +16,30 @@ credit.reverse(
|
|
16
16
|
)
|
17
17
|
|
18
18
|
% elif mode == 'response':
|
19
|
-
#<Balanced::Reversal:
|
19
|
+
#<Balanced::Reversal:0x007fcde09636f0
|
20
20
|
@attributes=
|
21
21
|
{"amount"=>3000,
|
22
|
-
"created_at"=>"2014-
|
22
|
+
"created_at"=>"2014-12-17T21:26:06.246868Z",
|
23
23
|
"currency"=>"USD",
|
24
24
|
"description"=>"Reversal for Order #1111",
|
25
25
|
"failure_reason"=>nil,
|
26
26
|
"failure_reason_code"=>nil,
|
27
|
-
"href"=>"/reversals/
|
28
|
-
"id"=>"
|
29
|
-
"links"=>{"credit"=>"
|
27
|
+
"href"=>"/reversals/RVyHZ2toyTu9BCvGNLsOvLi",
|
28
|
+
"id"=>"RVyHZ2toyTu9BCvGNLsOvLi",
|
29
|
+
"links"=>{"credit"=>"CRxBIVaPCDZEbVgE1Jb0jkc", "order"=>nil},
|
30
30
|
"meta"=>
|
31
31
|
{"fulfillment.item.condition"=>"OK",
|
32
32
|
"merchant.feedback"=>"positive",
|
33
33
|
"user.refund_reason"=>"not happy with product"},
|
34
|
-
"status"=>"
|
35
|
-
"transaction_number"=>"
|
36
|
-
"updated_at"=>"2014-
|
34
|
+
"status"=>"pending",
|
35
|
+
"transaction_number"=>"RV71F-IRJ-GYVF",
|
36
|
+
"updated_at"=>"2014-12-17T21:26:06.517468Z"},
|
37
37
|
@hyperlinks=
|
38
38
|
{"credit"=>
|
39
|
-
#<Proc:
|
39
|
+
#<Proc:0x007fcde09614b8/lib/balanced/resources/resource.rb:56 (lambda)>,
|
40
40
|
"events"=>
|
41
|
-
#<Proc:
|
41
|
+
#<Proc:0x007fcde093f020/lib/balanced/utils.rb:6 (lambda)>,
|
42
42
|
"order"=>
|
43
|
-
#<Proc:
|
43
|
+
#<Proc:0x007fcde093e670/lib/balanced/utils.rb:6 (lambda)>}>
|
44
44
|
|
45
45
|
% endif
|
@@ -3,34 +3,34 @@ Balanced::Reversal.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
|
reversals = Balanced::Reversal.all
|
9
9
|
% elif mode == 'response':
|
10
|
-
[#<Balanced::Reversal:
|
10
|
+
[#<Balanced::Reversal:0x007fcde3aa0da8
|
11
11
|
@attributes=
|
12
12
|
{"amount"=>3000,
|
13
|
-
"created_at"=>"2014-
|
13
|
+
"created_at"=>"2014-12-17T21:26:06.246868Z",
|
14
14
|
"currency"=>"USD",
|
15
15
|
"description"=>"Reversal for Order #1111",
|
16
16
|
"failure_reason"=>nil,
|
17
17
|
"failure_reason_code"=>nil,
|
18
|
-
"href"=>"/reversals/
|
19
|
-
"id"=>"
|
20
|
-
"links"=>{"credit"=>"
|
18
|
+
"href"=>"/reversals/RVyHZ2toyTu9BCvGNLsOvLi",
|
19
|
+
"id"=>"RVyHZ2toyTu9BCvGNLsOvLi",
|
20
|
+
"links"=>{"credit"=>"CRxBIVaPCDZEbVgE1Jb0jkc", "order"=>nil},
|
21
21
|
"meta"=>
|
22
22
|
{"fulfillment.item.condition"=>"OK",
|
23
23
|
"merchant.feedback"=>"positive",
|
24
24
|
"user.refund_reason"=>"not happy with product"},
|
25
|
-
"status"=>"
|
26
|
-
"transaction_number"=>"
|
27
|
-
"updated_at"=>"2014-
|
25
|
+
"status"=>"pending",
|
26
|
+
"transaction_number"=>"RV71F-IRJ-GYVF",
|
27
|
+
"updated_at"=>"2014-12-17T21:26:06.517468Z"},
|
28
28
|
@hyperlinks=
|
29
29
|
{"credit"=>
|
30
|
-
#<Proc:
|
30
|
+
#<Proc:0x007fcde3a93c98/lib/balanced/resources/resource.rb:56 (lambda)>,
|
31
31
|
"events"=>
|
32
|
-
#<Proc:
|
32
|
+
#<Proc:0x007fcde3a73448/lib/balanced/utils.rb:6 (lambda)>,
|
33
33
|
"order"=>
|
34
|
-
#<Proc:
|
34
|
+
#<Proc:0x007fcde3a71198/lib/balanced/utils.rb:6 (lambda)>}>]
|
35
35
|
|
36
36
|
% endif
|
@@ -3,35 +3,35 @@ Balanced::Reversal.fetch
|
|
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
|
-
reversal = Balanced::Reversal.fetch('/reversals/
|
8
|
+
reversal = Balanced::Reversal.fetch('/reversals/RVyHZ2toyTu9BCvGNLsOvLi')
|
9
9
|
|
10
10
|
% elif mode == 'response':
|
11
|
-
#<Balanced::Reversal:
|
11
|
+
#<Balanced::Reversal:0x007fcde39d6940
|
12
12
|
@attributes=
|
13
13
|
{"amount"=>3000,
|
14
|
-
"created_at"=>"2014-
|
14
|
+
"created_at"=>"2014-12-17T21:26:06.246868Z",
|
15
15
|
"currency"=>"USD",
|
16
16
|
"description"=>"Reversal for Order #1111",
|
17
17
|
"failure_reason"=>nil,
|
18
18
|
"failure_reason_code"=>nil,
|
19
|
-
"href"=>"/reversals/
|
20
|
-
"id"=>"
|
21
|
-
"links"=>{"credit"=>"
|
19
|
+
"href"=>"/reversals/RVyHZ2toyTu9BCvGNLsOvLi",
|
20
|
+
"id"=>"RVyHZ2toyTu9BCvGNLsOvLi",
|
21
|
+
"links"=>{"credit"=>"CRxBIVaPCDZEbVgE1Jb0jkc", "order"=>nil},
|
22
22
|
"meta"=>
|
23
23
|
{"fulfillment.item.condition"=>"OK",
|
24
24
|
"merchant.feedback"=>"positive",
|
25
25
|
"user.refund_reason"=>"not happy with product"},
|
26
|
-
"status"=>"
|
27
|
-
"transaction_number"=>"
|
28
|
-
"updated_at"=>"2014-
|
26
|
+
"status"=>"pending",
|
27
|
+
"transaction_number"=>"RV71F-IRJ-GYVF",
|
28
|
+
"updated_at"=>"2014-12-17T21:26:06.517468Z"},
|
29
29
|
@hyperlinks=
|
30
30
|
{"credit"=>
|
31
|
-
#<Proc:
|
31
|
+
#<Proc:0x007fcde39cf050/lib/balanced/resources/resource.rb:56 (lambda)>,
|
32
32
|
"events"=>
|
33
|
-
#<Proc:
|
33
|
+
#<Proc:0x007fcde39c4a88/lib/balanced/utils.rb:6 (lambda)>,
|
34
34
|
"order"=>
|
35
|
-
#<Proc:
|
35
|
+
#<Proc:0x007fcde39bfb00/lib/balanced/utils.rb:6 (lambda)>}>
|
36
36
|
|
37
37
|
% endif
|
@@ -3,9 +3,9 @@ Balanced::Reversal.save
|
|
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
|
-
reversal = Balanced::Reversal.fetch('/reversals/
|
8
|
+
reversal = Balanced::Reversal.fetch('/reversals/RVyHZ2toyTu9BCvGNLsOvLi')
|
9
9
|
reversal.description = 'update this description'
|
10
10
|
reversal.meta = {
|
11
11
|
'refund.reason' => 'user not happy with product',
|
@@ -15,30 +15,30 @@ reversal.meta = {
|
|
15
15
|
reversal.save
|
16
16
|
|
17
17
|
% elif mode == 'response':
|
18
|
-
#<Balanced::Reversal:
|
18
|
+
#<Balanced::Reversal:0x007fcde3986b70
|
19
19
|
@attributes=
|
20
20
|
{"amount"=>3000,
|
21
|
-
"created_at"=>"2014-
|
21
|
+
"created_at"=>"2014-12-17T21:26:06.246868Z",
|
22
22
|
"currency"=>"USD",
|
23
23
|
"description"=>"update this description",
|
24
24
|
"failure_reason"=>nil,
|
25
25
|
"failure_reason_code"=>nil,
|
26
|
-
"href"=>"/reversals/
|
27
|
-
"id"=>"
|
28
|
-
"links"=>{"credit"=>"
|
26
|
+
"href"=>"/reversals/RVyHZ2toyTu9BCvGNLsOvLi",
|
27
|
+
"id"=>"RVyHZ2toyTu9BCvGNLsOvLi",
|
28
|
+
"links"=>{"credit"=>"CRxBIVaPCDZEbVgE1Jb0jkc", "order"=>nil},
|
29
29
|
"meta"=>
|
30
30
|
{"refund.reason"=>"user not happy with product",
|
31
31
|
"user.notes"=>"very polite on the phone",
|
32
32
|
"user.satisfaction"=>"6"},
|
33
|
-
"status"=>"
|
34
|
-
"transaction_number"=>"
|
35
|
-
"updated_at"=>"2014-
|
33
|
+
"status"=>"pending",
|
34
|
+
"transaction_number"=>"RV71F-IRJ-GYVF",
|
35
|
+
"updated_at"=>"2014-12-17T21:26:10.853518Z"},
|
36
36
|
@hyperlinks=
|
37
37
|
{"credit"=>
|
38
|
-
#<Proc:
|
38
|
+
#<Proc:0x007fcde397f550/lib/balanced/resources/resource.rb:56 (lambda)>,
|
39
39
|
"events"=>
|
40
|
-
#<Proc:
|
40
|
+
#<Proc:0x007fcde3964cc8/lib/balanced/utils.rb:6 (lambda)>,
|
41
41
|
"order"=>
|
42
|
-
#<Proc:
|
42
|
+
#<Proc:0x007fcde395f0e8/lib/balanced/utils.rb:6 (lambda)>}>
|
43
43
|
|
44
44
|
% endif
|
@@ -0,0 +1 @@
|
|
1
|
+
Balanced::Account.settle
|
@@ -0,0 +1,48 @@
|
|
1
|
+
% if mode == 'definition':
|
2
|
+
Balanced::Account.settle
|
3
|
+
|
4
|
+
% elif mode == 'request':
|
5
|
+
require 'balanced'
|
6
|
+
Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
|
7
|
+
|
8
|
+
account = Balanced::Account.fetch('/accounts/AT68yF0GzJByks2OxU6oNjPy')
|
9
|
+
account.settle(
|
10
|
+
:appears_on_statement_as => 'ThingsCo',
|
11
|
+
:description => 'Payout A',
|
12
|
+
:funding_instrument => '/bank_accounts/BA6FZjm2W2mK0DIQibA1sjHv',
|
13
|
+
:meta => {
|
14
|
+
:group => 'alpha'
|
15
|
+
}
|
16
|
+
)
|
17
|
+
% elif mode == 'response':
|
18
|
+
#<Balanced::Settlement:0x007fcde3925550
|
19
|
+
@attributes=
|
20
|
+
{"amount"=>1000,
|
21
|
+
"appears_on_statement_as"=>"BAL*ThingsCo",
|
22
|
+
"created_at"=>"2014-12-17T21:26:13.225998Z",
|
23
|
+
"currency"=>"USD",
|
24
|
+
"description"=>"Payout A",
|
25
|
+
"failure_reason"=>nil,
|
26
|
+
"failure_reason_code"=>nil,
|
27
|
+
"href"=>"/settlements/STGy49Zg44ROAgkEbZP9T2w",
|
28
|
+
"id"=>"STGy49Zg44ROAgkEbZP9T2w",
|
29
|
+
"links"=>
|
30
|
+
{"destination"=>"BA6FZjm2W2mK0DIQibA1sjHv",
|
31
|
+
"source"=>"AT68yF0GzJByks2OxU6oNjPy"},
|
32
|
+
"meta"=>{"group"=>"alpha"},
|
33
|
+
"status"=>"pending",
|
34
|
+
"transaction_number"=>"SC3TJ-2PT-D0F1",
|
35
|
+
"updated_at"=>"2014-12-17T21:26:13.566850Z"},
|
36
|
+
@hyperlinks=
|
37
|
+
{"credits"=>
|
38
|
+
#<Proc:0x007fcde391e9f8/lib/balanced/utils.rb:6 (lambda)>,
|
39
|
+
"destination"=>
|
40
|
+
#<Proc:0x007fcde39160a0/lib/balanced/resources/resource.rb:56 (lambda)>,
|
41
|
+
"events"=>
|
42
|
+
#<Proc:0x007fcde390f660/lib/balanced/utils.rb:6 (lambda)>,
|
43
|
+
"reversals"=>
|
44
|
+
#<Proc:0x007fcde39070f0/lib/balanced/utils.rb:6 (lambda)>,
|
45
|
+
"source"=>
|
46
|
+
#<Proc:0x007fcde3907b18/lib/balanced/resources/resource.rb:56 (lambda)>}>
|
47
|
+
|
48
|
+
% endif
|
@@ -0,0 +1 @@
|
|
1
|
+
Balanced::Settlement.all
|
@@ -0,0 +1,40 @@
|
|
1
|
+
% if mode == 'definition':
|
2
|
+
Balanced::Settlement.all
|
3
|
+
% elif mode == 'request':
|
4
|
+
require 'balanced'
|
5
|
+
Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
|
6
|
+
|
7
|
+
Balanced::Settlement.all
|
8
|
+
|
9
|
+
% elif mode == 'response':
|
10
|
+
[#<Balanced::Settlement:0x007fcde389e988
|
11
|
+
@attributes=
|
12
|
+
{"amount"=>1000,
|
13
|
+
"appears_on_statement_as"=>"BAL*ThingsCo",
|
14
|
+
"created_at"=>"2014-12-17T21:26:13.225998Z",
|
15
|
+
"currency"=>"USD",
|
16
|
+
"description"=>"Payout A",
|
17
|
+
"failure_reason"=>nil,
|
18
|
+
"failure_reason_code"=>nil,
|
19
|
+
"href"=>"/settlements/STGy49Zg44ROAgkEbZP9T2w",
|
20
|
+
"id"=>"STGy49Zg44ROAgkEbZP9T2w",
|
21
|
+
"links"=>
|
22
|
+
{"destination"=>"BA6FZjm2W2mK0DIQibA1sjHv",
|
23
|
+
"source"=>"AT68yF0GzJByks2OxU6oNjPy"},
|
24
|
+
"meta"=>{"group"=>"alpha"},
|
25
|
+
"status"=>"pending",
|
26
|
+
"transaction_number"=>"SC3TJ-2PT-D0F1",
|
27
|
+
"updated_at"=>"2014-12-17T21:26:13.566850Z"},
|
28
|
+
@hyperlinks=
|
29
|
+
{"credits"=>
|
30
|
+
#<Proc:0x007fcde1170c58/lib/balanced/utils.rb:6 (lambda)>,
|
31
|
+
"destination"=>
|
32
|
+
#<Proc:0x007fcde1162d60/lib/balanced/resources/resource.rb:56 (lambda)>,
|
33
|
+
"events"=>
|
34
|
+
#<Proc:0x007fcde1152f00/lib/balanced/utils.rb:6 (lambda)>,
|
35
|
+
"reversals"=>
|
36
|
+
#<Proc:0x007fcde1143500/lib/balanced/utils.rb:6 (lambda)>,
|
37
|
+
"source"=>
|
38
|
+
#<Proc:0x007fcde1139960/lib/balanced/resources/resource.rb:56 (lambda)>}>]
|
39
|
+
|
40
|
+
% endif
|
@@ -0,0 +1 @@
|
|
1
|
+
Balanced::Account.settlements
|
@@ -0,0 +1,41 @@
|
|
1
|
+
% if mode == 'definition':
|
2
|
+
Balanced::Account.settlements
|
3
|
+
|
4
|
+
% elif mode == 'request':
|
5
|
+
require 'balanced'
|
6
|
+
Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
|
7
|
+
|
8
|
+
account = Balanced::Account.fetch('/accounts/AT68yF0GzJByks2OxU6oNjPy')
|
9
|
+
account.settlements
|
10
|
+
% elif mode == 'response':
|
11
|
+
[#<Balanced::Settlement:0x007fcde10b5cc8
|
12
|
+
@attributes=
|
13
|
+
{"amount"=>1000,
|
14
|
+
"appears_on_statement_as"=>"BAL*ThingsCo",
|
15
|
+
"created_at"=>"2014-12-17T21:26:13.225998Z",
|
16
|
+
"currency"=>"USD",
|
17
|
+
"description"=>"Payout A",
|
18
|
+
"failure_reason"=>nil,
|
19
|
+
"failure_reason_code"=>nil,
|
20
|
+
"href"=>"/settlements/STGy49Zg44ROAgkEbZP9T2w",
|
21
|
+
"id"=>"STGy49Zg44ROAgkEbZP9T2w",
|
22
|
+
"links"=>
|
23
|
+
{"destination"=>"BA6FZjm2W2mK0DIQibA1sjHv",
|
24
|
+
"source"=>"AT68yF0GzJByks2OxU6oNjPy"},
|
25
|
+
"meta"=>{"group"=>"alpha"},
|
26
|
+
"status"=>"pending",
|
27
|
+
"transaction_number"=>"SC3TJ-2PT-D0F1",
|
28
|
+
"updated_at"=>"2014-12-17T21:26:13.566850Z"},
|
29
|
+
@hyperlinks=
|
30
|
+
{"credits"=>
|
31
|
+
#<Proc:0x007fcde10af580/lib/balanced/utils.rb:6 (lambda)>,
|
32
|
+
"destination"=>
|
33
|
+
#<Proc:0x007fcde10a3280/lib/balanced/resources/resource.rb:56 (lambda)>,
|
34
|
+
"events"=>
|
35
|
+
#<Proc:0x007fcde109a6a8/lib/balanced/utils.rb:6 (lambda)>,
|
36
|
+
"reversals"=>
|
37
|
+
#<Proc:0x007fcde1081ce8/lib/balanced/utils.rb:6 (lambda)>,
|
38
|
+
"source"=>
|
39
|
+
#<Proc:0x007fcde1808cc8/lib/balanced/resources/resource.rb:56 (lambda)>}>]
|
40
|
+
|
41
|
+
% endif
|
@@ -0,0 +1 @@
|
|
1
|
+
Balanced::Settlement.fetch
|
@@ -0,0 +1,40 @@
|
|
1
|
+
% if mode == 'definition':
|
2
|
+
Balanced::Settlement.fetch
|
3
|
+
% elif mode == 'request':
|
4
|
+
require 'balanced'
|
5
|
+
Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
|
6
|
+
|
7
|
+
settlement = Balanced::Settlement.fetch('/settlements/STGy49Zg44ROAgkEbZP9T2w')
|
8
|
+
|
9
|
+
% elif mode == 'response':
|
10
|
+
#<Balanced::Settlement:0x007fcde08a9570
|
11
|
+
@attributes=
|
12
|
+
{"amount"=>1000,
|
13
|
+
"appears_on_statement_as"=>"BAL*ThingsCo",
|
14
|
+
"created_at"=>"2014-12-17T21:26:13.225998Z",
|
15
|
+
"currency"=>"USD",
|
16
|
+
"description"=>"Payout A",
|
17
|
+
"failure_reason"=>nil,
|
18
|
+
"failure_reason_code"=>nil,
|
19
|
+
"href"=>"/settlements/STGy49Zg44ROAgkEbZP9T2w",
|
20
|
+
"id"=>"STGy49Zg44ROAgkEbZP9T2w",
|
21
|
+
"links"=>
|
22
|
+
{"destination"=>"BA6FZjm2W2mK0DIQibA1sjHv",
|
23
|
+
"source"=>"AT68yF0GzJByks2OxU6oNjPy"},
|
24
|
+
"meta"=>{"group"=>"alpha"},
|
25
|
+
"status"=>"pending",
|
26
|
+
"transaction_number"=>"SC3TJ-2PT-D0F1",
|
27
|
+
"updated_at"=>"2014-12-17T21:26:13.566850Z"},
|
28
|
+
@hyperlinks=
|
29
|
+
{"credits"=>
|
30
|
+
#<Proc:0x007fcde089a3b8/lib/balanced/utils.rb:6 (lambda)>,
|
31
|
+
"destination"=>
|
32
|
+
#<Proc:0x007fcde0882a88/lib/balanced/resources/resource.rb:56 (lambda)>,
|
33
|
+
"events"=>
|
34
|
+
#<Proc:0x007fcde084b5b0/lib/balanced/utils.rb:6 (lambda)>,
|
35
|
+
"reversals"=>
|
36
|
+
#<Proc:0x007fcde0843bd0/lib/balanced/utils.rb:6 (lambda)>,
|
37
|
+
"source"=>
|
38
|
+
#<Proc:0x007fcde0840f48/lib/balanced/resources/resource.rb:56 (lambda)>}>
|
39
|
+
|
40
|
+
% endif
|
@@ -0,0 +1 @@
|
|
1
|
+
account.balance
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# bank_account_href is the stored href for the BankAccount
|
2
|
+
# order_href is the stored href for the Order
|
3
|
+
bank_account = Balanced::BankAccount.fetch(bank_account_href)
|
4
|
+
bank_account.debit(
|
5
|
+
:amount => 5000,
|
6
|
+
:appears_on_statement_as => 'Statement text',
|
7
|
+
:description => 'Some descriptive text for the debit in the dashboard',
|
8
|
+
:order => order_href
|
9
|
+
)
|
@@ -0,0 +1 @@
|
|
1
|
+
verification = bank_account.verify
|