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
@@ -3,11 +3,11 @@ Balanced::Card.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
|
-
card = Balanced::Card.fetch('/cards/
|
8
|
+
card = Balanced::Card.fetch('/cards/CC73IyzxPUu2z89NH8GrJhLn')
|
9
9
|
% elif mode == 'response':
|
10
|
-
#<Balanced::Card:
|
10
|
+
#<Balanced::Card:0x007fcde1937900
|
11
11
|
@attributes=
|
12
12
|
{"address"=>
|
13
13
|
{"city"=>nil,
|
@@ -19,12 +19,12 @@ card = Balanced::Card.fetch('/cards/CC4gG6BE70pMOYKPBive9qoF')
|
|
19
19
|
"avs_postal_match"=>nil,
|
20
20
|
"avs_result"=>nil,
|
21
21
|
"avs_street_match"=>nil,
|
22
|
-
"
|
22
|
+
"bank_name"=>"BANK OF HAWAII",
|
23
23
|
"brand"=>"MasterCard",
|
24
24
|
"can_credit"=>false,
|
25
25
|
"can_debit"=>true,
|
26
|
-
"category"=>
|
27
|
-
"created_at"=>"2014-
|
26
|
+
"category"=>"other",
|
27
|
+
"created_at"=>"2014-12-17T21:24:55.056930Z",
|
28
28
|
"cvv"=>"xxx",
|
29
29
|
"cvv_match"=>"yes",
|
30
30
|
"cvv_result"=>"Match",
|
@@ -32,25 +32,23 @@ card = Balanced::Card.fetch('/cards/CC4gG6BE70pMOYKPBive9qoF')
|
|
32
32
|
"expiration_year"=>2020,
|
33
33
|
"fingerprint"=>
|
34
34
|
"fc4ccd5de54f42a5e75f76fbfde60948440c7a382ee7d21b2bc509ab9cfed788",
|
35
|
-
"href"=>"/cards/
|
36
|
-
"id"=>"
|
35
|
+
"href"=>"/cards/CC73IyzxPUu2z89NH8GrJhLn",
|
36
|
+
"id"=>"CC73IyzxPUu2z89NH8GrJhLn",
|
37
37
|
"is_verified"=>true,
|
38
38
|
"links"=>{"customer"=>nil},
|
39
39
|
"meta"=>{},
|
40
40
|
"name"=>nil,
|
41
41
|
"number"=>"xxxxxxxxxxxx5100",
|
42
|
-
"type"=>"",
|
43
|
-
"updated_at"=>"2014-
|
42
|
+
"type"=>"credit",
|
43
|
+
"updated_at"=>"2014-12-17T21:24:55.056933Z"},
|
44
44
|
@hyperlinks=
|
45
45
|
{"card_holds"=>
|
46
|
-
#<Proc:
|
47
|
-
"credits"=>
|
48
|
-
#<Proc:0x007fa7d32e8628/lib/balanced/utils.rb:6 (lambda)>,
|
46
|
+
#<Proc:0x007fcde19356f0/lib/balanced/utils.rb:6 (lambda)>,
|
49
47
|
"customer"=>
|
50
|
-
#<Proc:
|
48
|
+
#<Proc:0x007fcde1934d40/lib/balanced/utils.rb:6 (lambda)>,
|
51
49
|
"debits"=>
|
52
|
-
#<Proc:
|
50
|
+
#<Proc:0x007fcde192d338/lib/balanced/utils.rb:6 (lambda)>,
|
53
51
|
"disputes"=>
|
54
|
-
#<Proc:
|
52
|
+
#<Proc:0x007fcde191ea90/lib/balanced/utils.rb:6 (lambda)>}>
|
55
53
|
|
56
54
|
% endif
|
@@ -3,9 +3,9 @@ Balanced::Card.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
|
-
card = Balanced::Card.fetch('/cards/
|
8
|
+
card = Balanced::Card.fetch('/cards/CC73IyzxPUu2z89NH8GrJhLn')
|
9
9
|
card.meta = {
|
10
10
|
'facebook.user_id' => '0192837465',
|
11
11
|
'my-own-customer-id' => '12345',
|
@@ -14,7 +14,7 @@ card.meta = {
|
|
14
14
|
card.save
|
15
15
|
|
16
16
|
% elif mode == 'response':
|
17
|
-
#<Balanced::Card:
|
17
|
+
#<Balanced::Card:0x007fcde09e3328
|
18
18
|
@attributes=
|
19
19
|
{"address"=>
|
20
20
|
{"city"=>nil,
|
@@ -26,12 +26,12 @@ card.save
|
|
26
26
|
"avs_postal_match"=>nil,
|
27
27
|
"avs_result"=>nil,
|
28
28
|
"avs_street_match"=>nil,
|
29
|
-
"
|
29
|
+
"bank_name"=>"BANK OF HAWAII",
|
30
30
|
"brand"=>"MasterCard",
|
31
31
|
"can_credit"=>false,
|
32
32
|
"can_debit"=>true,
|
33
|
-
"category"=>
|
34
|
-
"created_at"=>"2014-
|
33
|
+
"category"=>"other",
|
34
|
+
"created_at"=>"2014-12-17T21:24:55.056930Z",
|
35
35
|
"cvv"=>"xxx",
|
36
36
|
"cvv_match"=>"yes",
|
37
37
|
"cvv_result"=>"Match",
|
@@ -39,8 +39,8 @@ card.save
|
|
39
39
|
"expiration_year"=>2020,
|
40
40
|
"fingerprint"=>
|
41
41
|
"fc4ccd5de54f42a5e75f76fbfde60948440c7a382ee7d21b2bc509ab9cfed788",
|
42
|
-
"href"=>"/cards/
|
43
|
-
"id"=>"
|
42
|
+
"href"=>"/cards/CC73IyzxPUu2z89NH8GrJhLn",
|
43
|
+
"id"=>"CC73IyzxPUu2z89NH8GrJhLn",
|
44
44
|
"is_verified"=>true,
|
45
45
|
"links"=>{"customer"=>nil},
|
46
46
|
"meta"=>
|
@@ -49,18 +49,16 @@ card.save
|
|
49
49
|
"twitter.id"=>"1234987650"},
|
50
50
|
"name"=>nil,
|
51
51
|
"number"=>"xxxxxxxxxxxx5100",
|
52
|
-
"type"=>"",
|
53
|
-
"updated_at"=>"2014-
|
52
|
+
"type"=>"credit",
|
53
|
+
"updated_at"=>"2014-12-17T21:24:59.521759Z"},
|
54
54
|
@hyperlinks=
|
55
55
|
{"card_holds"=>
|
56
|
-
#<Proc:
|
57
|
-
"credits"=>
|
58
|
-
#<Proc:0x007fa7d420da90/lib/balanced/utils.rb:6 (lambda)>,
|
56
|
+
#<Proc:0x007fcde09e1258/lib/balanced/utils.rb:6 (lambda)>,
|
59
57
|
"customer"=>
|
60
|
-
#<Proc:
|
58
|
+
#<Proc:0x007fcde09e08a8/lib/balanced/utils.rb:6 (lambda)>,
|
61
59
|
"debits"=>
|
62
|
-
#<Proc:
|
60
|
+
#<Proc:0x007fcde09b29d0/lib/balanced/utils.rb:6 (lambda)>,
|
63
61
|
"disputes"=>
|
64
|
-
#<Proc:
|
62
|
+
#<Proc:0x007fcde09b0b58/lib/balanced/utils.rb:6 (lambda)>}>
|
65
63
|
|
66
64
|
% endif
|
@@ -3,39 +3,69 @@ Balanced::Credit.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
|
credits = Balanced::Credit.all
|
9
9
|
% elif mode == 'response':
|
10
|
-
[#<Balanced::Credit:
|
10
|
+
[#<Balanced::Credit:0x007fcde19248f0
|
11
11
|
@attributes=
|
12
12
|
{"amount"=>5000,
|
13
13
|
"appears_on_statement_as"=>"example.com",
|
14
|
-
"created_at"=>"2014-
|
14
|
+
"created_at"=>"2014-12-17T21:25:09.678154Z",
|
15
15
|
"currency"=>"USD",
|
16
16
|
"description"=>nil,
|
17
17
|
"failure_reason"=>nil,
|
18
18
|
"failure_reason_code"=>nil,
|
19
|
-
"href"=>"/credits/
|
20
|
-
"id"=>"
|
19
|
+
"href"=>"/credits/CR7k9iyKSImqoPcvZyPNAcbm",
|
20
|
+
"id"=>"CR7k9iyKSImqoPcvZyPNAcbm",
|
21
21
|
"links"=>
|
22
|
-
{"customer"=>"
|
23
|
-
"destination"=>"
|
22
|
+
{"customer"=>"CU68iUpvvUwpRpuuBL3u9Slq",
|
23
|
+
"destination"=>"BA6FZjm2W2mK0DIQibA1sjHv",
|
24
24
|
"order"=>nil},
|
25
25
|
"meta"=>{},
|
26
|
+
"status"=>"pending",
|
27
|
+
"transaction_number"=>"CRRWI-1PN-WA3D",
|
28
|
+
"updated_at"=>"2014-12-17T21:25:10.040086Z"},
|
29
|
+
@hyperlinks=
|
30
|
+
{"customer"=>
|
31
|
+
#<Proc:0x007fcde18eee30/lib/balanced/resources/resource.rb:56 (lambda)>,
|
32
|
+
"destination"=>
|
33
|
+
#<Proc:0x007fcde18ed468/lib/balanced/resources/resource.rb:56 (lambda)>,
|
34
|
+
"events"=>
|
35
|
+
#<Proc:0x007fcde3af35a8/lib/balanced/utils.rb:6 (lambda)>,
|
36
|
+
"order"=>
|
37
|
+
#<Proc:0x007fcde3af2b80/lib/balanced/utils.rb:6 (lambda)>,
|
38
|
+
"reversals"=>
|
39
|
+
#<Proc:0x007fcde3af0d30/lib/balanced/utils.rb:6 (lambda)>}>,
|
40
|
+
#<Balanced::Credit:0x007fcde3af0ce0
|
41
|
+
@attributes=
|
42
|
+
{"amount"=>5000,
|
43
|
+
"appears_on_statement_as"=>"example.com",
|
44
|
+
"created_at"=>"2014-12-17T21:25:06.303877Z",
|
45
|
+
"currency"=>"USD",
|
46
|
+
"description"=>"Order #12341234",
|
47
|
+
"failure_reason"=>nil,
|
48
|
+
"failure_reason_code"=>nil,
|
49
|
+
"href"=>"/credits/CR7gmj42wn3NG2br01RjK1k9",
|
50
|
+
"id"=>"CR7gmj42wn3NG2br01RjK1k9",
|
51
|
+
"links"=>
|
52
|
+
{"customer"=>"CU68iUpvvUwpRpuuBL3u9Slq",
|
53
|
+
"destination"=>"CC7bBGoeKPe5DBKWgduZd5Cl",
|
54
|
+
"order"=>"OR6c6n11zKSFfjE6kGNKtsE8"},
|
55
|
+
"meta"=>{},
|
26
56
|
"status"=>"succeeded",
|
27
|
-
"transaction_number"=>"
|
28
|
-
"updated_at"=>"2014-
|
57
|
+
"transaction_number"=>"CRPDQ-Y1M-24PV",
|
58
|
+
"updated_at"=>"2014-12-17T21:25:06.683745Z"},
|
29
59
|
@hyperlinks=
|
30
60
|
{"customer"=>
|
31
|
-
#<Proc:
|
61
|
+
#<Proc:0x007fcde13831d0/lib/balanced/resources/resource.rb:56 (lambda)>,
|
32
62
|
"destination"=>
|
33
|
-
#<Proc:
|
63
|
+
#<Proc:0x007fcde13817e0/lib/balanced/resources/resource.rb:56 (lambda)>,
|
34
64
|
"events"=>
|
35
|
-
#<Proc:
|
65
|
+
#<Proc:0x007fcde1373a00/lib/balanced/utils.rb:6 (lambda)>,
|
36
66
|
"order"=>
|
37
|
-
#<Proc:
|
67
|
+
#<Proc:0x007fcde1372060/lib/balanced/resources/resource.rb:56 (lambda)>,
|
38
68
|
"reversals"=>
|
39
|
-
#<Proc:
|
69
|
+
#<Proc:0x007fcde1370170/lib/balanced/utils.rb:6 (lambda)>}>]
|
40
70
|
|
41
71
|
% endif
|
@@ -3,11 +3,11 @@ Balanced::BankAccount.credits
|
|
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
|
credits = bank_account.credits
|
10
10
|
% elif mode == 'response':
|
11
|
-
|
11
|
+
[]
|
12
12
|
|
13
13
|
% endif
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<%= boiler_plate %>
|
2
|
-
order = Balanced::Order.fetch('<%=
|
2
|
+
order = Balanced::Order.fetch('<%= request['order_href'] %>')
|
3
3
|
bank_account = Balanced::BankAccount.fetch('<%= request['bank_account_href'] %>')
|
4
4
|
order.credit_to(
|
5
|
-
:
|
5
|
+
:destination => bank_account,
|
6
6
|
:amount => <%= request['payload']['amount'] %>
|
7
7
|
)
|
@@ -3,24 +3,45 @@ Balanced::Order.credit_to
|
|
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
|
-
order = Balanced::Order.fetch('/orders/
|
9
|
-
bank_account = Balanced::BankAccount.fetch('/bank_accounts/
|
8
|
+
order = Balanced::Order.fetch('/orders/OR6c6n11zKSFfjE6kGNKtsE8')
|
9
|
+
bank_account = Balanced::BankAccount.fetch('/bank_accounts/BA6FZjm2W2mK0DIQibA1sjHv/credits')
|
10
10
|
order.credit_to(
|
11
|
-
:
|
11
|
+
:destination => bank_account,
|
12
12
|
:amount => 5000
|
13
13
|
)
|
14
14
|
% elif mode == 'response':
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
"
|
24
|
-
|
15
|
+
#<Balanced::Credit:0x007fcde122fec8
|
16
|
+
@attributes=
|
17
|
+
{"amount"=>5000,
|
18
|
+
"appears_on_statement_as"=>"example.com",
|
19
|
+
"created_at"=>"2014-12-17T21:25:08.281495Z",
|
20
|
+
"currency"=>"USD",
|
21
|
+
"description"=>"Order #12341234",
|
22
|
+
"failure_reason"=>
|
23
|
+
"Marketplace TEST-MP60wtbv6zZrMK3XxOQ9r4xW has insufficient funds to cover a transfer of 5000.",
|
24
|
+
"failure_reason_code"=>"insufficient-funds",
|
25
|
+
"href"=>"/credits/CR7iAdaI3eSWUiwQ5Z6sozE9",
|
26
|
+
"id"=>"CR7iAdaI3eSWUiwQ5Z6sozE9",
|
27
|
+
"links"=>
|
28
|
+
{"customer"=>"CU68iUpvvUwpRpuuBL3u9Slq",
|
29
|
+
"destination"=>"BA6FZjm2W2mK0DIQibA1sjHv",
|
30
|
+
"order"=>"OR6c6n11zKSFfjE6kGNKtsE8"},
|
31
|
+
"meta"=>{},
|
32
|
+
"status"=>"failed",
|
33
|
+
"transaction_number"=>"CRF9L-4Z2-W9RN",
|
34
|
+
"updated_at"=>"2014-12-17T21:25:08.310906Z"},
|
35
|
+
@hyperlinks=
|
36
|
+
{"customer"=>
|
37
|
+
#<Proc:0x007fcde126bb30/lib/balanced/resources/resource.rb:56 (lambda)>,
|
38
|
+
"destination"=>
|
39
|
+
#<Proc:0x007fcde1269510/lib/balanced/resources/resource.rb:56 (lambda)>,
|
40
|
+
"events"=>
|
41
|
+
#<Proc:0x007fcde1272d40/lib/balanced/utils.rb:6 (lambda)>,
|
42
|
+
"order"=>
|
43
|
+
#<Proc:0x007fcde1271238/lib/balanced/resources/resource.rb:56 (lambda)>,
|
44
|
+
"reversals"=>
|
45
|
+
#<Proc:0x007fcde122ace8/lib/balanced/utils.rb:6 (lambda)>}>
|
25
46
|
|
26
47
|
% endif
|
@@ -3,39 +3,39 @@ Balanced::Credit.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
|
-
credit = Balanced::Credit.fetch('/credits/
|
8
|
+
credit = Balanced::Credit.fetch('/credits/CR7k9iyKSImqoPcvZyPNAcbm')
|
9
9
|
% elif mode == 'response':
|
10
|
-
#<Balanced::Credit:
|
10
|
+
#<Balanced::Credit:0x007fcde12109b0
|
11
11
|
@attributes=
|
12
12
|
{"amount"=>5000,
|
13
13
|
"appears_on_statement_as"=>"example.com",
|
14
|
-
"created_at"=>"2014-
|
14
|
+
"created_at"=>"2014-12-17T21:25:09.678154Z",
|
15
15
|
"currency"=>"USD",
|
16
16
|
"description"=>nil,
|
17
17
|
"failure_reason"=>nil,
|
18
18
|
"failure_reason_code"=>nil,
|
19
|
-
"href"=>"/credits/
|
20
|
-
"id"=>"
|
19
|
+
"href"=>"/credits/CR7k9iyKSImqoPcvZyPNAcbm",
|
20
|
+
"id"=>"CR7k9iyKSImqoPcvZyPNAcbm",
|
21
21
|
"links"=>
|
22
|
-
{"customer"=>"
|
23
|
-
"destination"=>"
|
22
|
+
{"customer"=>"CU68iUpvvUwpRpuuBL3u9Slq",
|
23
|
+
"destination"=>"BA6FZjm2W2mK0DIQibA1sjHv",
|
24
24
|
"order"=>nil},
|
25
25
|
"meta"=>{},
|
26
|
-
"status"=>"
|
27
|
-
"transaction_number"=>"
|
28
|
-
"updated_at"=>"2014-
|
26
|
+
"status"=>"pending",
|
27
|
+
"transaction_number"=>"CRRWI-1PN-WA3D",
|
28
|
+
"updated_at"=>"2014-12-17T21:25:10.040086Z"},
|
29
29
|
@hyperlinks=
|
30
30
|
{"customer"=>
|
31
|
-
#<Proc:
|
31
|
+
#<Proc:0x007fcde120ae20/lib/balanced/resources/resource.rb:56 (lambda)>,
|
32
32
|
"destination"=>
|
33
|
-
#<Proc:
|
33
|
+
#<Proc:0x007fcde1209480/lib/balanced/resources/resource.rb:56 (lambda)>,
|
34
34
|
"events"=>
|
35
|
-
#<Proc:
|
35
|
+
#<Proc:0x007fcde12035a8/lib/balanced/utils.rb:6 (lambda)>,
|
36
36
|
"order"=>
|
37
|
-
#<Proc:
|
37
|
+
#<Proc:0x007fcde1202bd0/lib/balanced/utils.rb:6 (lambda)>,
|
38
38
|
"reversals"=>
|
39
|
-
#<Proc:
|
39
|
+
#<Proc:0x007fcde1200c90/lib/balanced/utils.rb:6 (lambda)>}>
|
40
40
|
|
41
41
|
% endif
|
@@ -3,9 +3,9 @@ Balanced::Credit.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
|
-
credit = Balanced::Credit.fetch('/credits/
|
8
|
+
credit = Balanced::Credit.fetch('/credits/CR7k9iyKSImqoPcvZyPNAcbm')
|
9
9
|
credit.description = 'New description for credit'
|
10
10
|
credit.meta = {
|
11
11
|
'anykey' => 'valuegoeshere',
|
@@ -14,35 +14,35 @@ credit.meta = {
|
|
14
14
|
credit.save
|
15
15
|
|
16
16
|
% elif mode == 'response':
|
17
|
-
#<Balanced::Credit:
|
17
|
+
#<Balanced::Credit:0x007fcde11e9298
|
18
18
|
@attributes=
|
19
19
|
{"amount"=>5000,
|
20
20
|
"appears_on_statement_as"=>"example.com",
|
21
|
-
"created_at"=>"2014-
|
21
|
+
"created_at"=>"2014-12-17T21:25:09.678154Z",
|
22
22
|
"currency"=>"USD",
|
23
23
|
"description"=>"New description for credit",
|
24
24
|
"failure_reason"=>nil,
|
25
25
|
"failure_reason_code"=>nil,
|
26
|
-
"href"=>"/credits/
|
27
|
-
"id"=>"
|
26
|
+
"href"=>"/credits/CR7k9iyKSImqoPcvZyPNAcbm",
|
27
|
+
"id"=>"CR7k9iyKSImqoPcvZyPNAcbm",
|
28
28
|
"links"=>
|
29
|
-
{"customer"=>"
|
30
|
-
"destination"=>"
|
29
|
+
{"customer"=>"CU68iUpvvUwpRpuuBL3u9Slq",
|
30
|
+
"destination"=>"BA6FZjm2W2mK0DIQibA1sjHv",
|
31
31
|
"order"=>nil},
|
32
32
|
"meta"=>{"anykey"=>"valuegoeshere", "facebook.id"=>"1234567890"},
|
33
|
-
"status"=>"
|
34
|
-
"transaction_number"=>"
|
35
|
-
"updated_at"=>"2014-
|
33
|
+
"status"=>"pending",
|
34
|
+
"transaction_number"=>"CRRWI-1PN-WA3D",
|
35
|
+
"updated_at"=>"2014-12-17T21:25:14.629393Z"},
|
36
36
|
@hyperlinks=
|
37
37
|
{"customer"=>
|
38
|
-
#<Proc:
|
38
|
+
#<Proc:0x007fcde11e3780/lib/balanced/resources/resource.rb:56 (lambda)>,
|
39
39
|
"destination"=>
|
40
|
-
#<Proc:
|
40
|
+
#<Proc:0x007fcde11e1db8/lib/balanced/resources/resource.rb:56 (lambda)>,
|
41
41
|
"events"=>
|
42
|
-
#<Proc:
|
42
|
+
#<Proc:0x007fcde125be60/lib/balanced/utils.rb:6 (lambda)>,
|
43
43
|
"order"=>
|
44
|
-
#<Proc:
|
44
|
+
#<Proc:0x007fcde125b410/lib/balanced/utils.rb:6 (lambda)>,
|
45
45
|
"reversals"=>
|
46
|
-
#<Proc:
|
46
|
+
#<Proc:0x007fcde1259598/lib/balanced/utils.rb:6 (lambda)>}>
|
47
47
|
|
48
48
|
% endif
|
@@ -3,7 +3,7 @@ Balanced::Customer.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
|
customer = Balanced::Customer.new(
|
9
9
|
:address => {
|
@@ -16,7 +16,7 @@ customer = Balanced::Customer.new(
|
|
16
16
|
customer.save
|
17
17
|
|
18
18
|
% elif mode == 'response':
|
19
|
-
#<Balanced::Customer:
|
19
|
+
#<Balanced::Customer:0x007fcde18bf590
|
20
20
|
@attributes=
|
21
21
|
{"address"=>
|
22
22
|
{"city"=>nil,
|
@@ -26,46 +26,48 @@ customer.save
|
|
26
26
|
"postal_code"=>"48120",
|
27
27
|
"state"=>nil},
|
28
28
|
"business_name"=>nil,
|
29
|
-
"created_at"=>"2014-
|
29
|
+
"created_at"=>"2014-12-17T21:25:22.336415Z",
|
30
30
|
"dob_month"=>7,
|
31
31
|
"dob_year"=>1963,
|
32
32
|
"ein"=>nil,
|
33
33
|
"email"=>nil,
|
34
|
-
"href"=>"/customers/
|
35
|
-
"id"=>"
|
34
|
+
"href"=>"/customers/CU7yoUz1HuDE7t7p9GcVNYbz",
|
35
|
+
"id"=>"CU7yoUz1HuDE7t7p9GcVNYbz",
|
36
36
|
"links"=>{"destination"=>nil, "source"=>nil},
|
37
37
|
"merchant_status"=>"underwritten",
|
38
38
|
"meta"=>{},
|
39
39
|
"name"=>"Henry Ford",
|
40
40
|
"phone"=>nil,
|
41
41
|
"ssn_last4"=>nil,
|
42
|
-
"updated_at"=>"2014-
|
42
|
+
"updated_at"=>"2014-12-17T21:25:22.548971Z"},
|
43
43
|
@hyperlinks=
|
44
|
-
{"
|
45
|
-
#<Proc:
|
44
|
+
{"accounts"=>
|
45
|
+
#<Proc:0x007fcde18bd470/lib/balanced/utils.rb:6 (lambda)>,
|
46
|
+
"bank_accounts"=>
|
47
|
+
#<Proc:0x007fcde18b7548/lib/balanced/utils.rb:6 (lambda)>,
|
46
48
|
"card_holds"=>
|
47
|
-
#<Proc:
|
49
|
+
#<Proc:0x007fcde18b5608/lib/balanced/utils.rb:6 (lambda)>,
|
48
50
|
"cards"=>
|
49
|
-
#<Proc:
|
51
|
+
#<Proc:0x007fcde18af690/lib/balanced/utils.rb:6 (lambda)>,
|
50
52
|
"credits"=>
|
51
|
-
#<Proc:
|
53
|
+
#<Proc:0x007fcde18ad660/lib/balanced/utils.rb:6 (lambda)>,
|
52
54
|
"debits"=>
|
53
|
-
#<Proc:
|
55
|
+
#<Proc:0x007fcde18a7440/lib/balanced/utils.rb:6 (lambda)>,
|
54
56
|
"destination"=>
|
55
|
-
#<Proc:
|
57
|
+
#<Proc:0x007fcde18a6a40/lib/balanced/utils.rb:6 (lambda)>,
|
56
58
|
"disputes"=>
|
57
|
-
#<Proc:
|
59
|
+
#<Proc:0x007fcde18a4948/lib/balanced/utils.rb:6 (lambda)>,
|
58
60
|
"external_accounts"=>
|
59
|
-
#<Proc:
|
61
|
+
#<Proc:0x007fcde189e318/lib/balanced/utils.rb:6 (lambda)>,
|
60
62
|
"orders"=>
|
61
|
-
#<Proc:
|
63
|
+
#<Proc:0x007fcde189c108/lib/balanced/utils.rb:6 (lambda)>,
|
62
64
|
"refunds"=>
|
63
|
-
#<Proc:
|
65
|
+
#<Proc:0x007fcde1895d80/lib/balanced/utils.rb:6 (lambda)>,
|
64
66
|
"reversals"=>
|
65
|
-
#<Proc:
|
67
|
+
#<Proc:0x007fcde188fde0/lib/balanced/utils.rb:6 (lambda)>,
|
66
68
|
"source"=>
|
67
|
-
#<Proc:
|
69
|
+
#<Proc:0x007fcde188ee68/lib/balanced/utils.rb:6 (lambda)>,
|
68
70
|
"transactions"=>
|
69
|
-
#<Proc:
|
71
|
+
#<Proc:0x007fcde188ce38/lib/balanced/utils.rb:6 (lambda)>}>
|
70
72
|
|
71
73
|
% endif
|