balanced 1.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -0
  3. data/README.md +4 -0
  4. data/lib/balanced/error.rb +4 -2
  5. data/lib/balanced/resources/resource.rb +5 -0
  6. data/lib/balanced/version.rb +1 -1
  7. data/scenarios/api_key_create/ruby.mako +1 -1
  8. data/scenarios/api_key_list/ruby.mako +2 -2
  9. data/scenarios/api_key_show/ruby.mako +1 -1
  10. data/scenarios/bank_account_associate_to_customer/ruby.mako +6 -6
  11. data/scenarios/bank_account_create/ruby.mako +6 -6
  12. data/scenarios/bank_account_credit/ruby.mako +6 -6
  13. data/scenarios/bank_account_debit/ruby.mako +7 -7
  14. data/scenarios/bank_account_list/ruby.mako +12 -12
  15. data/scenarios/bank_account_show/ruby.mako +6 -6
  16. data/scenarios/bank_account_update/ruby.mako +6 -6
  17. data/scenarios/bank_account_verification_create/ruby.mako +2 -2
  18. data/scenarios/bank_account_verification_show/ruby.mako +2 -2
  19. data/scenarios/bank_account_verification_update/ruby.mako +2 -2
  20. data/scenarios/callback_create/ruby.mako +1 -1
  21. data/scenarios/callback_list/ruby.mako +1 -1
  22. data/scenarios/callback_show/ruby.mako +1 -1
  23. data/scenarios/card_associate_to_customer/definition.rb +1 -1
  24. data/scenarios/card_associate_to_customer/ruby.mako +5 -5
  25. data/scenarios/card_create/ruby.mako +4 -4
  26. data/scenarios/card_debit/ruby.mako +7 -7
  27. data/scenarios/card_hold_capture/ruby.mako +7 -7
  28. data/scenarios/card_hold_create/ruby.mako +5 -5
  29. data/scenarios/card_hold_list/ruby.mako +10 -10
  30. data/scenarios/card_hold_show/ruby.mako +5 -5
  31. data/scenarios/card_hold_update/ruby.mako +5 -5
  32. data/scenarios/card_hold_void/ruby.mako +5 -5
  33. data/scenarios/card_list/ruby.mako +8 -8
  34. data/scenarios/card_show/ruby.mako +4 -4
  35. data/scenarios/card_update/ruby.mako +4 -4
  36. data/scenarios/credit_list/ruby.mako +6 -6
  37. data/scenarios/credit_show/ruby.mako +6 -6
  38. data/scenarios/credit_update/ruby.mako +6 -6
  39. data/scenarios/customer_create/ruby.mako +13 -13
  40. data/scenarios/customer_list/ruby.mako +26 -26
  41. data/scenarios/customer_show/ruby.mako +13 -13
  42. data/scenarios/customer_update/ruby.mako +13 -13
  43. data/scenarios/debit_list/ruby.mako +14 -14
  44. data/scenarios/debit_show/ruby.mako +7 -7
  45. data/scenarios/debit_update/ruby.mako +7 -7
  46. data/scenarios/event_list/ruby.mako +4 -4
  47. data/scenarios/event_show/ruby.mako +2 -2
  48. data/scenarios/order_create/ruby.mako +7 -7
  49. data/scenarios/order_list/ruby.mako +7 -7
  50. data/scenarios/order_show/ruby.mako +7 -7
  51. data/scenarios/order_update/ruby.mako +7 -7
  52. data/scenarios/refund_create/ruby.mako +5 -5
  53. data/scenarios/refund_list/ruby.mako +5 -5
  54. data/scenarios/refund_show/ruby.mako +5 -5
  55. data/scenarios/refund_update/ruby.mako +5 -5
  56. data/scenarios/reversal_create/ruby.mako +4 -4
  57. data/scenarios/reversal_list/ruby.mako +4 -4
  58. data/scenarios/reversal_show/ruby.mako +4 -4
  59. data/scenarios/reversal_update/ruby.mako +4 -4
  60. data/spec/balanced/error_spec.rb +18 -0
  61. metadata +3 -2
@@ -14,7 +14,7 @@ order.meta = {
14
14
  order.save
15
15
 
16
16
  % elif mode == 'response':
17
- #<Balanced::Order:0x007ff2bdaa41c0
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:0x007ff2bda9df28/lib/balanced/utils.rb:6 (lambda)>,
38
+ #<Proc:0x007fa4e31ca748/lib/balanced/utils.rb:6 (lambda)>,
39
39
  "credits"=>
40
- #<Proc:0x007ff2bda942e8/lib/balanced/utils.rb:6 (lambda)>,
40
+ #<Proc:0x007fa4e31b91a0/lib/balanced/utils.rb:6 (lambda)>,
41
41
  "debits"=>
42
- #<Proc:0x007ff2bc8cd050/lib/balanced/utils.rb:6 (lambda)>,
42
+ #<Proc:0x007fa4e31a0d30/lib/balanced/utils.rb:6 (lambda)>,
43
43
  "merchant"=>
44
- #<Proc:0x007ff2bc8c77b8/lib/balanced/resources/resource.rb:60 (lambda)>,
44
+ #<Proc:0x007fa4e48a7b00/lib/balanced/resources/resource.rb:60 (lambda)>,
45
45
  "refunds"=>
46
- #<Proc:0x007ff2bc8c4810/lib/balanced/utils.rb:6 (lambda)>,
46
+ #<Proc:0x007fa4e319b060/lib/balanced/utils.rb:6 (lambda)>,
47
47
  "reversals"=>
48
- #<Proc:0x007ff2bc8be6e0/lib/balanced/utils.rb:6 (lambda)>}>
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:0x007ff2bda0ead0
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:0x007ff2bda0c7d0/lib/balanced/resources/resource.rb:60 (lambda)>,
38
+ #<Proc:0x007fa4e30e0288/lib/balanced/resources/resource.rb:60 (lambda)>,
39
39
  "dispute"=>
40
- #<Proc:0x007ff2bda05688/lib/balanced/utils.rb:6 (lambda)>,
40
+ #<Proc:0x007fa4e30da130/lib/balanced/utils.rb:6 (lambda)>,
41
41
  "events"=>
42
- #<Proc:0x007ff2bda057f0/lib/balanced/utils.rb:6 (lambda)>,
42
+ #<Proc:0x007fa4e30cb6a8/lib/balanced/utils.rb:6 (lambda)>,
43
43
  "order"=>
44
- #<Proc:0x007ff2bda04a08/lib/balanced/utils.rb:6 (lambda)>}>
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:0x007ff2bd9dcb48
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:0x007ff2bd9d68d8/lib/balanced/resources/resource.rb:60 (lambda)>,
29
+ #<Proc:0x007fa4e40a4f98/lib/balanced/resources/resource.rb:60 (lambda)>,
30
30
  "dispute"=>
31
- #<Proc:0x007ff2bd9d5ac8/lib/balanced/utils.rb:6 (lambda)>,
31
+ #<Proc:0x007fa4e4a7bd28/lib/balanced/utils.rb:6 (lambda)>,
32
32
  "events"=>
33
- #<Proc:0x007ff2bd9cfa38/lib/balanced/utils.rb:6 (lambda)>,
33
+ #<Proc:0x007fa4e4a784e8/lib/balanced/utils.rb:6 (lambda)>,
34
34
  "order"=>
35
- #<Proc:0x007ff2bd9ceb88/lib/balanced/utils.rb:6 (lambda)>}>]
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:0x007ff2bc1125e0
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:0x007ff2bd9b5f48/lib/balanced/resources/resource.rb:60 (lambda)>,
30
+ #<Proc:0x007fa4e4a4aa98/lib/balanced/resources/resource.rb:60 (lambda)>,
31
31
  "dispute"=>
32
- #<Proc:0x007ff2bd9b6970/lib/balanced/utils.rb:6 (lambda)>,
32
+ #<Proc:0x007fa4e4a49df0/lib/balanced/utils.rb:6 (lambda)>,
33
33
  "events"=>
34
- #<Proc:0x007ff2bd9afb98/lib/balanced/utils.rb:6 (lambda)>,
34
+ #<Proc:0x007fa4e4a43f18/lib/balanced/utils.rb:6 (lambda)>,
35
35
  "order"=>
36
- #<Proc:0x007ff2bd9aed38/lib/balanced/utils.rb:6 (lambda)>}>
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:0x007ff2bd980668
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:0x007ff2bd97a8a8/lib/balanced/resources/resource.rb:60 (lambda)>,
37
+ #<Proc:0x007fa4e4a2af90/lib/balanced/resources/resource.rb:60 (lambda)>,
38
38
  "dispute"=>
39
- #<Proc:0x007ff2bd97b398/lib/balanced/utils.rb:6 (lambda)>,
39
+ #<Proc:0x007fa4e4a2b620/lib/balanced/utils.rb:6 (lambda)>,
40
40
  "events"=>
41
- #<Proc:0x007ff2bd9788c8/lib/balanced/utils.rb:6 (lambda)>,
41
+ #<Proc:0x007fa4e4a22bb0/lib/balanced/utils.rb:6 (lambda)>,
42
42
  "order"=>
43
- #<Proc:0x007ff2bd973580/lib/balanced/utils.rb:6 (lambda)>}>
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:0x007ff2bd951278
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:0x007ff2bd94b350/lib/balanced/resources/resource.rb:60 (lambda)>,
39
+ #<Proc:0x007fa4e326f798/lib/balanced/resources/resource.rb:60 (lambda)>,
40
40
  "events"=>
41
- #<Proc:0x007ff2bd948c90/lib/balanced/utils.rb:6 (lambda)>,
41
+ #<Proc:0x007fa4e326c980/lib/balanced/utils.rb:6 (lambda)>,
42
42
  "order"=>
43
- #<Proc:0x007ff2bd9480b0/lib/balanced/utils.rb:6 (lambda)>}>
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:0x007ff2bd929200
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:0x007ff2bd91f430/lib/balanced/resources/resource.rb:60 (lambda)>,
30
+ #<Proc:0x007fa4e49e8ed8/lib/balanced/resources/resource.rb:60 (lambda)>,
31
31
  "events"=>
32
- #<Proc:0x007ff2bd91c7a8/lib/balanced/utils.rb:6 (lambda)>,
32
+ #<Proc:0x007fa4e49e3050/lib/balanced/utils.rb:6 (lambda)>,
33
33
  "order"=>
34
- #<Proc:0x007ff2bd91dab8/lib/balanced/utils.rb:6 (lambda)>}>]
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:0x007ff2bd8c1858
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:0x007ff2bd8b9fb8/lib/balanced/resources/resource.rb:60 (lambda)>,
31
+ #<Proc:0x007fa4e49c1d88/lib/balanced/resources/resource.rb:60 (lambda)>,
32
32
  "events"=>
33
- #<Proc:0x007ff2bd8b07b0/lib/balanced/utils.rb:6 (lambda)>,
33
+ #<Proc:0x007fa4e49bb640/lib/balanced/utils.rb:6 (lambda)>,
34
34
  "order"=>
35
- #<Proc:0x007ff2bd8aa428/lib/balanced/utils.rb:6 (lambda)>}>
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:0x007ff2be14a358
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:0x007ff2be1428b0/lib/balanced/resources/resource.rb:60 (lambda)>,
38
+ #<Proc:0x007fa4e49932a8/lib/balanced/resources/resource.rb:60 (lambda)>,
39
39
  "events"=>
40
- #<Proc:0x007ff2be1381f8/lib/balanced/utils.rb:6 (lambda)>,
40
+ #<Proc:0x007fa4e49900f8/lib/balanced/utils.rb:6 (lambda)>,
41
41
  "order"=>
42
- #<Proc:0x007ff2be12bf20/lib/balanced/utils.rb:6 (lambda)>}>
42
+ #<Proc:0x007fa4e293b398/lib/balanced/utils.rb:6 (lambda)>}>
43
43
 
44
44
  % endif
@@ -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: '1.0'
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-10 00:00:00.000000000 Z
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