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,48 +2,51 @@
|
|
2
2
|
Balanced::Order.debit_from
|
3
3
|
% elif mode == 'request':
|
4
4
|
require 'balanced'
|
5
|
-
Balanced.configure('ak-test-
|
5
|
+
Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
|
6
6
|
|
7
|
-
order = Balanced::Order.fetch('/orders/
|
8
|
-
card = Balanced::Card.fetch('/cards/
|
7
|
+
order = Balanced::Order.fetch('/orders/OR6c6n11zKSFfjE6kGNKtsE8')
|
8
|
+
card = Balanced::Card.fetch('/cards/CC73IyzxPUu2z89NH8GrJhLn')
|
9
9
|
order.debit_from(
|
10
10
|
:source => card,
|
11
11
|
:amount => 5000
|
12
12
|
)
|
13
13
|
|
14
14
|
% elif mode == 'response':
|
15
|
-
#<Balanced::Debit:
|
15
|
+
#<Balanced::Debit:0x007fcde12d05d0
|
16
16
|
@attributes=
|
17
17
|
{"amount"=>5000,
|
18
18
|
"appears_on_statement_as"=>"BAL*example.com",
|
19
|
-
"created_at"=>"2014-
|
19
|
+
"created_at"=>"2014-12-17T21:25:04.086780Z",
|
20
20
|
"currency"=>"USD",
|
21
21
|
"description"=>"Order #12341234",
|
22
22
|
"failure_reason"=>nil,
|
23
23
|
"failure_reason_code"=>nil,
|
24
|
-
"href"=>"/debits/
|
25
|
-
"id"=>"
|
24
|
+
"href"=>"/debits/WD7dRwgfkmvirShpxn7JA8JL",
|
25
|
+
"id"=>"WD7dRwgfkmvirShpxn7JA8JL",
|
26
26
|
"links"=>
|
27
|
-
{"
|
27
|
+
{"card_hold"=>"HL7dQKkSsFJpaZppKe2pB4TX",
|
28
|
+
"customer"=>nil,
|
28
29
|
"dispute"=>nil,
|
29
|
-
"order"=>"
|
30
|
-
"source"=>"
|
30
|
+
"order"=>"OR6c6n11zKSFfjE6kGNKtsE8",
|
31
|
+
"source"=>"CC73IyzxPUu2z89NH8GrJhLn"},
|
31
32
|
"meta"=>{},
|
32
33
|
"status"=>"succeeded",
|
33
|
-
"transaction_number"=>"
|
34
|
-
"updated_at"=>"2014-
|
34
|
+
"transaction_number"=>"WG9L-4UP-ZQQN",
|
35
|
+
"updated_at"=>"2014-12-17T21:25:04.922248Z"},
|
35
36
|
@hyperlinks=
|
36
|
-
{"
|
37
|
-
#<Proc:
|
37
|
+
{"card_hold"=>
|
38
|
+
#<Proc:0x007fcde12daa58/lib/balanced/resources/resource.rb:56 (lambda)>,
|
39
|
+
"customer"=>
|
40
|
+
#<Proc:0x007fcde12da0d0/lib/balanced/utils.rb:6 (lambda)>,
|
38
41
|
"dispute"=>
|
39
|
-
#<Proc:
|
42
|
+
#<Proc:0x007fcde12d9748/lib/balanced/utils.rb:6 (lambda)>,
|
40
43
|
"events"=>
|
41
|
-
#<Proc:
|
44
|
+
#<Proc:0x007fcde12e3888/lib/balanced/utils.rb:6 (lambda)>,
|
42
45
|
"order"=>
|
43
|
-
#<Proc:
|
46
|
+
#<Proc:0x007fcde12e1ee8/lib/balanced/resources/resource.rb:56 (lambda)>,
|
44
47
|
"refunds"=>
|
45
|
-
#<Proc:
|
48
|
+
#<Proc:0x007fcde12e0098/lib/balanced/utils.rb:6 (lambda)>,
|
46
49
|
"source"=>
|
47
|
-
#<Proc:
|
50
|
+
#<Proc:0x007fcde12ea6d8/lib/balanced/resources/resource.rb:56 (lambda)>}>
|
48
51
|
|
49
52
|
% endif
|
@@ -3,43 +3,46 @@ Balanced::Debit.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
|
-
debit = Balanced::Debit.fetch('/debits/
|
8
|
+
debit = Balanced::Debit.fetch('/debits/WD7AAkAyeN6YTeHJTn1ThPYA')
|
9
9
|
|
10
10
|
% elif mode == 'response':
|
11
|
-
#<Balanced::Debit:
|
11
|
+
#<Balanced::Debit:0x007fcde1312d68
|
12
12
|
@attributes=
|
13
13
|
{"amount"=>5000,
|
14
14
|
"appears_on_statement_as"=>"BAL*Statement text",
|
15
|
-
"created_at"=>"2014-
|
15
|
+
"created_at"=>"2014-12-17T21:25:24.286272Z",
|
16
16
|
"currency"=>"USD",
|
17
17
|
"description"=>"Some descriptive text for the debit in the dashboard",
|
18
18
|
"failure_reason"=>nil,
|
19
19
|
"failure_reason_code"=>nil,
|
20
|
-
"href"=>"/debits/
|
21
|
-
"id"=>"
|
20
|
+
"href"=>"/debits/WD7AAkAyeN6YTeHJTn1ThPYA",
|
21
|
+
"id"=>"WD7AAkAyeN6YTeHJTn1ThPYA",
|
22
22
|
"links"=>
|
23
|
-
{"
|
23
|
+
{"card_hold"=>"HL7Az4UI0XU8rHAqmNY0Snp6",
|
24
|
+
"customer"=>nil,
|
24
25
|
"dispute"=>nil,
|
25
26
|
"order"=>nil,
|
26
|
-
"source"=>"
|
27
|
+
"source"=>"CC73IyzxPUu2z89NH8GrJhLn"},
|
27
28
|
"meta"=>{},
|
28
29
|
"status"=>"succeeded",
|
29
|
-
"transaction_number"=>"
|
30
|
-
"updated_at"=>"2014-
|
30
|
+
"transaction_number"=>"WDQN-HJW-1YIP",
|
31
|
+
"updated_at"=>"2014-12-17T21:25:25.027834Z"},
|
31
32
|
@hyperlinks=
|
32
|
-
{"
|
33
|
-
#<Proc:
|
33
|
+
{"card_hold"=>
|
34
|
+
#<Proc:0x007fcde1311238/lib/balanced/resources/resource.rb:56 (lambda)>,
|
35
|
+
"customer"=>
|
36
|
+
#<Proc:0x007fcde13108b0/lib/balanced/utils.rb:6 (lambda)>,
|
34
37
|
"dispute"=>
|
35
|
-
#<Proc:
|
38
|
+
#<Proc:0x007fcde1323f50/lib/balanced/utils.rb:6 (lambda)>,
|
36
39
|
"events"=>
|
37
|
-
#<Proc:
|
40
|
+
#<Proc:0x007fcde1322100/lib/balanced/utils.rb:6 (lambda)>,
|
38
41
|
"order"=>
|
39
|
-
#<Proc:
|
42
|
+
#<Proc:0x007fcde13216d8/lib/balanced/utils.rb:6 (lambda)>,
|
40
43
|
"refunds"=>
|
41
|
-
#<Proc:
|
44
|
+
#<Proc:0x007fcde1333810/lib/balanced/utils.rb:6 (lambda)>,
|
42
45
|
"source"=>
|
43
|
-
#<Proc:
|
46
|
+
#<Proc:0x007fcde1331e98/lib/balanced/resources/resource.rb:56 (lambda)>}>
|
44
47
|
|
45
48
|
% endif
|
@@ -3,9 +3,9 @@ Balanced::Debit.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
|
-
debit = Balanced::Debit.fetch('/debits/
|
8
|
+
debit = Balanced::Debit.fetch('/debits/WD7AAkAyeN6YTeHJTn1ThPYA')
|
9
9
|
debit.description = 'New description for debit'
|
10
10
|
debit.meta = {
|
11
11
|
'anykey' => 'valuegoeshere',
|
@@ -14,38 +14,41 @@ debit.meta = {
|
|
14
14
|
debit.save
|
15
15
|
|
16
16
|
% elif mode == 'response':
|
17
|
-
#<Balanced::Debit:
|
17
|
+
#<Balanced::Debit:0x007fcde1362728
|
18
18
|
@attributes=
|
19
19
|
{"amount"=>5000,
|
20
20
|
"appears_on_statement_as"=>"BAL*Statement text",
|
21
|
-
"created_at"=>"2014-
|
21
|
+
"created_at"=>"2014-12-17T21:25:24.286272Z",
|
22
22
|
"currency"=>"USD",
|
23
23
|
"description"=>"New description for debit",
|
24
24
|
"failure_reason"=>nil,
|
25
25
|
"failure_reason_code"=>nil,
|
26
|
-
"href"=>"/debits/
|
27
|
-
"id"=>"
|
26
|
+
"href"=>"/debits/WD7AAkAyeN6YTeHJTn1ThPYA",
|
27
|
+
"id"=>"WD7AAkAyeN6YTeHJTn1ThPYA",
|
28
28
|
"links"=>
|
29
|
-
{"
|
29
|
+
{"card_hold"=>"HL7Az4UI0XU8rHAqmNY0Snp6",
|
30
|
+
"customer"=>nil,
|
30
31
|
"dispute"=>nil,
|
31
32
|
"order"=>nil,
|
32
|
-
"source"=>"
|
33
|
+
"source"=>"CC73IyzxPUu2z89NH8GrJhLn"},
|
33
34
|
"meta"=>{"anykey"=>"valuegoeshere", "facebook.id"=>"1234567890"},
|
34
35
|
"status"=>"succeeded",
|
35
|
-
"transaction_number"=>"
|
36
|
-
"updated_at"=>"2014-
|
36
|
+
"transaction_number"=>"WDQN-HJW-1YIP",
|
37
|
+
"updated_at"=>"2014-12-17T21:25:28.573676Z"},
|
37
38
|
@hyperlinks=
|
38
|
-
{"
|
39
|
-
#<Proc:
|
39
|
+
{"card_hold"=>
|
40
|
+
#<Proc:0x007fcde1360bf8/lib/balanced/resources/resource.rb:56 (lambda)>,
|
41
|
+
"customer"=>
|
42
|
+
#<Proc:0x007fcde1360270/lib/balanced/utils.rb:6 (lambda)>,
|
40
43
|
"dispute"=>
|
41
|
-
#<Proc:
|
44
|
+
#<Proc:0x007fcde136b8a0/lib/balanced/utils.rb:6 (lambda)>,
|
42
45
|
"events"=>
|
43
|
-
#<Proc:
|
46
|
+
#<Proc:0x007fcde1369a50/lib/balanced/utils.rb:6 (lambda)>,
|
44
47
|
"order"=>
|
45
|
-
#<Proc:
|
48
|
+
#<Proc:0x007fcde1369078/lib/balanced/utils.rb:6 (lambda)>,
|
46
49
|
"refunds"=>
|
47
|
-
#<Proc:
|
50
|
+
#<Proc:0x007fcde137b1d8/lib/balanced/utils.rb:6 (lambda)>,
|
48
51
|
"source"=>
|
49
|
-
#<Proc:
|
52
|
+
#<Proc:0x007fcde1379860/lib/balanced/resources/resource.rb:56 (lambda)>}>
|
50
53
|
|
51
54
|
% endif
|
@@ -2,28 +2,28 @@
|
|
2
2
|
Balanced::Dispute.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
|
disputes = Balanced::Dispute.all
|
8
8
|
% elif mode == 'response':
|
9
|
-
[#<Balanced::Dispute:
|
9
|
+
[#<Balanced::Dispute:0x007fcde190c9f8
|
10
10
|
@attributes=
|
11
11
|
{"amount"=>5000,
|
12
|
-
"created_at"=>"2014-
|
12
|
+
"created_at"=>"2014-12-17T21:25:45.321785Z",
|
13
13
|
"currency"=>"USD",
|
14
|
-
"href"=>"/disputes/
|
15
|
-
"id"=>"
|
16
|
-
"initiated_at"=>"2014-
|
17
|
-
"links"=>{"transaction"=>"
|
14
|
+
"href"=>"/disputes/DTbbQLxrNf790FmaKsgqRPa",
|
15
|
+
"id"=>"DTbbQLxrNf790FmaKsgqRPa",
|
16
|
+
"initiated_at"=>"2014-12-17T21:23:52.616968Z",
|
17
|
+
"links"=>{"transaction"=>"WD7M75BRYlRsQTImIHFf8O9W"},
|
18
18
|
"meta"=>{},
|
19
19
|
"reason"=>"fraud",
|
20
|
-
"respond_by"=>"
|
20
|
+
"respond_by"=>"2015-01-16T21:23:52.616970Z",
|
21
21
|
"status"=>"pending",
|
22
|
-
"updated_at"=>"2014-
|
22
|
+
"updated_at"=>"2014-12-17T21:25:45.321787Z"},
|
23
23
|
@hyperlinks=
|
24
24
|
{"events"=>
|
25
|
-
#<Proc:
|
25
|
+
#<Proc:0x007fcde1916a48/lib/balanced/utils.rb:6 (lambda)>,
|
26
26
|
"transaction"=>
|
27
|
-
#<Proc:
|
27
|
+
#<Proc:0x007fcde19150a8/lib/balanced/resources/resource.rb:56 (lambda)>}>]
|
28
28
|
|
29
29
|
% endif
|
@@ -3,29 +3,29 @@ Balanced::Dispute.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
|
-
dispute = Balanced::Dispute.fetch('/disputes/
|
8
|
+
dispute = Balanced::Dispute.fetch('/disputes/DTbbQLxrNf790FmaKsgqRPa')
|
9
9
|
|
10
10
|
% elif mode == 'response':
|
11
|
-
#<Balanced::Dispute:
|
11
|
+
#<Balanced::Dispute:0x007fcde196f148
|
12
12
|
@attributes=
|
13
13
|
{"amount"=>5000,
|
14
|
-
"created_at"=>"2014-
|
14
|
+
"created_at"=>"2014-12-17T21:25:45.321785Z",
|
15
15
|
"currency"=>"USD",
|
16
|
-
"href"=>"/disputes/
|
17
|
-
"id"=>"
|
18
|
-
"initiated_at"=>"2014-
|
19
|
-
"links"=>{"transaction"=>"
|
16
|
+
"href"=>"/disputes/DTbbQLxrNf790FmaKsgqRPa",
|
17
|
+
"id"=>"DTbbQLxrNf790FmaKsgqRPa",
|
18
|
+
"initiated_at"=>"2014-12-17T21:23:52.616968Z",
|
19
|
+
"links"=>{"transaction"=>"WD7M75BRYlRsQTImIHFf8O9W"},
|
20
20
|
"meta"=>{},
|
21
21
|
"reason"=>"fraud",
|
22
|
-
"respond_by"=>"
|
22
|
+
"respond_by"=>"2015-01-16T21:23:52.616970Z",
|
23
23
|
"status"=>"pending",
|
24
|
-
"updated_at"=>"2014-
|
24
|
+
"updated_at"=>"2014-12-17T21:25:45.321787Z"},
|
25
25
|
@hyperlinks=
|
26
26
|
{"events"=>
|
27
|
-
#<Proc:
|
27
|
+
#<Proc:0x007fcde196d1e0/lib/balanced/utils.rb:6 (lambda)>,
|
28
28
|
"transaction"=>
|
29
|
-
#<Proc:
|
29
|
+
#<Proc:0x007fcde196ed88/lib/balanced/resources/resource.rb:56 (lambda)>}>
|
30
30
|
|
31
31
|
% endif
|
@@ -3,105 +3,79 @@ Balanced::Event.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
|
events = Balanced::Event.all
|
9
9
|
% elif mode == 'response':
|
10
|
-
[#<Balanced::Event:
|
10
|
+
[#<Balanced::Event:0x007fcde12d3230
|
11
11
|
@attributes=
|
12
12
|
{"callback_statuses"=>
|
13
|
-
{"failed"=>0, "pending"=>
|
13
|
+
{"failed"=>0, "pending"=>1, "retrying"=>0, "succeeded"=>0},
|
14
14
|
"entity"=>
|
15
|
-
{"
|
16
|
-
[{"
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
"
|
24
|
-
"
|
25
|
-
"
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
"links"=>{"destination"=>nil, "source"=>nil},
|
32
|
-
"merchant_status"=>"underwritten",
|
15
|
+
{"debits"=>
|
16
|
+
[{"amount"=>5000,
|
17
|
+
"appears_on_statement_as"=>"BAL*Statement text",
|
18
|
+
"created_at"=>"2014-12-17T21:25:34.550152Z",
|
19
|
+
"currency"=>"USD",
|
20
|
+
"description"=>"Some descriptive text for the debit in the dashboard",
|
21
|
+
"failure_reason"=>nil,
|
22
|
+
"failure_reason_code"=>nil,
|
23
|
+
"href"=>"/debits/WD7M75BRYlRsQTImIHFf8O9W",
|
24
|
+
"id"=>"WD7M75BRYlRsQTImIHFf8O9W",
|
25
|
+
"links"=>
|
26
|
+
{"card_hold"=>"HL7M4ZNQjlJRZhhMJGPBVCUM",
|
27
|
+
"customer"=>nil,
|
28
|
+
"dispute"=>"DTbbQLxrNf790FmaKsgqRPa",
|
29
|
+
"order"=>nil,
|
30
|
+
"source"=>"CC7Lwi6mzKkqwXrIg5UY1BE9"},
|
33
31
|
"meta"=>{},
|
34
|
-
"
|
35
|
-
"
|
36
|
-
"
|
37
|
-
"updated_at"=>"2014-05-15T00:38:03.766910Z"}],
|
32
|
+
"status"=>"succeeded",
|
33
|
+
"transaction_number"=>"WMWY-ZDJ-0RIZ",
|
34
|
+
"updated_at"=>"2014-12-17T21:25:35.221519Z"}],
|
38
35
|
"links"=>
|
39
|
-
{"
|
40
|
-
"
|
41
|
-
"
|
42
|
-
"
|
43
|
-
"
|
44
|
-
"
|
45
|
-
"
|
46
|
-
|
47
|
-
|
48
|
-
"customers.orders"=>"/customers/{customers.id}/orders",
|
49
|
-
"customers.refunds"=>"/customers/{customers.id}/refunds",
|
50
|
-
"customers.reversals"=>"/customers/{customers.id}/reversals",
|
51
|
-
"customers.source"=>"/resources/{customers.source}",
|
52
|
-
"customers.transactions"=>"/customers/{customers.id}/transactions"}},
|
53
|
-
"href"=>"/events/EV2cc035eedbc911e38d4f061e5f402045",
|
54
|
-
"id"=>"EV2cc035eedbc911e38d4f061e5f402045",
|
36
|
+
{"debits.card_hold"=>"/holds/{debits.card_hold}",
|
37
|
+
"debits.customer"=>"/customers/{debits.customer}",
|
38
|
+
"debits.dispute"=>"/disputes/{debits.dispute}",
|
39
|
+
"debits.events"=>"/debits/{debits.id}/events",
|
40
|
+
"debits.order"=>"/orders/{debits.order}",
|
41
|
+
"debits.refunds"=>"/debits/{debits.id}/refunds",
|
42
|
+
"debits.source"=>"/resources/{debits.source}"}},
|
43
|
+
"href"=>"/events/EV061a4b86863311e4ab84020fe4ae3568",
|
44
|
+
"id"=>"EV061a4b86863311e4ab84020fe4ae3568",
|
55
45
|
"links"=>{},
|
56
|
-
"occurred_at"=>"2014-
|
57
|
-
"type"=>"
|
46
|
+
"occurred_at"=>"2014-12-17T21:25:35.221519Z",
|
47
|
+
"type"=>"debit.succeeded"},
|
58
48
|
@hyperlinks=
|
59
49
|
{"callbacks"=>
|
60
|
-
#<Proc:
|
61
|
-
#<Balanced::Event:
|
50
|
+
#<Proc:0x007fcde12d1ed0/lib/balanced/utils.rb:6 (lambda)>}>,
|
51
|
+
#<Balanced::Event:0x007fcde12d1e80
|
62
52
|
@attributes=
|
63
53
|
{"callback_statuses"=>
|
64
|
-
{"failed"=>0, "pending"=>
|
54
|
+
{"failed"=>0, "pending"=>1, "retrying"=>0, "succeeded"=>0},
|
65
55
|
"entity"=>
|
66
|
-
{"
|
67
|
-
[{"
|
68
|
-
"
|
69
|
-
"
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
"postal_code"=>nil,
|
75
|
-
"state"=>nil},
|
76
|
-
"bank_name"=>"WELLS FARGO BANK NA",
|
77
|
-
"can_credit"=>true,
|
78
|
-
"can_debit"=>true,
|
79
|
-
"created_at"=>"2014-05-15T00:38:04.313775Z",
|
80
|
-
"fingerprint"=>"6ybvaLUrJy07phK2EQ7pVk",
|
81
|
-
"href"=>"/bank_accounts/BA1mL1iIV0OiaTD4IHw51jkp",
|
82
|
-
"id"=>"BA1mL1iIV0OiaTD4IHw51jkp",
|
83
|
-
"links"=>
|
84
|
-
{"bank_account_verification"=>nil,
|
85
|
-
"customer"=>"CU1mlBGw9Cybp1cbj3Lltvcp"},
|
56
|
+
{"disputes"=>
|
57
|
+
[{"amount"=>5000,
|
58
|
+
"created_at"=>"2014-12-17T21:25:45.321785Z",
|
59
|
+
"currency"=>"USD",
|
60
|
+
"href"=>"/disputes/DTbbQLxrNf790FmaKsgqRPa",
|
61
|
+
"id"=>"DTbbQLxrNf790FmaKsgqRPa",
|
62
|
+
"initiated_at"=>"2014-12-17T21:23:52.616968Z",
|
63
|
+
"links"=>{"transaction"=>"WD7M75BRYlRsQTImIHFf8O9W"},
|
86
64
|
"meta"=>{},
|
87
|
-
"
|
88
|
-
"
|
89
|
-
"
|
65
|
+
"reason"=>"fraud",
|
66
|
+
"respond_by"=>"2015-01-16T21:23:52.616970Z",
|
67
|
+
"status"=>"pending",
|
68
|
+
"updated_at"=>"2014-12-17T21:25:45.321787Z"}],
|
90
69
|
"links"=>
|
91
|
-
{"
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
"bank_accounts.credits"=>"/bank_accounts/{bank_accounts.id}/credits",
|
96
|
-
"bank_accounts.customer"=>"/customers/{bank_accounts.customer}",
|
97
|
-
"bank_accounts.debits"=>"/bank_accounts/{bank_accounts.id}/debits"}},
|
98
|
-
"href"=>"/events/EV2d2b4e42dbc911e38d4f061e5f402045",
|
99
|
-
"id"=>"EV2d2b4e42dbc911e38d4f061e5f402045",
|
70
|
+
{"disputes.events"=>"/disputes/{disputes.id}/events",
|
71
|
+
"disputes.transaction"=>"/resources/{disputes.transaction}"}},
|
72
|
+
"href"=>"/events/EV05ef6aec863311e4a61d020fe4ae3568",
|
73
|
+
"id"=>"EV05ef6aec863311e4a61d020fe4ae3568",
|
100
74
|
"links"=>{},
|
101
|
-
"occurred_at"=>"2014-
|
102
|
-
"type"=>"
|
75
|
+
"occurred_at"=>"2014-12-17T21:25:45.321787Z",
|
76
|
+
"type"=>"dispute.created"},
|
103
77
|
@hyperlinks=
|
104
78
|
{"callbacks"=>
|
105
|
-
#<Proc:
|
79
|
+
#<Proc:0x007fcde12d0bc0/lib/balanced/utils.rb:6 (lambda)>}>]
|
106
80
|
|
107
81
|
% endif
|
@@ -3,61 +3,51 @@ Balanced::Event.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
|
-
event = Balanced::Event.fetch('/events/
|
8
|
+
event = Balanced::Event.fetch('/events/EV061a4b86863311e4ab84020fe4ae3568')
|
9
9
|
|
10
10
|
% elif mode == 'response':
|
11
|
-
#<Balanced::Event:
|
11
|
+
#<Balanced::Event:0x007fcde135ac30
|
12
12
|
@attributes=
|
13
13
|
{"callback_statuses"=>
|
14
|
-
{"failed"=>0, "pending"=>
|
14
|
+
{"failed"=>0, "pending"=>1, "retrying"=>0, "succeeded"=>0},
|
15
15
|
"entity"=>
|
16
|
-
{"
|
17
|
-
[{"
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
"
|
25
|
-
"
|
26
|
-
"
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
"links"=>{"destination"=>nil, "source"=>nil},
|
33
|
-
"merchant_status"=>"underwritten",
|
16
|
+
{"debits"=>
|
17
|
+
[{"amount"=>5000,
|
18
|
+
"appears_on_statement_as"=>"BAL*Statement text",
|
19
|
+
"created_at"=>"2014-12-17T21:25:34.550152Z",
|
20
|
+
"currency"=>"USD",
|
21
|
+
"description"=>"Some descriptive text for the debit in the dashboard",
|
22
|
+
"failure_reason"=>nil,
|
23
|
+
"failure_reason_code"=>nil,
|
24
|
+
"href"=>"/debits/WD7M75BRYlRsQTImIHFf8O9W",
|
25
|
+
"id"=>"WD7M75BRYlRsQTImIHFf8O9W",
|
26
|
+
"links"=>
|
27
|
+
{"card_hold"=>"HL7M4ZNQjlJRZhhMJGPBVCUM",
|
28
|
+
"customer"=>nil,
|
29
|
+
"dispute"=>"DTbbQLxrNf790FmaKsgqRPa",
|
30
|
+
"order"=>nil,
|
31
|
+
"source"=>"CC7Lwi6mzKkqwXrIg5UY1BE9"},
|
34
32
|
"meta"=>{},
|
35
|
-
"
|
36
|
-
"
|
37
|
-
"
|
38
|
-
"updated_at"=>"2014-05-15T00:38:03.766910Z"}],
|
33
|
+
"status"=>"succeeded",
|
34
|
+
"transaction_number"=>"WMWY-ZDJ-0RIZ",
|
35
|
+
"updated_at"=>"2014-12-17T21:25:35.221519Z"}],
|
39
36
|
"links"=>
|
40
|
-
{"
|
41
|
-
"
|
42
|
-
"
|
43
|
-
"
|
44
|
-
"
|
45
|
-
"
|
46
|
-
"
|
47
|
-
|
48
|
-
|
49
|
-
"customers.orders"=>"/customers/{customers.id}/orders",
|
50
|
-
"customers.refunds"=>"/customers/{customers.id}/refunds",
|
51
|
-
"customers.reversals"=>"/customers/{customers.id}/reversals",
|
52
|
-
"customers.source"=>"/resources/{customers.source}",
|
53
|
-
"customers.transactions"=>"/customers/{customers.id}/transactions"}},
|
54
|
-
"href"=>"/events/EV2cc035eedbc911e38d4f061e5f402045",
|
55
|
-
"id"=>"EV2cc035eedbc911e38d4f061e5f402045",
|
37
|
+
{"debits.card_hold"=>"/holds/{debits.card_hold}",
|
38
|
+
"debits.customer"=>"/customers/{debits.customer}",
|
39
|
+
"debits.dispute"=>"/disputes/{debits.dispute}",
|
40
|
+
"debits.events"=>"/debits/{debits.id}/events",
|
41
|
+
"debits.order"=>"/orders/{debits.order}",
|
42
|
+
"debits.refunds"=>"/debits/{debits.id}/refunds",
|
43
|
+
"debits.source"=>"/resources/{debits.source}"}},
|
44
|
+
"href"=>"/events/EV061a4b86863311e4ab84020fe4ae3568",
|
45
|
+
"id"=>"EV061a4b86863311e4ab84020fe4ae3568",
|
56
46
|
"links"=>{},
|
57
|
-
"occurred_at"=>"2014-
|
58
|
-
"type"=>"
|
47
|
+
"occurred_at"=>"2014-12-17T21:25:35.221519Z",
|
48
|
+
"type"=>"debit.succeeded"},
|
59
49
|
@hyperlinks=
|
60
50
|
{"callbacks"=>
|
61
|
-
#<Proc:
|
51
|
+
#<Proc:0x007fcde1359948/lib/balanced/utils.rb:6 (lambda)>}>
|
62
52
|
|
63
53
|
% endif
|