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
@@ -2,12 +2,12 @@
|
|
2
2
|
Balanced::BankAccount.fetch
|
3
3
|
% elif mode == 'request':
|
4
4
|
require 'balanced'
|
5
|
-
Balanced.configure('ak-test-
|
5
|
+
Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
|
6
6
|
|
7
|
-
bank_account = Balanced::BankAccount.fetch('/bank_accounts/
|
7
|
+
bank_account = Balanced::BankAccount.fetch('/bank_accounts/BA2EmblHC08bmwiwwNrbI0Rj')
|
8
8
|
|
9
9
|
% elif mode == 'response':
|
10
|
-
#<Balanced::BankAccount:
|
10
|
+
#<Balanced::BankAccount:0x007fa7d1b484c8
|
11
11
|
@attributes=
|
12
12
|
{"account_number"=>"xxxxxx0001",
|
13
13
|
"account_type"=>"checking",
|
@@ -21,26 +21,26 @@ bank_account = Balanced::BankAccount.fetch('/bank_accounts/BA3PDwDCkdeC4OgPtPNwo
|
|
21
21
|
"bank_name"=>"BANK OF AMERICA, N.A.",
|
22
22
|
"can_credit"=>true,
|
23
23
|
"can_debit"=>false,
|
24
|
-
"created_at"=>"2014-
|
24
|
+
"created_at"=>"2014-05-15T00:39:14.751497Z",
|
25
25
|
"fingerprint"=>
|
26
26
|
"5f0ba9fa3f1122ef13b944a40abfe44e7eba9e16934e64200913cb4c402ace14",
|
27
|
-
"href"=>"/bank_accounts/
|
28
|
-
"id"=>"
|
27
|
+
"href"=>"/bank_accounts/BA2EmblHC08bmwiwwNrbI0Rj",
|
28
|
+
"id"=>"BA2EmblHC08bmwiwwNrbI0Rj",
|
29
29
|
"links"=>{"bank_account_verification"=>nil, "customer"=>nil},
|
30
30
|
"meta"=>{},
|
31
31
|
"name"=>"Johann Bernoulli",
|
32
32
|
"routing_number"=>"121000358",
|
33
|
-
"updated_at"=>"2014-
|
33
|
+
"updated_at"=>"2014-05-15T00:39:14.751501Z"},
|
34
34
|
@hyperlinks=
|
35
35
|
{"bank_account_verification"=>
|
36
|
-
#<Proc:
|
36
|
+
#<Proc:0x007fa7d1b41a10/lib/balanced/utils.rb:6 (lambda)>,
|
37
37
|
"bank_account_verifications"=>
|
38
|
-
#<Proc:
|
38
|
+
#<Proc:0x007fa7d1b32100/lib/balanced/utils.rb:6 (lambda)>,
|
39
39
|
"credits"=>
|
40
|
-
#<Proc:
|
40
|
+
#<Proc:0x007fa7d1b28970/lib/balanced/utils.rb:6 (lambda)>,
|
41
41
|
"customer"=>
|
42
|
-
#<Proc:
|
42
|
+
#<Proc:0x007fa7d1b22b60/lib/balanced/utils.rb:6 (lambda)>,
|
43
43
|
"debits"=>
|
44
|
-
#<Proc:
|
44
|
+
#<Proc:0x007fa7d1b11360/lib/balanced/utils.rb:6 (lambda)>}>
|
45
45
|
|
46
46
|
% endif
|
@@ -3,9 +3,9 @@ Balanced::BankAccount.save
|
|
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
|
-
bank_account = Balanced::BankAccount.fetch('/bank_accounts/
|
8
|
+
bank_account = Balanced::BankAccount.fetch('/bank_accounts/BA2EmblHC08bmwiwwNrbI0Rj')
|
9
9
|
bank_account.meta = {
|
10
10
|
'facebook.user_id' => '0192837465',
|
11
11
|
'my-own-customer-id' => '12345',
|
@@ -14,7 +14,7 @@ bank_account.meta = {
|
|
14
14
|
bank_account.save
|
15
15
|
|
16
16
|
% elif mode == 'response':
|
17
|
-
#<Balanced::BankAccount:
|
17
|
+
#<Balanced::BankAccount:0x007fa7d1a9a2d8
|
18
18
|
@attributes=
|
19
19
|
{"account_number"=>"xxxxxx0001",
|
20
20
|
"account_type"=>"checking",
|
@@ -28,11 +28,11 @@ bank_account.save
|
|
28
28
|
"bank_name"=>"BANK OF AMERICA, N.A.",
|
29
29
|
"can_credit"=>true,
|
30
30
|
"can_debit"=>false,
|
31
|
-
"created_at"=>"2014-
|
31
|
+
"created_at"=>"2014-05-15T00:39:14.751497Z",
|
32
32
|
"fingerprint"=>
|
33
33
|
"5f0ba9fa3f1122ef13b944a40abfe44e7eba9e16934e64200913cb4c402ace14",
|
34
|
-
"href"=>"/bank_accounts/
|
35
|
-
"id"=>"
|
34
|
+
"href"=>"/bank_accounts/BA2EmblHC08bmwiwwNrbI0Rj",
|
35
|
+
"id"=>"BA2EmblHC08bmwiwwNrbI0Rj",
|
36
36
|
"links"=>{"bank_account_verification"=>nil, "customer"=>nil},
|
37
37
|
"meta"=>
|
38
38
|
{"facebook.user_id"=>"0192837465",
|
@@ -40,17 +40,17 @@ bank_account.save
|
|
40
40
|
"twitter.id"=>"1234987650"},
|
41
41
|
"name"=>"Johann Bernoulli",
|
42
42
|
"routing_number"=>"121000358",
|
43
|
-
"updated_at"=>"2014-
|
43
|
+
"updated_at"=>"2014-05-15T00:39:18.442760Z"},
|
44
44
|
@hyperlinks=
|
45
45
|
{"bank_account_verification"=>
|
46
|
-
#<Proc:
|
46
|
+
#<Proc:0x007fa7d1a92768/lib/balanced/utils.rb:6 (lambda)>,
|
47
47
|
"bank_account_verifications"=>
|
48
|
-
#<Proc:
|
48
|
+
#<Proc:0x007fa7d1a82020/lib/balanced/utils.rb:6 (lambda)>,
|
49
49
|
"credits"=>
|
50
|
-
#<Proc:
|
50
|
+
#<Proc:0x007fa7d1a7b018/lib/balanced/utils.rb:6 (lambda)>,
|
51
51
|
"customer"=>
|
52
|
-
#<Proc:
|
52
|
+
#<Proc:0x007fa7d1a79ab0/lib/balanced/utils.rb:6 (lambda)>,
|
53
53
|
"debits"=>
|
54
|
-
#<Proc:
|
54
|
+
#<Proc:0x007fa7d1a68fa8/lib/balanced/utils.rb:6 (lambda)>}>
|
55
55
|
|
56
56
|
% endif
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Balanced::BankAccount.verify
|
@@ -1,28 +1,28 @@
|
|
1
1
|
% if mode == 'definition':
|
2
|
-
|
2
|
+
Balanced::BankAccount.verify
|
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
|
-
bank_account = Balanced::BankAccount.fetch('/bank_accounts/
|
8
|
+
bank_account = Balanced::BankAccount.fetch('/bank_accounts/BA1W9SQLf5YRaGbUGiNIO2fb')
|
9
9
|
verification = bank_account.verify
|
10
10
|
|
11
11
|
% elif mode == 'response':
|
12
|
-
#<Balanced::BankAccountVerification:
|
12
|
+
#<Balanced::BankAccountVerification:0x007fa7d19ffc10
|
13
13
|
@attributes=
|
14
14
|
{"attempts"=>0,
|
15
15
|
"attempts_remaining"=>3,
|
16
|
-
"created_at"=>"2014-
|
16
|
+
"created_at"=>"2014-05-15T00:38:54.349838Z",
|
17
17
|
"deposit_status"=>"succeeded",
|
18
|
-
"href"=>"/verifications/
|
19
|
-
"id"=>"
|
20
|
-
"links"=>{"bank_account"=>"
|
18
|
+
"href"=>"/verifications/BZ2hpl7vb9rgWVZxrXRzZb93",
|
19
|
+
"id"=>"BZ2hpl7vb9rgWVZxrXRzZb93",
|
20
|
+
"links"=>{"bank_account"=>"BA1W9SQLf5YRaGbUGiNIO2fb"},
|
21
21
|
"meta"=>{},
|
22
|
-
"updated_at"=>"2014-
|
22
|
+
"updated_at"=>"2014-05-15T00:39:05.155113Z",
|
23
23
|
"verification_status"=>"pending"},
|
24
24
|
@hyperlinks=
|
25
25
|
{"bank_account"=>
|
26
|
-
#<Proc:
|
26
|
+
#<Proc:0x007fa7d19fc628/lib/balanced/resources/resource.rb:60 (lambda)>}>
|
27
27
|
|
28
28
|
% endif
|
@@ -1 +1 @@
|
|
1
|
-
Balanced::
|
1
|
+
Balanced::BankAccountVerification.fetch
|
@@ -1,2 +1,2 @@
|
|
1
1
|
<%= boiler_plate %>
|
2
|
-
verification = Balanced::
|
2
|
+
verification = Balanced::BankAccountVerification.fetch('<%=request['uri']%>')
|
@@ -1,27 +1,27 @@
|
|
1
1
|
% if mode == 'definition':
|
2
|
-
Balanced::
|
2
|
+
Balanced::BankAccountVerification.fetch
|
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
|
-
verification = Balanced::
|
8
|
+
verification = Balanced::BankAccountVerification.fetch('/verifications/BZ2hpl7vb9rgWVZxrXRzZb93')
|
9
9
|
|
10
10
|
% elif mode == 'response':
|
11
|
-
#<Balanced::BankAccountVerification:
|
11
|
+
#<Balanced::BankAccountVerification:0x007fa7d1978508
|
12
12
|
@attributes=
|
13
13
|
{"attempts"=>0,
|
14
14
|
"attempts_remaining"=>3,
|
15
|
-
"created_at"=>"2014-
|
15
|
+
"created_at"=>"2014-05-15T00:38:54.349838Z",
|
16
16
|
"deposit_status"=>"succeeded",
|
17
|
-
"href"=>"/verifications/
|
18
|
-
"id"=>"
|
19
|
-
"links"=>{"bank_account"=>"
|
17
|
+
"href"=>"/verifications/BZ2hpl7vb9rgWVZxrXRzZb93",
|
18
|
+
"id"=>"BZ2hpl7vb9rgWVZxrXRzZb93",
|
19
|
+
"links"=>{"bank_account"=>"BA1W9SQLf5YRaGbUGiNIO2fb"},
|
20
20
|
"meta"=>{},
|
21
|
-
"updated_at"=>"2014-
|
21
|
+
"updated_at"=>"2014-05-15T00:39:05.155113Z",
|
22
22
|
"verification_status"=>"pending"},
|
23
23
|
@hyperlinks=
|
24
24
|
{"bank_account"=>
|
25
|
-
#<Proc:
|
25
|
+
#<Proc:0x007fa7d19706f0/lib/balanced/resources/resource.rb:60 (lambda)>}>
|
26
26
|
|
27
27
|
% endif
|
@@ -1 +1 @@
|
|
1
|
-
Balanced::
|
1
|
+
Balanced::BankAccountVerification.confirm
|
@@ -1,11 +1,11 @@
|
|
1
1
|
% if mode == 'definition':
|
2
|
-
Balanced::
|
2
|
+
Balanced::BankAccountVerification.confirm
|
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
|
-
verification = Balanced::
|
8
|
+
verification = Balanced::BankAccountVerification.fetch('/verifications/BZ2hpl7vb9rgWVZxrXRzZb93')
|
9
9
|
verification.confirm(
|
10
10
|
amount_1 = 1,
|
11
11
|
amount_2 = 1
|
@@ -13,20 +13,20 @@ verification.confirm(
|
|
13
13
|
|
14
14
|
|
15
15
|
% elif mode == 'response':
|
16
|
-
#<Balanced::BankAccountVerification:
|
16
|
+
#<Balanced::BankAccountVerification:0x007fa7d19439e8
|
17
17
|
@attributes=
|
18
18
|
{"attempts"=>1,
|
19
19
|
"attempts_remaining"=>2,
|
20
|
-
"created_at"=>"2014-
|
20
|
+
"created_at"=>"2014-05-15T00:38:54.349838Z",
|
21
21
|
"deposit_status"=>"succeeded",
|
22
|
-
"href"=>"/verifications/
|
23
|
-
"id"=>"
|
24
|
-
"links"=>{"bank_account"=>"
|
22
|
+
"href"=>"/verifications/BZ2hpl7vb9rgWVZxrXRzZb93",
|
23
|
+
"id"=>"BZ2hpl7vb9rgWVZxrXRzZb93",
|
24
|
+
"links"=>{"bank_account"=>"BA1W9SQLf5YRaGbUGiNIO2fb"},
|
25
25
|
"meta"=>{},
|
26
|
-
"updated_at"=>"2014-
|
26
|
+
"updated_at"=>"2014-05-15T00:39:12.507804Z",
|
27
27
|
"verification_status"=>"succeeded"},
|
28
28
|
@hyperlinks=
|
29
29
|
{"bank_account"=>
|
30
|
-
#<Proc:
|
30
|
+
#<Proc:0x007fa7d1931fb8/lib/balanced/resources/resource.rb:60 (lambda)>}>
|
31
31
|
|
32
32
|
% endif
|
@@ -2,7 +2,7 @@
|
|
2
2
|
Balanced::Callback.new
|
3
3
|
% elif mode == 'request':
|
4
4
|
require 'balanced'
|
5
|
-
Balanced.configure('ak-test-
|
5
|
+
Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
|
6
6
|
|
7
7
|
callback = Balanced::Callback.new(
|
8
8
|
:method => 'post',
|
@@ -10,10 +10,10 @@ callback = Balanced::Callback.new(
|
|
10
10
|
).save
|
11
11
|
|
12
12
|
% elif mode == 'response':
|
13
|
-
#<Balanced::Callback:
|
13
|
+
#<Balanced::Callback:0x007fa7d18d5d58
|
14
14
|
@attributes=
|
15
|
-
{"href"=>"/callbacks/
|
16
|
-
"id"=>"
|
15
|
+
{"href"=>"/callbacks/CB2YCHTwHXMx9fZRKSbW3wNj",
|
16
|
+
"id"=>"CB2YCHTwHXMx9fZRKSbW3wNj",
|
17
17
|
"links"=>{},
|
18
18
|
"method"=>"post",
|
19
19
|
"revision"=>"1.1",
|
@@ -3,9 +3,9 @@ Balanced::Callback.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
|
-
callback = Balanced::Callback.fetch('/callbacks/
|
8
|
+
callback = Balanced::Callback.fetch('/callbacks/CB2YCHTwHXMx9fZRKSbW3wNj')
|
9
9
|
callback.unstore
|
10
10
|
% elif mode == 'response':
|
11
11
|
|
@@ -3,14 +3,14 @@ Balanced::Callback.all
|
|
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
|
callbacks = Balanced::Callback.all
|
9
9
|
% elif mode == 'response':
|
10
|
-
[#<Balanced::Callback:
|
10
|
+
[#<Balanced::Callback:0x007fa7d18987a0
|
11
11
|
@attributes=
|
12
|
-
{"href"=>"/callbacks/
|
13
|
-
"id"=>"
|
12
|
+
{"href"=>"/callbacks/CB2YCHTwHXMx9fZRKSbW3wNj",
|
13
|
+
"id"=>"CB2YCHTwHXMx9fZRKSbW3wNj",
|
14
14
|
"links"=>{},
|
15
15
|
"method"=>"post",
|
16
16
|
"revision"=>"1.1",
|
@@ -3,14 +3,14 @@ Balanced::Callback.fetch
|
|
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
|
-
callback = Balanced::Callback.fetch('/callbacks/
|
8
|
+
callback = Balanced::Callback.fetch('/callbacks/CB2YCHTwHXMx9fZRKSbW3wNj')
|
9
9
|
% elif mode == 'response':
|
10
|
-
#<Balanced::Callback:
|
10
|
+
#<Balanced::Callback:0x007fa7d18425f8
|
11
11
|
@attributes=
|
12
|
-
{"href"=>"/callbacks/
|
13
|
-
"id"=>"
|
12
|
+
{"href"=>"/callbacks/CB2YCHTwHXMx9fZRKSbW3wNj",
|
13
|
+
"id"=>"CB2YCHTwHXMx9fZRKSbW3wNj",
|
14
14
|
"links"=>{},
|
15
15
|
"method"=>"post",
|
16
16
|
"revision"=>"1.1",
|
@@ -3,12 +3,12 @@ Balanced::Card.associate_to_customer
|
|
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/
|
9
|
-
card.associate_to_customer('/customers/
|
8
|
+
card = Balanced::Card.fetch('/cards/CC4xXVOyMBDdk7FtzG9HwtBv')
|
9
|
+
card.associate_to_customer('/customers/CU2L981m9AtPY8pjpGpjnjnf')
|
10
10
|
% elif mode == 'response':
|
11
|
-
#<Balanced::Card:
|
11
|
+
#<Balanced::Card:0x007fa7d40a7818
|
12
12
|
@attributes=
|
13
13
|
{"address"=>
|
14
14
|
{"city"=>nil,
|
@@ -20,8 +20,12 @@ card.associate_to_customer('/customers/CU3VYCUIfwngJsidJWdGw2W5')
|
|
20
20
|
"avs_postal_match"=>nil,
|
21
21
|
"avs_result"=>nil,
|
22
22
|
"avs_street_match"=>nil,
|
23
|
+
"bank"=>"BANK OF HAWAII",
|
23
24
|
"brand"=>"MasterCard",
|
24
|
-
"
|
25
|
+
"can_credit"=>false,
|
26
|
+
"can_debit"=>true,
|
27
|
+
"category"=>nil,
|
28
|
+
"created_at"=>"2014-05-15T00:40:59.321023Z",
|
25
29
|
"cvv"=>"xxx",
|
26
30
|
"cvv_match"=>"yes",
|
27
31
|
"cvv_result"=>"Match",
|
@@ -29,20 +33,25 @@ card.associate_to_customer('/customers/CU3VYCUIfwngJsidJWdGw2W5')
|
|
29
33
|
"expiration_year"=>2020,
|
30
34
|
"fingerprint"=>
|
31
35
|
"fc4ccd5de54f42a5e75f76fbfde60948440c7a382ee7d21b2bc509ab9cfed788",
|
32
|
-
"href"=>"/cards/
|
33
|
-
"id"=>"
|
36
|
+
"href"=>"/cards/CC4xXVOyMBDdk7FtzG9HwtBv",
|
37
|
+
"id"=>"CC4xXVOyMBDdk7FtzG9HwtBv",
|
34
38
|
"is_verified"=>true,
|
35
|
-
"links"=>{"customer"=>"
|
39
|
+
"links"=>{"customer"=>"CU2L981m9AtPY8pjpGpjnjnf"},
|
36
40
|
"meta"=>{},
|
37
41
|
"name"=>nil,
|
38
42
|
"number"=>"xxxxxxxxxxxx5100",
|
39
|
-
"
|
43
|
+
"type"=>"",
|
44
|
+
"updated_at"=>"2014-05-15T00:41:01.104489Z"},
|
40
45
|
@hyperlinks=
|
41
46
|
{"card_holds"=>
|
42
|
-
#<Proc:
|
47
|
+
#<Proc:0x007fa7d40a5770/lib/balanced/utils.rb:6 (lambda)>,
|
48
|
+
"credits"=>
|
49
|
+
#<Proc:0x007fa7d40e78a0/lib/balanced/utils.rb:6 (lambda)>,
|
43
50
|
"customer"=>
|
44
|
-
#<Proc:
|
51
|
+
#<Proc:0x007fa7d40e5f00/lib/balanced/resources/resource.rb:60 (lambda)>,
|
45
52
|
"debits"=>
|
46
|
-
#<Proc:
|
53
|
+
#<Proc:0x007fa7d40e40b0/lib/balanced/utils.rb:6 (lambda)>,
|
54
|
+
"disputes"=>
|
55
|
+
#<Proc:0x007fa7d40ee1f0/lib/balanced/utils.rb:6 (lambda)>}>
|
47
56
|
|
48
57
|
% 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:0x007fa7d419e870
|
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 HAWAII",
|
28
29
|
"brand"=>"MasterCard",
|
29
|
-
"
|
30
|
+
"can_credit"=>false,
|
31
|
+
"can_debit"=>true,
|
32
|
+
"category"=>nil,
|
33
|
+
"created_at"=>"2014-05-15T00:40:59.321023Z",
|
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"=>2020,
|
35
39
|
"fingerprint"=>
|
36
40
|
"fc4ccd5de54f42a5e75f76fbfde60948440c7a382ee7d21b2bc509ab9cfed788",
|
37
|
-
"href"=>"/cards/
|
38
|
-
"id"=>"
|
41
|
+
"href"=>"/cards/CC4xXVOyMBDdk7FtzG9HwtBv",
|
42
|
+
"id"=>"CC4xXVOyMBDdk7FtzG9HwtBv",
|
39
43
|
"is_verified"=>true,
|
40
44
|
"links"=>{"customer"=>nil},
|
41
45
|
"meta"=>{},
|
42
46
|
"name"=>nil,
|
43
47
|
"number"=>"xxxxxxxxxxxx5100",
|
44
|
-
"
|
48
|
+
"type"=>"",
|
49
|
+
"updated_at"=>"2014-05-15T00:40:59.321027Z"},
|
45
50
|
@hyperlinks=
|
46
51
|
{"card_holds"=>
|
47
|
-
#<Proc:
|
52
|
+
#<Proc:0x007fa7d419c7f0/lib/balanced/utils.rb:6 (lambda)>,
|
53
|
+
"credits"=>
|
54
|
+
#<Proc:0x007fa7d419d8f8/lib/balanced/utils.rb:6 (lambda)>,
|
48
55
|
"customer"=>
|
49
|
-
#<Proc:
|
56
|
+
#<Proc:0x007fa7d419cf48/lib/balanced/utils.rb:6 (lambda)>,
|
50
57
|
"debits"=>
|
51
|
-
#<Proc:
|
58
|
+
#<Proc:0x007fa7d4196d28/lib/balanced/utils.rb:6 (lambda)>,
|
59
|
+
"disputes"=>
|
60
|
+
#<Proc:0x007fa7d4194d98/lib/balanced/utils.rb:6 (lambda)>}>
|
52
61
|
|
53
62
|
% endif
|