balanced 1.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +4 -0
- data/lib/balanced/error.rb +4 -2
- data/lib/balanced/resources/resource.rb +5 -0
- data/lib/balanced/version.rb +1 -1
- data/scenarios/api_key_create/ruby.mako +1 -1
- data/scenarios/api_key_list/ruby.mako +2 -2
- data/scenarios/api_key_show/ruby.mako +1 -1
- data/scenarios/bank_account_associate_to_customer/ruby.mako +6 -6
- data/scenarios/bank_account_create/ruby.mako +6 -6
- data/scenarios/bank_account_credit/ruby.mako +6 -6
- data/scenarios/bank_account_debit/ruby.mako +7 -7
- data/scenarios/bank_account_list/ruby.mako +12 -12
- data/scenarios/bank_account_show/ruby.mako +6 -6
- data/scenarios/bank_account_update/ruby.mako +6 -6
- data/scenarios/bank_account_verification_create/ruby.mako +2 -2
- data/scenarios/bank_account_verification_show/ruby.mako +2 -2
- data/scenarios/bank_account_verification_update/ruby.mako +2 -2
- data/scenarios/callback_create/ruby.mako +1 -1
- data/scenarios/callback_list/ruby.mako +1 -1
- data/scenarios/callback_show/ruby.mako +1 -1
- data/scenarios/card_associate_to_customer/definition.rb +1 -1
- data/scenarios/card_associate_to_customer/ruby.mako +5 -5
- data/scenarios/card_create/ruby.mako +4 -4
- data/scenarios/card_debit/ruby.mako +7 -7
- data/scenarios/card_hold_capture/ruby.mako +7 -7
- data/scenarios/card_hold_create/ruby.mako +5 -5
- data/scenarios/card_hold_list/ruby.mako +10 -10
- data/scenarios/card_hold_show/ruby.mako +5 -5
- data/scenarios/card_hold_update/ruby.mako +5 -5
- data/scenarios/card_hold_void/ruby.mako +5 -5
- data/scenarios/card_list/ruby.mako +8 -8
- data/scenarios/card_show/ruby.mako +4 -4
- data/scenarios/card_update/ruby.mako +4 -4
- data/scenarios/credit_list/ruby.mako +6 -6
- data/scenarios/credit_show/ruby.mako +6 -6
- data/scenarios/credit_update/ruby.mako +6 -6
- data/scenarios/customer_create/ruby.mako +13 -13
- data/scenarios/customer_list/ruby.mako +26 -26
- data/scenarios/customer_show/ruby.mako +13 -13
- data/scenarios/customer_update/ruby.mako +13 -13
- data/scenarios/debit_list/ruby.mako +14 -14
- data/scenarios/debit_show/ruby.mako +7 -7
- data/scenarios/debit_update/ruby.mako +7 -7
- data/scenarios/event_list/ruby.mako +4 -4
- data/scenarios/event_show/ruby.mako +2 -2
- data/scenarios/order_create/ruby.mako +7 -7
- data/scenarios/order_list/ruby.mako +7 -7
- data/scenarios/order_show/ruby.mako +7 -7
- data/scenarios/order_update/ruby.mako +7 -7
- data/scenarios/refund_create/ruby.mako +5 -5
- data/scenarios/refund_list/ruby.mako +5 -5
- data/scenarios/refund_show/ruby.mako +5 -5
- data/scenarios/refund_update/ruby.mako +5 -5
- data/scenarios/reversal_create/ruby.mako +4 -4
- data/scenarios/reversal_list/ruby.mako +4 -4
- data/scenarios/reversal_show/ruby.mako +4 -4
- data/scenarios/reversal_update/ruby.mako +4 -4
- data/spec/balanced/error_spec.rb +18 -0
- metadata +3 -2
@@ -14,7 +14,7 @@ order.meta = {
|
|
14
14
|
order.save
|
15
15
|
|
16
16
|
% elif mode == 'response':
|
17
|
-
#<Balanced::Order:
|
17
|
+
#<Balanced::Order:0x007fa4e3201838
|
18
18
|
@attributes=
|
19
19
|
{"amount"=>0,
|
20
20
|
"amount_escrowed"=>0,
|
@@ -35,16 +35,16 @@ order.save
|
|
35
35
|
"updated_at"=>"2014-03-06T19:23:42.673919Z"},
|
36
36
|
@hyperlinks=
|
37
37
|
{"buyers"=>
|
38
|
-
#<Proc:
|
38
|
+
#<Proc:0x007fa4e31ca748/lib/balanced/utils.rb:6 (lambda)>,
|
39
39
|
"credits"=>
|
40
|
-
#<Proc:
|
40
|
+
#<Proc:0x007fa4e31b91a0/lib/balanced/utils.rb:6 (lambda)>,
|
41
41
|
"debits"=>
|
42
|
-
#<Proc:
|
42
|
+
#<Proc:0x007fa4e31a0d30/lib/balanced/utils.rb:6 (lambda)>,
|
43
43
|
"merchant"=>
|
44
|
-
#<Proc:
|
44
|
+
#<Proc:0x007fa4e48a7b00/lib/balanced/resources/resource.rb:60 (lambda)>,
|
45
45
|
"refunds"=>
|
46
|
-
#<Proc:
|
46
|
+
#<Proc:0x007fa4e319b060/lib/balanced/utils.rb:6 (lambda)>,
|
47
47
|
"reversals"=>
|
48
|
-
#<Proc:
|
48
|
+
#<Proc:0x007fa4e488e510/lib/balanced/utils.rb:6 (lambda)>}>
|
49
49
|
|
50
50
|
% endif
|
@@ -16,7 +16,7 @@ debit.refund(
|
|
16
16
|
)
|
17
17
|
|
18
18
|
% elif mode == 'response':
|
19
|
-
#<Balanced::Refund:
|
19
|
+
#<Balanced::Refund:0x007fa4e30f0958
|
20
20
|
@attributes=
|
21
21
|
{"amount"=>3000,
|
22
22
|
"created_at"=>"2014-03-06T19:23:46.176138Z",
|
@@ -35,12 +35,12 @@ debit.refund(
|
|
35
35
|
"updated_at"=>"2014-03-06T19:23:48.234584Z"},
|
36
36
|
@hyperlinks=
|
37
37
|
{"debit"=>
|
38
|
-
#<Proc:
|
38
|
+
#<Proc:0x007fa4e30e0288/lib/balanced/resources/resource.rb:60 (lambda)>,
|
39
39
|
"dispute"=>
|
40
|
-
#<Proc:
|
40
|
+
#<Proc:0x007fa4e30da130/lib/balanced/utils.rb:6 (lambda)>,
|
41
41
|
"events"=>
|
42
|
-
#<Proc:
|
42
|
+
#<Proc:0x007fa4e30cb6a8/lib/balanced/utils.rb:6 (lambda)>,
|
43
43
|
"order"=>
|
44
|
-
#<Proc:
|
44
|
+
#<Proc:0x007fa4e30c0410/lib/balanced/utils.rb:6 (lambda)>}>
|
45
45
|
|
46
46
|
% endif
|
@@ -7,7 +7,7 @@ Balanced.configure('ak-test-2ADpvITfpgBn8uBzEGsQ2bIgWaftUWiul')
|
|
7
7
|
|
8
8
|
refunds = Balanced::Refund.all
|
9
9
|
% elif mode == 'response':
|
10
|
-
[#<Balanced::Refund:
|
10
|
+
[#<Balanced::Refund:0x007fa4e3039898
|
11
11
|
@attributes=
|
12
12
|
{"amount"=>3000,
|
13
13
|
"created_at"=>"2014-03-06T19:23:46.176138Z",
|
@@ -26,12 +26,12 @@ refunds = Balanced::Refund.all
|
|
26
26
|
"updated_at"=>"2014-03-06T19:23:48.234584Z"},
|
27
27
|
@hyperlinks=
|
28
28
|
{"debit"=>
|
29
|
-
#<Proc:
|
29
|
+
#<Proc:0x007fa4e40a4f98/lib/balanced/resources/resource.rb:60 (lambda)>,
|
30
30
|
"dispute"=>
|
31
|
-
#<Proc:
|
31
|
+
#<Proc:0x007fa4e4a7bd28/lib/balanced/utils.rb:6 (lambda)>,
|
32
32
|
"events"=>
|
33
|
-
#<Proc:
|
33
|
+
#<Proc:0x007fa4e4a784e8/lib/balanced/utils.rb:6 (lambda)>,
|
34
34
|
"order"=>
|
35
|
-
#<Proc:
|
35
|
+
#<Proc:0x007fa4e4a73510/lib/balanced/utils.rb:6 (lambda)>}>]
|
36
36
|
|
37
37
|
% endif
|
@@ -8,7 +8,7 @@ Balanced.configure('ak-test-2ADpvITfpgBn8uBzEGsQ2bIgWaftUWiul')
|
|
8
8
|
refund = Balanced::Refund.fetch('/refunds/RF6HsnqferSuES9VZEWrthG2')
|
9
9
|
|
10
10
|
% elif mode == 'response':
|
11
|
-
#<Balanced::Refund:
|
11
|
+
#<Balanced::Refund:0x007fa4e4a50c40
|
12
12
|
@attributes=
|
13
13
|
{"amount"=>3000,
|
14
14
|
"created_at"=>"2014-03-06T19:23:46.176138Z",
|
@@ -27,12 +27,12 @@ refund = Balanced::Refund.fetch('/refunds/RF6HsnqferSuES9VZEWrthG2')
|
|
27
27
|
"updated_at"=>"2014-03-06T19:23:48.234584Z"},
|
28
28
|
@hyperlinks=
|
29
29
|
{"debit"=>
|
30
|
-
#<Proc:
|
30
|
+
#<Proc:0x007fa4e4a4aa98/lib/balanced/resources/resource.rb:60 (lambda)>,
|
31
31
|
"dispute"=>
|
32
|
-
#<Proc:
|
32
|
+
#<Proc:0x007fa4e4a49df0/lib/balanced/utils.rb:6 (lambda)>,
|
33
33
|
"events"=>
|
34
|
-
#<Proc:
|
34
|
+
#<Proc:0x007fa4e4a43f18/lib/balanced/utils.rb:6 (lambda)>,
|
35
35
|
"order"=>
|
36
|
-
#<Proc:
|
36
|
+
#<Proc:0x007fa4e4a43338/lib/balanced/utils.rb:6 (lambda)>}>
|
37
37
|
|
38
38
|
% endif
|
@@ -15,7 +15,7 @@ refund.meta = {
|
|
15
15
|
refund.save
|
16
16
|
|
17
17
|
% elif mode == 'response':
|
18
|
-
#<Balanced::Refund:
|
18
|
+
#<Balanced::Refund:0x007fa4e4a31b10
|
19
19
|
@attributes=
|
20
20
|
{"amount"=>3000,
|
21
21
|
"created_at"=>"2014-03-06T19:23:46.176138Z",
|
@@ -34,12 +34,12 @@ refund.save
|
|
34
34
|
"updated_at"=>"2014-03-06T19:23:53.123358Z"},
|
35
35
|
@hyperlinks=
|
36
36
|
{"debit"=>
|
37
|
-
#<Proc:
|
37
|
+
#<Proc:0x007fa4e4a2af90/lib/balanced/resources/resource.rb:60 (lambda)>,
|
38
38
|
"dispute"=>
|
39
|
-
#<Proc:
|
39
|
+
#<Proc:0x007fa4e4a2b620/lib/balanced/utils.rb:6 (lambda)>,
|
40
40
|
"events"=>
|
41
|
-
#<Proc:
|
41
|
+
#<Proc:0x007fa4e4a22bb0/lib/balanced/utils.rb:6 (lambda)>,
|
42
42
|
"order"=>
|
43
|
-
#<Proc:
|
43
|
+
#<Proc:0x007fa4e4a22ca0/lib/balanced/utils.rb:6 (lambda)>}>
|
44
44
|
|
45
45
|
% endif
|
@@ -16,7 +16,7 @@ credit.reverse(
|
|
16
16
|
)
|
17
17
|
|
18
18
|
% elif mode == 'response':
|
19
|
-
#<Balanced::Reversal:
|
19
|
+
#<Balanced::Reversal:0x007fa4e3276bd8
|
20
20
|
@attributes=
|
21
21
|
{"amount"=>3000,
|
22
22
|
"created_at"=>"2014-03-06T19:23:55.596399Z",
|
@@ -36,10 +36,10 @@ credit.reverse(
|
|
36
36
|
"updated_at"=>"2014-03-06T19:23:56.470321Z"},
|
37
37
|
@hyperlinks=
|
38
38
|
{"credit"=>
|
39
|
-
#<Proc:
|
39
|
+
#<Proc:0x007fa4e326f798/lib/balanced/resources/resource.rb:60 (lambda)>,
|
40
40
|
"events"=>
|
41
|
-
#<Proc:
|
41
|
+
#<Proc:0x007fa4e326c980/lib/balanced/utils.rb:6 (lambda)>,
|
42
42
|
"order"=>
|
43
|
-
#<Proc:
|
43
|
+
#<Proc:0x007fa4e3267f48/lib/balanced/utils.rb:6 (lambda)>}>
|
44
44
|
|
45
45
|
% endif
|
@@ -7,7 +7,7 @@ Balanced.configure('ak-test-2ADpvITfpgBn8uBzEGsQ2bIgWaftUWiul')
|
|
7
7
|
|
8
8
|
reversals = Balanced::Reversal.all
|
9
9
|
% elif mode == 'response':
|
10
|
-
[#<Balanced::Reversal:
|
10
|
+
[#<Balanced::Reversal:0x007fa4e49eb340
|
11
11
|
@attributes=
|
12
12
|
{"amount"=>3000,
|
13
13
|
"created_at"=>"2014-03-06T19:23:55.596399Z",
|
@@ -27,10 +27,10 @@ reversals = Balanced::Reversal.all
|
|
27
27
|
"updated_at"=>"2014-03-06T19:23:56.470321Z"},
|
28
28
|
@hyperlinks=
|
29
29
|
{"credit"=>
|
30
|
-
#<Proc:
|
30
|
+
#<Proc:0x007fa4e49e8ed8/lib/balanced/resources/resource.rb:60 (lambda)>,
|
31
31
|
"events"=>
|
32
|
-
#<Proc:
|
32
|
+
#<Proc:0x007fa4e49e3050/lib/balanced/utils.rb:6 (lambda)>,
|
33
33
|
"order"=>
|
34
|
-
#<Proc:
|
34
|
+
#<Proc:0x007fa4e49e2448/lib/balanced/utils.rb:6 (lambda)>}>]
|
35
35
|
|
36
36
|
% endif
|
@@ -8,7 +8,7 @@ Balanced.configure('ak-test-2ADpvITfpgBn8uBzEGsQ2bIgWaftUWiul')
|
|
8
8
|
reversal = Balanced::Reversal.fetch('/reversals/RV6OCxJ1UhkG84is6H9PHjkZ')
|
9
9
|
|
10
10
|
% elif mode == 'response':
|
11
|
-
#<Balanced::Reversal:
|
11
|
+
#<Balanced::Reversal:0x007fa4e49c3340
|
12
12
|
@attributes=
|
13
13
|
{"amount"=>3000,
|
14
14
|
"created_at"=>"2014-03-06T19:23:55.596399Z",
|
@@ -28,10 +28,10 @@ reversal = Balanced::Reversal.fetch('/reversals/RV6OCxJ1UhkG84is6H9PHjkZ')
|
|
28
28
|
"updated_at"=>"2014-03-06T19:23:56.470321Z"},
|
29
29
|
@hyperlinks=
|
30
30
|
{"credit"=>
|
31
|
-
#<Proc:
|
31
|
+
#<Proc:0x007fa4e49c1d88/lib/balanced/resources/resource.rb:60 (lambda)>,
|
32
32
|
"events"=>
|
33
|
-
#<Proc:
|
33
|
+
#<Proc:0x007fa4e49bb640/lib/balanced/utils.rb:6 (lambda)>,
|
34
34
|
"order"=>
|
35
|
-
#<Proc:
|
35
|
+
#<Proc:0x007fa4e49bb488/lib/balanced/utils.rb:6 (lambda)>}>
|
36
36
|
|
37
37
|
% endif
|
@@ -15,7 +15,7 @@ reversal.meta = {
|
|
15
15
|
reversal.save
|
16
16
|
|
17
17
|
% elif mode == 'response':
|
18
|
-
#<Balanced::Reversal:
|
18
|
+
#<Balanced::Reversal:0x007fa4e49991f8
|
19
19
|
@attributes=
|
20
20
|
{"amount"=>3000,
|
21
21
|
"created_at"=>"2014-03-06T19:23:55.596399Z",
|
@@ -35,10 +35,10 @@ reversal.save
|
|
35
35
|
"updated_at"=>"2014-03-06T19:24:00.271458Z"},
|
36
36
|
@hyperlinks=
|
37
37
|
{"credit"=>
|
38
|
-
#<Proc:
|
38
|
+
#<Proc:0x007fa4e49932a8/lib/balanced/resources/resource.rb:60 (lambda)>,
|
39
39
|
"events"=>
|
40
|
-
#<Proc:
|
40
|
+
#<Proc:0x007fa4e49900f8/lib/balanced/utils.rb:6 (lambda)>,
|
41
41
|
"order"=>
|
42
|
-
#<Proc:
|
42
|
+
#<Proc:0x007fa4e293b398/lib/balanced/utils.rb:6 (lambda)>}>
|
43
43
|
|
44
44
|
% endif
|
data/spec/balanced/error_spec.rb
CHANGED
@@ -54,3 +54,21 @@ describe Balanced::UnassociatedCardError do
|
|
54
54
|
should == "The Balanced::Card with uri=#{card.attributes['uri']} is not associated to a customer"
|
55
55
|
end
|
56
56
|
end
|
57
|
+
|
58
|
+
describe 'Fetch NotFound' do
|
59
|
+
context 'href nil' do
|
60
|
+
it do
|
61
|
+
expect {
|
62
|
+
Balanced::Customer.fetch()
|
63
|
+
}.to raise_exception(Balanced::NotFound)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
context 'href empty string' do
|
68
|
+
it do
|
69
|
+
expect {
|
70
|
+
Balanced::Customer.fetch("")
|
71
|
+
}.to raise_exception(Balanced::NotFound)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: balanced
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Balanced
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -64,6 +64,7 @@ files:
|
|
64
64
|
- ".ruby-gemset"
|
65
65
|
- ".ruby-version"
|
66
66
|
- ".travis.yml"
|
67
|
+
- CHANGELOG.md
|
67
68
|
- CONTRIBUTORS
|
68
69
|
- Gemfile
|
69
70
|
- Guardfile
|