balanced 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile +1 -0
- data/balanced.gemspec +1 -1
- data/lib/balanced/client.rb +1 -2
- data/lib/balanced/error.rb +3 -3
- data/lib/balanced/resources/card.rb +15 -1
- data/lib/balanced/version.rb +1 -1
- 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 +14 -14
- data/scenarios/bank_account_create/ruby.mako +11 -11
- data/scenarios/bank_account_credit/ruby.mako +15 -15
- data/scenarios/bank_account_debit/ruby.mako +15 -15
- data/scenarios/bank_account_delete/ruby.mako +2 -2
- data/scenarios/bank_account_list/ruby.mako +22 -22
- data/scenarios/bank_account_show/ruby.mako +12 -12
- data/scenarios/bank_account_update/ruby.mako +12 -12
- data/scenarios/bank_account_verification_create/definition.rb +1 -1
- data/scenarios/bank_account_verification_create/ruby.mako +10 -10
- data/scenarios/bank_account_verification_show/definition.rb +1 -1
- data/scenarios/bank_account_verification_show/request.rb +1 -1
- data/scenarios/bank_account_verification_show/ruby.mako +10 -10
- data/scenarios/bank_account_verification_update/definition.rb +1 -1
- data/scenarios/bank_account_verification_update/request.rb +1 -1
- data/scenarios/bank_account_verification_update/ruby.mako +10 -10
- 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 +21 -12
- data/scenarios/card_create/ruby.mako +18 -9
- data/scenarios/card_create_creditable/definition.rb +1 -0
- data/scenarios/card_create_creditable/request.rb +4 -0
- data/scenarios/card_create_creditable/ruby.mako +62 -0
- data/scenarios/card_create_dispute/ruby.mako +18 -9
- data/scenarios/card_credit/definition.rb +1 -0
- data/scenarios/card_credit/request.rb +5 -0
- data/scenarios/card_credit/ruby.mako +43 -0
- data/scenarios/card_debit/ruby.mako +16 -16
- data/scenarios/card_debit_dispute/ruby.mako +15 -15
- data/scenarios/card_delete/ruby.mako +2 -2
- data/scenarios/card_hold_capture/ruby.mako +16 -16
- data/scenarios/card_hold_create/ruby.mako +14 -14
- data/scenarios/card_hold_list/ruby.mako +25 -25
- data/scenarios/card_hold_show/ruby.mako +14 -14
- data/scenarios/card_hold_update/ruby.mako +14 -14
- data/scenarios/card_hold_void/ruby.mako +15 -15
- data/scenarios/card_list/ruby.mako +36 -18
- data/scenarios/card_show/ruby.mako +19 -10
- data/scenarios/card_update/ruby.mako +19 -10
- data/scenarios/credit_list/ruby.mako +14 -14
- data/scenarios/credit_list_bank_account/ruby.mako +2 -2
- data/scenarios/credit_order/definition.rb +1 -0
- data/scenarios/credit_order/request.rb +7 -0
- data/scenarios/credit_order/ruby.mako +26 -0
- data/scenarios/credit_show/ruby.mako +15 -15
- data/scenarios/credit_update/ruby.mako +15 -15
- data/scenarios/customer_create/ruby.mako +20 -18
- data/scenarios/customer_delete/ruby.mako +1 -1
- data/scenarios/customer_list/ruby.mako +39 -35
- data/scenarios/customer_show/ruby.mako +21 -19
- data/scenarios/customer_update/ruby.mako +21 -19
- data/scenarios/debit_dispute_show/ruby.mako +12 -12
- data/scenarios/debit_list/ruby.mako +34 -34
- data/scenarios/debit_order/definition.rb +1 -0
- data/scenarios/debit_order/request.rb +7 -0
- data/scenarios/debit_order/ruby.mako +49 -0
- data/scenarios/debit_show/ruby.mako +16 -16
- data/scenarios/debit_update/ruby.mako +16 -16
- data/scenarios/dispute_list/ruby.mako +11 -11
- data/scenarios/dispute_show/ruby.mako +12 -12
- data/scenarios/event_list/ruby.mako +56 -55
- data/scenarios/event_show/ruby.mako +41 -35
- data/scenarios/order_create/ruby.mako +14 -14
- data/scenarios/order_list/ruby.mako +45 -13
- data/scenarios/order_show/ruby.mako +14 -14
- data/scenarios/order_update/ruby.mako +14 -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/render_mako.rb +1 -1
- data/scenarios/reversal_create/ruby.mako +12 -12
- data/scenarios/reversal_list/ruby.mako +11 -11
- data/scenarios/reversal_show/ruby.mako +12 -12
- data/scenarios/reversal_update/ruby.mako +12 -12
- data/spec/balanced/resources/card_spec.rb +73 -11
- data/spec/balanced/resources/credit_spec.rb +155 -26
- data/spec/balanced/response/balanced_exception_middleware_spec.rb +1 -2
- data/spec/spec_helper.rb +3 -1
- metadata +22 -4
@@ -0,0 +1 @@
|
|
1
|
+
Balanced::Card.new
|
@@ -0,0 +1,62 @@
|
|
1
|
+
% if mode == 'definition':
|
2
|
+
Balanced::Card.new
|
3
|
+
|
4
|
+
% elif mode == 'request':
|
5
|
+
require 'balanced'
|
6
|
+
Balanced.configure('ak-test-2jJSjIixy2qkOMmIONPtXnawOUftBDRSK')
|
7
|
+
|
8
|
+
card = Balanced::Card.new(
|
9
|
+
:expiration_month => '05',
|
10
|
+
:expiration_year => '2020',
|
11
|
+
:name => 'Johannes Bach',
|
12
|
+
:number => '4342561111111118'
|
13
|
+
).save
|
14
|
+
|
15
|
+
% elif mode == 'response':
|
16
|
+
#<Balanced::Card:0x007f86fe899ba8
|
17
|
+
@attributes=
|
18
|
+
{"address"=>
|
19
|
+
{"city"=>nil,
|
20
|
+
"country_code"=>nil,
|
21
|
+
"line1"=>nil,
|
22
|
+
"line2"=>nil,
|
23
|
+
"postal_code"=>nil,
|
24
|
+
"state"=>nil},
|
25
|
+
"avs_postal_match"=>nil,
|
26
|
+
"avs_result"=>nil,
|
27
|
+
"avs_street_match"=>nil,
|
28
|
+
"bank_name"=>"WELLS FARGO BANK, N.A.",
|
29
|
+
"brand"=>"Visa",
|
30
|
+
"can_credit"=>true,
|
31
|
+
"can_debit"=>true,
|
32
|
+
"category"=>"other",
|
33
|
+
"created_at"=>"2014-05-19T20:27:07.461892Z",
|
34
|
+
"cvv"=>nil,
|
35
|
+
"cvv_match"=>nil,
|
36
|
+
"cvv_result"=>nil,
|
37
|
+
"expiration_month"=>5,
|
38
|
+
"expiration_year"=>2020,
|
39
|
+
"fingerprint"=>
|
40
|
+
"7dc93d35b59078a1da8e0ebd2cbec65a6ca205760a1be1b90a143d7f2b00e355",
|
41
|
+
"href"=>"/cards/CC7nMc4BAti7DgvWmpGV5e6N",
|
42
|
+
"id"=>"CC7nMc4BAti7DgvWmpGV5e6N",
|
43
|
+
"is_verified"=>true,
|
44
|
+
"links"=>{"customer"=>nil},
|
45
|
+
"meta"=>{},
|
46
|
+
"name"=>"Johannes Bach",
|
47
|
+
"number"=>"xxxxxxxxxxxx1118",
|
48
|
+
"type"=>"debit",
|
49
|
+
"updated_at"=>"2014-05-19T20:27:07.461894Z"},
|
50
|
+
@hyperlinks=
|
51
|
+
{"card_holds"=>
|
52
|
+
#<Proc:0x007f86fe8d3ad8/lib/balanced/utils.rb:6 (lambda)>,
|
53
|
+
"credits"=>
|
54
|
+
#<Proc:0x007f86fe8d1c60/lib/balanced/utils.rb:6 (lambda)>,
|
55
|
+
"customer"=>
|
56
|
+
#<Proc:0x007f86fe8d12b0/lib/balanced/utils.rb:6 (lambda)>,
|
57
|
+
"debits"=>
|
58
|
+
#<Proc:0x007f86fe913408/lib/balanced/utils.rb:6 (lambda)>,
|
59
|
+
"disputes"=>
|
60
|
+
#<Proc:0x007f86fe911590/lib/balanced/utils.rb:6 (lambda)>}>
|
61
|
+
|
62
|
+
% endif
|
@@ -3,7 +3,7 @@ Balanced::Card.new
|
|
3
3
|
|
4
4
|
% elif mode == 'request':
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('ak-test-
|
6
|
+
Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
|
7
7
|
|
8
8
|
card = Balanced::Card.new(
|
9
9
|
:cvv => '123',
|
@@ -13,7 +13,7 @@ card = Balanced::Card.new(
|
|
13
13
|
).save
|
14
14
|
|
15
15
|
% elif mode == 'response':
|
16
|
-
#<Balanced::Card:
|
16
|
+
#<Balanced::Card:0x007fa7d310c160
|
17
17
|
@attributes=
|
18
18
|
{"address"=>
|
19
19
|
{"city"=>nil,
|
@@ -25,8 +25,12 @@ card = Balanced::Card.new(
|
|
25
25
|
"avs_postal_match"=>nil,
|
26
26
|
"avs_result"=>nil,
|
27
27
|
"avs_street_match"=>nil,
|
28
|
+
"bank"=>"BANK OF AMERICA",
|
28
29
|
"brand"=>"Discover",
|
29
|
-
"
|
30
|
+
"can_credit"=>true,
|
31
|
+
"can_debit"=>true,
|
32
|
+
"category"=>"consumer card",
|
33
|
+
"created_at"=>"2014-05-15T00:42:36.010022Z",
|
30
34
|
"cvv"=>"xxx",
|
31
35
|
"cvv_match"=>"yes",
|
32
36
|
"cvv_result"=>"Match",
|
@@ -34,20 +38,25 @@ card = Balanced::Card.new(
|
|
34
38
|
"expiration_year"=>3000,
|
35
39
|
"fingerprint"=>
|
36
40
|
"3c667a62653e187f29b5781eeb0703f26e99558080de0c0f9490b5f9c4ac2871",
|
37
|
-
"href"=>"/cards/
|
38
|
-
"id"=>"
|
41
|
+
"href"=>"/cards/CC6iIaFL1QliTaYG47BArZAh",
|
42
|
+
"id"=>"CC6iIaFL1QliTaYG47BArZAh",
|
39
43
|
"is_verified"=>true,
|
40
44
|
"links"=>{"customer"=>nil},
|
41
45
|
"meta"=>{},
|
42
46
|
"name"=>nil,
|
43
47
|
"number"=>"xxxxxxxxxxxx0002",
|
44
|
-
"
|
48
|
+
"type"=>"debit",
|
49
|
+
"updated_at"=>"2014-05-15T00:42:36.010024Z"},
|
45
50
|
@hyperlinks=
|
46
51
|
{"card_holds"=>
|
47
|
-
#<Proc:
|
52
|
+
#<Proc:0x007fa7d3451e88/lib/balanced/utils.rb:6 (lambda)>,
|
53
|
+
"credits"=>
|
54
|
+
#<Proc:0x007fa7d310bdf0/lib/balanced/utils.rb:6 (lambda)>,
|
48
55
|
"customer"=>
|
49
|
-
#<Proc:
|
56
|
+
#<Proc:0x007fa7d310b3a0/lib/balanced/utils.rb:6 (lambda)>,
|
50
57
|
"debits"=>
|
51
|
-
#<Proc:
|
58
|
+
#<Proc:0x007fa7d3109410/lib/balanced/utils.rb:6 (lambda)>,
|
59
|
+
"disputes"=>
|
60
|
+
#<Proc:0x007fa7d3103510/lib/balanced/utils.rb:6 (lambda)>}>
|
52
61
|
|
53
62
|
% endif
|
@@ -0,0 +1 @@
|
|
1
|
+
Balanced::Card.credit
|
@@ -0,0 +1,43 @@
|
|
1
|
+
% if mode == 'definition':
|
2
|
+
Balanced::Card.credit
|
3
|
+
% elif mode == 'request':
|
4
|
+
require 'balanced'
|
5
|
+
Balanced.configure('ak-test-2jJSjIixy2qkOMmIONPtXnawOUftBDRSK')
|
6
|
+
|
7
|
+
card = Balanced::Card.fetch('/cards/CC7nMc4BAti7DgvWmpGV5e6N')
|
8
|
+
card.credit(
|
9
|
+
:amount => 5000,
|
10
|
+
:description => 'Some descriptive text for the debit in the dashboard'
|
11
|
+
)
|
12
|
+
|
13
|
+
% elif mode == 'response':
|
14
|
+
#<Balanced::Credit:0x007f86fda2eed8
|
15
|
+
@attributes=
|
16
|
+
{"amount"=>5000,
|
17
|
+
"appears_on_statement_as"=>"example.com",
|
18
|
+
"created_at"=>"2014-05-19T20:27:07.904059Z",
|
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"=>"/credits/CR7oh5wk2EfSuMu34r2YzT0l",
|
24
|
+
"id"=>"CR7oh5wk2EfSuMu34r2YzT0l",
|
25
|
+
"links"=>
|
26
|
+
{"customer"=>nil, "destination"=>"CC7nMc4BAti7DgvWmpGV5e6N", "order"=>nil},
|
27
|
+
"meta"=>{},
|
28
|
+
"status"=>"succeeded",
|
29
|
+
"transaction_number"=>"CR018-897-7930",
|
30
|
+
"updated_at"=>"2014-05-19T20:27:08.244392Z"},
|
31
|
+
@hyperlinks=
|
32
|
+
{"customer"=>
|
33
|
+
#<Proc:0x007f86fda2e2f8/lib/balanced/utils.rb:6 (lambda)>,
|
34
|
+
"destination"=>
|
35
|
+
#<Proc:0x007f86fda2c778/lib/balanced/resources/resource.rb:60 (lambda)>,
|
36
|
+
"events"=>
|
37
|
+
#<Proc:0x007f86fda26788/lib/balanced/utils.rb:6 (lambda)>,
|
38
|
+
"order"=>
|
39
|
+
#<Proc:0x007f86fda25d38/lib/balanced/utils.rb:6 (lambda)>,
|
40
|
+
"reversals"=>
|
41
|
+
#<Proc:0x007f86fda1fd98/lib/balanced/utils.rb:6 (lambda)>}>
|
42
|
+
|
43
|
+
% endif
|
@@ -2,9 +2,9 @@
|
|
2
2
|
Balanced::Card.debit
|
3
3
|
% elif mode == 'request':
|
4
4
|
require 'balanced'
|
5
|
-
Balanced.configure('ak-test-
|
5
|
+
Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
|
6
6
|
|
7
|
-
card = Balanced::Card.fetch('/cards/
|
7
|
+
card = Balanced::Card.fetch('/cards/CC4xXVOyMBDdk7FtzG9HwtBv')
|
8
8
|
card.debit(
|
9
9
|
:amount => 5000,
|
10
10
|
:appears_on_statement_as => 'Statement text',
|
@@ -12,38 +12,38 @@ card.debit(
|
|
12
12
|
)
|
13
13
|
|
14
14
|
% elif mode == 'response':
|
15
|
-
#<Balanced::Debit:
|
15
|
+
#<Balanced::Debit:0x007fa7d30da520
|
16
16
|
@attributes=
|
17
17
|
{"amount"=>5000,
|
18
18
|
"appears_on_statement_as"=>"BAL*Statement text",
|
19
|
-
"created_at"=>"2014-
|
19
|
+
"created_at"=>"2014-05-15T00:41:55.448643Z",
|
20
20
|
"currency"=>"USD",
|
21
21
|
"description"=>"Some descriptive text for the debit in the dashboard",
|
22
22
|
"failure_reason"=>nil,
|
23
23
|
"failure_reason_code"=>nil,
|
24
|
-
"href"=>"/debits/
|
25
|
-
"id"=>"
|
24
|
+
"href"=>"/debits/WD5z5CvSR6PFx0GgUFn0icKx",
|
25
|
+
"id"=>"WD5z5CvSR6PFx0GgUFn0icKx",
|
26
26
|
"links"=>
|
27
|
-
{"customer"=>"
|
27
|
+
{"customer"=>"CU2L981m9AtPY8pjpGpjnjnf",
|
28
28
|
"dispute"=>nil,
|
29
29
|
"order"=>nil,
|
30
|
-
"source"=>"
|
30
|
+
"source"=>"CC4xXVOyMBDdk7FtzG9HwtBv"},
|
31
31
|
"meta"=>{},
|
32
32
|
"status"=>"succeeded",
|
33
|
-
"transaction_number"=>"
|
34
|
-
"updated_at"=>"2014-
|
33
|
+
"transaction_number"=>"W588-680-6120",
|
34
|
+
"updated_at"=>"2014-05-15T00:42:17.739744Z"},
|
35
35
|
@hyperlinks=
|
36
36
|
{"customer"=>
|
37
|
-
#<Proc:
|
37
|
+
#<Proc:0x007fa7d30d8810/lib/balanced/resources/resource.rb:60 (lambda)>,
|
38
38
|
"dispute"=>
|
39
|
-
#<Proc:
|
39
|
+
#<Proc:0x007fa7d30d3d38/lib/balanced/utils.rb:6 (lambda)>,
|
40
40
|
"events"=>
|
41
|
-
#<Proc:
|
41
|
+
#<Proc:0x007fa7d30d1bc8/lib/balanced/utils.rb:6 (lambda)>,
|
42
42
|
"order"=>
|
43
|
-
#<Proc:
|
43
|
+
#<Proc:0x007fa7d30d1128/lib/balanced/utils.rb:6 (lambda)>,
|
44
44
|
"refunds"=>
|
45
|
-
#<Proc:
|
45
|
+
#<Proc:0x007fa7d30cb070/lib/balanced/utils.rb:6 (lambda)>,
|
46
46
|
"source"=>
|
47
|
-
#<Proc:
|
47
|
+
#<Proc:0x007fa7d30c9338/lib/balanced/resources/resource.rb:60 (lambda)>}>
|
48
48
|
|
49
49
|
% endif
|
@@ -2,9 +2,9 @@
|
|
2
2
|
Balanced::Card.debit
|
3
3
|
% elif mode == 'request':
|
4
4
|
require 'balanced'
|
5
|
-
Balanced.configure('ak-test-
|
5
|
+
Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
|
6
6
|
|
7
|
-
card = Balanced::Card.fetch('/cards/
|
7
|
+
card = Balanced::Card.fetch('/cards/CC6iIaFL1QliTaYG47BArZAh')
|
8
8
|
card.debit(
|
9
9
|
:amount => 5000,
|
10
10
|
:appears_on_statement_as => 'Statement text',
|
@@ -12,38 +12,38 @@ card.debit(
|
|
12
12
|
)
|
13
13
|
|
14
14
|
% elif mode == 'response':
|
15
|
-
#<Balanced::Debit:
|
15
|
+
#<Balanced::Debit:0x007fa7d31cb830
|
16
16
|
@attributes=
|
17
17
|
{"amount"=>5000,
|
18
18
|
"appears_on_statement_as"=>"BAL*Statement text",
|
19
|
-
"created_at"=>"2014-
|
19
|
+
"created_at"=>"2014-05-15T00:42:39.077752Z",
|
20
20
|
"currency"=>"USD",
|
21
21
|
"description"=>"Some descriptive text for the debit in the dashboard",
|
22
22
|
"failure_reason"=>nil,
|
23
23
|
"failure_reason_code"=>nil,
|
24
|
-
"href"=>"/debits/
|
25
|
-
"id"=>"
|
24
|
+
"href"=>"/debits/WD6mairBakAx5t8ETjMYFu7T",
|
25
|
+
"id"=>"WD6mairBakAx5t8ETjMYFu7T",
|
26
26
|
"links"=>
|
27
27
|
{"customer"=>nil,
|
28
28
|
"dispute"=>nil,
|
29
29
|
"order"=>nil,
|
30
|
-
"source"=>"
|
30
|
+
"source"=>"CC6iIaFL1QliTaYG47BArZAh"},
|
31
31
|
"meta"=>{},
|
32
32
|
"status"=>"succeeded",
|
33
|
-
"transaction_number"=>"
|
34
|
-
"updated_at"=>"2014-
|
33
|
+
"transaction_number"=>"W755-582-8394",
|
34
|
+
"updated_at"=>"2014-05-15T00:42:42.685055Z"},
|
35
35
|
@hyperlinks=
|
36
36
|
{"customer"=>
|
37
|
-
#<Proc:
|
37
|
+
#<Proc:0x007fa7d31cacf0/lib/balanced/utils.rb:6 (lambda)>,
|
38
38
|
"dispute"=>
|
39
|
-
#<Proc:
|
39
|
+
#<Proc:0x007fa7d31ca278/lib/balanced/utils.rb:6 (lambda)>,
|
40
40
|
"events"=>
|
41
|
-
#<Proc:
|
41
|
+
#<Proc:0x007fa7d31c8400/lib/balanced/utils.rb:6 (lambda)>,
|
42
42
|
"order"=>
|
43
|
-
#<Proc:
|
43
|
+
#<Proc:0x007fa7d31c39c8/lib/balanced/utils.rb:6 (lambda)>,
|
44
44
|
"refunds"=>
|
45
|
-
#<Proc:
|
45
|
+
#<Proc:0x007fa7d31c1a60/lib/balanced/utils.rb:6 (lambda)>,
|
46
46
|
"source"=>
|
47
|
-
#<Proc:
|
47
|
+
#<Proc:0x007fa7d31c0070/lib/balanced/resources/resource.rb:60 (lambda)>}>
|
48
48
|
|
49
49
|
% endif
|
@@ -3,9 +3,9 @@ Balanced::Card.unstore
|
|
3
3
|
|
4
4
|
% elif mode == 'request':
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('ak-test-
|
6
|
+
Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
|
7
7
|
|
8
|
-
card = Balanced::Card.fetch('/cards/
|
8
|
+
card = Balanced::Card.fetch('/cards/CC4gG6BE70pMOYKPBive9qoF')
|
9
9
|
card.unstore
|
10
10
|
|
11
11
|
% elif mode == 'response':
|
@@ -3,47 +3,47 @@ Balanced::CardHold.capture
|
|
3
3
|
|
4
4
|
% elif mode == 'request':
|
5
5
|
require 'balanced'
|
6
|
-
Balanced.configure('ak-test-
|
6
|
+
Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
|
7
7
|
|
8
|
-
card_hold = Balanced::CardHold.fetch('/card_holds/
|
8
|
+
card_hold = Balanced::CardHold.fetch('/card_holds/HL363Kap0nkbuV050V9DHpjf')
|
9
9
|
debit = card_hold.capture(
|
10
10
|
:appears_on_statement_as => 'ShowsUpOnStmt',
|
11
11
|
:description => 'Some descriptive text for the debit in the dashboard'
|
12
12
|
)
|
13
13
|
|
14
14
|
% elif mode == 'response':
|
15
|
-
#<Balanced::Debit:
|
15
|
+
#<Balanced::Debit:0x007fa7d319ac30
|
16
16
|
@attributes=
|
17
17
|
{"amount"=>5000,
|
18
18
|
"appears_on_statement_as"=>"BAL*ShowsUpOnStmt",
|
19
|
-
"created_at"=>"2014-
|
19
|
+
"created_at"=>"2014-05-15T00:39:50.951932Z",
|
20
20
|
"currency"=>"USD",
|
21
21
|
"description"=>"Some descriptive text for the debit in the dashboard",
|
22
22
|
"failure_reason"=>nil,
|
23
23
|
"failure_reason_code"=>nil,
|
24
|
-
"href"=>"/debits/
|
25
|
-
"id"=>"
|
24
|
+
"href"=>"/debits/WD3j4fH7OIZgWaAF3SMTTu0l",
|
25
|
+
"id"=>"WD3j4fH7OIZgWaAF3SMTTu0l",
|
26
26
|
"links"=>
|
27
|
-
{"customer"=>
|
27
|
+
{"customer"=>nil,
|
28
28
|
"dispute"=>nil,
|
29
29
|
"order"=>nil,
|
30
|
-
"source"=>"
|
30
|
+
"source"=>"CC35aRYQB8XnL0CxtKGFG7d3"},
|
31
31
|
"meta"=>{"holding.for"=>"user1", "meaningful.key"=>"some.value"},
|
32
32
|
"status"=>"succeeded",
|
33
|
-
"transaction_number"=>"
|
34
|
-
"updated_at"=>"2014-
|
33
|
+
"transaction_number"=>"W683-224-2501",
|
34
|
+
"updated_at"=>"2014-05-15T00:40:04.899900Z"},
|
35
35
|
@hyperlinks=
|
36
36
|
{"customer"=>
|
37
|
-
#<Proc:
|
37
|
+
#<Proc:0x007fa7d319a0c8/lib/balanced/utils.rb:6 (lambda)>,
|
38
38
|
"dispute"=>
|
39
|
-
#<Proc:
|
39
|
+
#<Proc:0x007fa7d31996f0/lib/balanced/utils.rb:6 (lambda)>,
|
40
40
|
"events"=>
|
41
|
-
#<Proc:
|
41
|
+
#<Proc:0x007fa7d3193868/lib/balanced/utils.rb:6 (lambda)>,
|
42
42
|
"order"=>
|
43
|
-
#<Proc:
|
43
|
+
#<Proc:0x007fa7d3192dc8/lib/balanced/utils.rb:6 (lambda)>,
|
44
44
|
"refunds"=>
|
45
|
-
#<Proc:
|
45
|
+
#<Proc:0x007fa7d3190dc0/lib/balanced/utils.rb:6 (lambda)>,
|
46
46
|
"source"=>
|
47
|
-
#<Proc:
|
47
|
+
#<Proc:0x007fa7d318f3d0/lib/balanced/resources/resource.rb:60 (lambda)>}>
|
48
48
|
|
49
49
|
% endif
|
@@ -2,39 +2,39 @@
|
|
2
2
|
Balanced::Card.hold
|
3
3
|
% elif mode == 'request':
|
4
4
|
require 'balanced'
|
5
|
-
Balanced.configure('ak-test-
|
5
|
+
Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
|
6
6
|
|
7
|
-
card = Balanced::Card.fetch('/cards/
|
7
|
+
card = Balanced::Card.fetch('/cards/CC35aRYQB8XnL0CxtKGFG7d3')
|
8
8
|
card.hold(
|
9
9
|
:amount => 5000,
|
10
10
|
:description => 'Some descriptive text for the debit in the dashboard'
|
11
11
|
)
|
12
12
|
% elif mode == 'response':
|
13
|
-
#<Balanced::CardHold:
|
13
|
+
#<Balanced::CardHold:0x007fa7d316d5a0
|
14
14
|
@attributes=
|
15
15
|
{"amount"=>5000,
|
16
|
-
"created_at"=>"2014-
|
16
|
+
"created_at"=>"2014-05-15T00:40:11.970823Z",
|
17
17
|
"currency"=>"USD",
|
18
18
|
"description"=>"Some descriptive text for the debit in the dashboard",
|
19
|
-
"expires_at"=>"2014-05-
|
19
|
+
"expires_at"=>"2014-05-22T00:40:17.141216Z",
|
20
20
|
"failure_reason"=>nil,
|
21
21
|
"failure_reason_code"=>nil,
|
22
|
-
"href"=>"/card_holds/
|
23
|
-
"id"=>"
|
24
|
-
"links"=>{"card"=>"
|
22
|
+
"href"=>"/card_holds/HL3GI4qAmsr7ZdOzUgVuzmOF",
|
23
|
+
"id"=>"HL3GI4qAmsr7ZdOzUgVuzmOF",
|
24
|
+
"links"=>{"card"=>"CC35aRYQB8XnL0CxtKGFG7d3", "debit"=>nil},
|
25
25
|
"meta"=>{},
|
26
26
|
"status"=>"succeeded",
|
27
|
-
"transaction_number"=>"
|
28
|
-
"updated_at"=>"2014-
|
27
|
+
"transaction_number"=>"HL069-470-2887",
|
28
|
+
"updated_at"=>"2014-05-15T00:40:24.943265Z",
|
29
29
|
"voided_at"=>nil},
|
30
30
|
@hyperlinks=
|
31
31
|
{"card"=>
|
32
|
-
#<Proc:
|
32
|
+
#<Proc:0x007fa7d3167a10/lib/balanced/resources/resource.rb:60 (lambda)>,
|
33
33
|
"debit"=>
|
34
|
-
#<Proc:
|
34
|
+
#<Proc:0x007fa7d3166fe8/lib/balanced/utils.rb:6 (lambda)>,
|
35
35
|
"debits"=>
|
36
|
-
#<Proc:
|
36
|
+
#<Proc:0x007fa7d3164e28/lib/balanced/utils.rb:6 (lambda)>,
|
37
37
|
"events"=>
|
38
|
-
#<Proc:
|
38
|
+
#<Proc:0x007fa7d3162a10/lib/balanced/utils.rb:6 (lambda)>}>
|
39
39
|
|
40
40
|
% endif
|