cobrato-client 0.1.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7445bf90a38a9e43604303f380415e75443215ab
4
- data.tar.gz: 050b8d7ec56df419a7082a7b628fcc29936e69c3
3
+ metadata.gz: f7dac4a2565afba57b24e1fbce7ae87c45b05d41
4
+ data.tar.gz: 3c947fffed2c2c1d48342e4f7bc6031f01a8ed22
5
5
  SHA512:
6
- metadata.gz: 63e60f05dd8ce7b184fcc26f9707285f481c23daff1499a4c756a1368c0f2c965ca3a80bfae850dbd574d570324292111d999f05833969ba44b236b1e9d5a65a
7
- data.tar.gz: 1c73c868c884ab61bb3aa3969b3137da4a534e9761bd7365c31f4931f3799a4c3e69efcd89952062c4f16ee6f94b34baeaf0cbb24835411eeca02a7bd48cd54b
6
+ metadata.gz: 0117f1e78e3d31859afe34152043fdbc756a15f2004ddafa6a003a5133666a1d66bec1e72fe393388334eb2a930e1345bd5fc7006653203ad04446f4f944eba2
7
+ data.tar.gz: 517254f5cee98ca536faf52a8a542b7d4f1c0cbc19407193347a3ddbe2f076e8e18cec7ad60e968c99ceab3af42bcd3bb91509dc869f7a3f0dc338234d6c1ca4
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cobrato-client (0.1.0)
4
+ cobrato-client (0.2.1)
5
5
  multi_json (~> 1.11.1)
6
6
  typhoeus (~> 0.7.2)
7
7
  virtus (~> 1.0.5)
@@ -14,9 +14,9 @@ GEM
14
14
  descendants_tracker (~> 0.0.4)
15
15
  ice_nine (~> 0.11.0)
16
16
  thread_safe (~> 0.3, >= 0.3.1)
17
- byebug (4.0.5)
17
+ byebug (5.0.0)
18
18
  columnize (= 0.9.0)
19
- codeclimate-test-reporter (0.4.7)
19
+ codeclimate-test-reporter (0.4.8)
20
20
  simplecov (>= 0.7.1, < 1.0.0)
21
21
  coderay (1.1.0)
22
22
  coercible (1.0.0)
@@ -27,31 +27,31 @@ GEM
27
27
  diff-lcs (1.2.5)
28
28
  docile (1.1.5)
29
29
  equalizer (0.0.11)
30
- ethon (0.7.4)
30
+ ethon (0.8.0)
31
31
  ffi (>= 1.3.0)
32
32
  ffi (1.9.10)
33
33
  ice_nine (0.11.1)
34
34
  json (1.8.3)
35
35
  method_source (0.8.2)
36
- multi_json (1.11.1)
37
- pry (0.10.1)
36
+ multi_json (1.11.2)
37
+ pry (0.10.2)
38
38
  coderay (~> 1.1.0)
39
39
  method_source (~> 0.8.1)
40
40
  slop (~> 3.4)
41
- pry-byebug (3.1.0)
42
- byebug (~> 4.0)
41
+ pry-byebug (3.2.0)
42
+ byebug (~> 5.0)
43
43
  pry (~> 0.10)
44
44
  rake (10.4.2)
45
45
  rspec (3.3.0)
46
46
  rspec-core (~> 3.3.0)
47
47
  rspec-expectations (~> 3.3.0)
48
48
  rspec-mocks (~> 3.3.0)
49
- rspec-core (3.3.1)
49
+ rspec-core (3.3.2)
50
50
  rspec-support (~> 3.3.0)
51
- rspec-expectations (3.3.0)
51
+ rspec-expectations (3.3.1)
52
52
  diff-lcs (>= 1.2.0, < 2.0)
53
53
  rspec-support (~> 3.3.0)
54
- rspec-mocks (3.3.1)
54
+ rspec-mocks (3.3.2)
55
55
  diff-lcs (>= 1.2.0, < 2.0)
56
56
  rspec-support (~> 3.3.0)
57
57
  rspec-support (3.3.0)
@@ -62,7 +62,7 @@ GEM
62
62
  simplecov-html (0.10.0)
63
63
  slop (3.6.0)
64
64
  thread_safe (0.3.5)
65
- typhoeus (0.7.2)
65
+ typhoeus (0.7.3)
66
66
  ethon (>= 0.7.4)
67
67
  vcr (2.9.3)
68
68
  virtus (1.0.5)
@@ -70,7 +70,7 @@ GEM
70
70
  coercible (~> 1.0)
71
71
  descendants_tracker (~> 0.0, >= 0.0.3)
72
72
  equalizer (~> 0.0, >= 0.0.9)
73
- wisper (1.6.0)
73
+ wisper (1.6.1)
74
74
 
75
75
  PLATFORMS
76
76
  ruby
@@ -84,3 +84,6 @@ DEPENDENCIES
84
84
  rspec (~> 3.3)
85
85
  simplecov (~> 0.10)
86
86
  vcr (~> 2.9)
87
+
88
+ BUNDLED WITH
89
+ 1.10.6
data/README.md CHANGED
@@ -109,15 +109,11 @@ end
109
109
  | PUT | [api/v1/webhooks/:id](http://myfreecomm.github.io/cobrato//api/v1/webhooks/index.html#update) | client.webhooks.update |
110
110
  | DELETE | [api/v1/webhooks/:id](http://myfreecomm.github.io/cobrato//api/v1/webhooks/index.html#delete) | client.webhooks.destroy |
111
111
 
112
- #### [Webhooks](#todo)
113
-
114
- | HTTP method | Endpoint | Client method |
115
- | ----------- | ------------------- | ----------------------- |
116
- | POST | [api/v1/webhooks](#todo) | client.webhooks.create |
117
- | GET | [api/v1/webhooks](#todo) | client.webhooks.list |
118
- | GET | [api/v1/webhooks/:id](#todo) | client.webhooks.show |
119
- | PUT | [api/v1/webhooks/:id](#todo) | client.webhooks.update |
120
- | DELETE | [api/v1/webhooks/:id](#todo) | client.webhooks.destroy |
112
+ #### [Charging types](#todo)
113
+
114
+ | HTTP method | Endpoint | Client method |
115
+ | ----------- | ------------------------------------- | -------------------------- |
116
+ | GET | [api/v1/charging_types](#todo) | client.changing_types.list |
121
117
 
122
118
  ## Callbacks
123
119
 
@@ -13,6 +13,7 @@ require "cobrato/entities/bank_account"
13
13
  require "cobrato/entities/charge_account"
14
14
  require "cobrato/entities/charge"
15
15
  require "cobrato/entities/webhook"
16
+ require "cobrato/entities/bank_billet"
16
17
 
17
18
  require "cobrato/resources/base"
18
19
  require "cobrato/resources/payee"
@@ -20,6 +21,7 @@ require "cobrato/resources/bank_account"
20
21
  require "cobrato/resources/charge_account"
21
22
  require "cobrato/resources/charge"
22
23
  require "cobrato/resources/webhook"
24
+ require "cobrato/resources/charging_type"
23
25
 
24
26
  module Cobrato
25
27
  def self.configuration
@@ -34,5 +34,9 @@ module Cobrato
34
34
  def webhooks
35
35
  Resources::Webhook.new(http)
36
36
  end
37
+
38
+ def charging_types
39
+ Resources::ChargingType.new(http)
40
+ end
37
41
  end
38
42
  end
@@ -0,0 +1,11 @@
1
+ module Cobrato
2
+ module Entities
3
+ class BankBillet < Base
4
+ attribute :bank_code, String
5
+ attribute :bank_name, String
6
+ attribute :portfolio_codes, Array
7
+ attribute :regress, Boolean
8
+ attribute :remittance, Boolean
9
+ end
10
+ end
11
+ end
@@ -1,7 +1,7 @@
1
1
  module Cobrato
2
2
  module Entities
3
3
  class Charge < Base
4
- attribute :id, Integer
4
+ attribute :id, Integer
5
5
  attribute :charge_account_id, Integer
6
6
  attribute :due_date, Date
7
7
  attribute :processing_date, Date
@@ -1,7 +1,7 @@
1
1
  module Cobrato
2
2
  module Entities
3
3
  class ChargeAccount < Base
4
- attribute :id, Integer
4
+ attribute :id, Integer
5
5
  attribute :bank_account_id, Integer
6
6
  attribute :portfolio_code, String
7
7
  attribute :agreement_code, String
@@ -1,9 +1,9 @@
1
1
  module Cobrato
2
2
  module Entities
3
3
  class Webhook < Base
4
- attribute :id, Integer
4
+ attribute :id, Integer
5
5
  attribute :description, String
6
- attribute :url, String
6
+ attribute :url, String
7
7
  end
8
8
  end
9
9
  end
@@ -0,0 +1,21 @@
1
+ module Cobrato
2
+ module Resources
3
+ class ChargingType < Base
4
+
5
+ def collection_name
6
+ 'charging_types'
7
+ end
8
+
9
+ def list
10
+ http.get(resource_base_path) do |response|
11
+ bank_billets = parsed_body(response)[collection_name]['bank_billets'].map do |item|
12
+ Cobrato::Entities::BankBillet.new(item)
13
+ end
14
+
15
+ Struct.new(:bank_billets).new(bank_billets)
16
+ end
17
+ end
18
+
19
+ end
20
+ end
21
+ end
@@ -1,3 +1,3 @@
1
1
  module Cobrato
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cobrato-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcio Ricardo Santos, Rodrigo Tassinari de Oliveira
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-07-01 00:00:00.000000000 Z
11
+ date: 2015-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -175,6 +175,7 @@ extra_rdoc_files: []
175
175
  files:
176
176
  - ".gitignore"
177
177
  - ".hound.yml"
178
+ - ".rspec"
178
179
  - ".travis.yml"
179
180
  - Gemfile
180
181
  - Gemfile.lock
@@ -188,6 +189,7 @@ files:
188
189
  - lib/cobrato/client.rb
189
190
  - lib/cobrato/configuration.rb
190
191
  - lib/cobrato/entities/bank_account.rb
192
+ - lib/cobrato/entities/bank_billet.rb
191
193
  - lib/cobrato/entities/base.rb
192
194
  - lib/cobrato/entities/charge.rb
193
195
  - lib/cobrato/entities/charge_account.rb
@@ -200,6 +202,7 @@ files:
200
202
  - lib/cobrato/resources/base.rb
201
203
  - lib/cobrato/resources/charge.rb
202
204
  - lib/cobrato/resources/charge_account.rb
205
+ - lib/cobrato/resources/charging_type.rb
203
206
  - lib/cobrato/resources/hooks.rb
204
207
  - lib/cobrato/resources/payee.rb
205
208
  - lib/cobrato/resources/webhook.rb