cobrato-client 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f7e523ee6e4dfefdaa40c18de8ff37f4b197bd61
4
- data.tar.gz: ce2ae1431ba4cfb93f8f6d910af79631e39dd0cc
3
+ metadata.gz: dcddd1ef773ad40e3075f5b0d6e9c1de25c1381a
4
+ data.tar.gz: 130106e99daba1d1beca18211a7300ea1fab8901
5
5
  SHA512:
6
- metadata.gz: 209ab62ce87ecb55a4c5e6f0434e9056a6961827162f447db5678d708d57ede2d49fef85b2338b4f3ffb08bbe18d6382fb9cba3b61293e47cf63e5dcb2c3fd90
7
- data.tar.gz: 9f08587ea1aac602b55450b5c229bf4be60d572657e14987756dc22e3820cd75f4a14754280ac07e85c7848398f613b7d212496626dcdb956792df8db786b382
6
+ metadata.gz: af33839a9fc303303c61fbdecca0e2e25d0b1da1ebb4dc8497a058fb2cde456e910a5f1aeb96d9983bed1b0902b0d93c3479666d05e12936a204cefd9f191d98
7
+ data.tar.gz: fb7570e8f677ede979b26798a69b0d79c8bc400b2aa7c28917e9c039048b846930859c7179b9e64d6c781314f075952a42c73827686c51995e2325bd2492b174
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## Next version
4
4
 
5
+ ## v0.13.0
6
+
7
+ - Add `charge_template_id` to `Charge`
8
+ - Add `ChargeTemplate` API
9
+
5
10
  ## v0.12.0
6
11
 
7
12
  - Add `Charge#payment_tax`
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cobrato-client (0.12.0)
4
+ cobrato-client (0.13.0)
5
5
  multi_json (~> 1.11.1)
6
6
  typhoeus (~> 0.7.2)
7
7
  virtus (~> 1.0.5)
data/README.md CHANGED
@@ -164,6 +164,17 @@ Now you have acess to every API endpoint:
164
164
  | ----------- | ------------------------------------------------------------------------------------- | -------------------------- |
165
165
  | GET | [api/v1/charging_types](http://docs.cobrato.com/#lista-de-todos-os-tipos-de-cobrança) | client.changing_types.list |
166
166
 
167
+ #### [Charge Template](http://docs.cobrato.com/#modelo-de-cobran-a)
168
+
169
+ | HTTP method | Endpoint | Client method |
170
+ | ----------- | ----------------------------------------------------------------------------------------- | ------------------------------- |
171
+ | POST | [api/v1/charge_templates](http://docs.cobrato.com/#cria-o-de-modelo-de-cobran-a) | client.charge_templates.create |
172
+ | GET | [api/v1/charge_templates](http://docs.cobrato.com/#lista-de-todos-os-modelos-de-cobran-a) | client.charge_templates.list |
173
+ | GET | [api/v1/charge_templates/:id](http://docs.cobrato.com/#informa-es-do-modelo-de-cobran-a) | client.charge_templates.show |
174
+ | PUT | [api/v1/charge_templates/:id](http://docs.cobrato.com/#atualiza-o-de-modelo-de-cobran-a) | client.charge_templates.update |
175
+ | DELETE | [api/v1/charge_templates/:id](http://docs.cobrato.com/#exclus-o-de-modelo-de-cobran-a) | client.charge_templates.destroy |
176
+
177
+
167
178
  ## Payload signature check
168
179
 
169
180
  You can check the [Cobrato signature](http://docs.cobrato.com/#assinatura-do-payload) on the payload request:
@@ -227,6 +238,9 @@ When you call `client.payees.destroy(1)`, an event `cobrato.payees.destroy` will
227
238
  * webhooks
228
239
  - cobrato.webhooks.create
229
240
  - cobrato.webhooks.destroy
241
+ * charge_templates
242
+ - cobrato.charge_templates.create
243
+ - cobrato.charge_templates.destroy
230
244
 
231
245
  ## Contributing
232
246
 
@@ -19,6 +19,7 @@ require "cobrato/entities/bank_billet"
19
19
  require "cobrato/entities/regress_cnab"
20
20
  require "cobrato/entities/remittance_cnab"
21
21
  require "cobrato/entities/credit_card"
22
+ require "cobrato/entities/charge_template"
22
23
 
23
24
  require "cobrato/resources/base"
24
25
  require "cobrato/resources/payee"
@@ -31,6 +32,7 @@ require "cobrato/resources/charging_type"
31
32
  require "cobrato/resources/regress_cnab"
32
33
  require "cobrato/resources/remittance_cnab"
33
34
  require "cobrato/resources/credit_card"
35
+ require "cobrato/resources/charge_template"
34
36
 
35
37
  module Cobrato
36
38
  def self.configuration
@@ -54,5 +54,9 @@ module Cobrato
54
54
  def payers
55
55
  Resources::Payer.new(http)
56
56
  end
57
+
58
+ def charge_templates
59
+ Resources::ChargeTemplate.new(http)
60
+ end
57
61
  end
58
- end
62
+ end
@@ -9,4 +9,4 @@ module Cobrato
9
9
  @user_agent = "Cobrato Ruby Client v#{Cobrato::VERSION}"
10
10
  end
11
11
  end
12
- end
12
+ end
@@ -22,6 +22,7 @@ module Cobrato
22
22
  attribute :canceled_at, DateTime
23
23
  attribute :paid_amount, Decimal
24
24
  attribute :paid_at, Date
25
+ attribute :charge_template_id, Integer
25
26
 
26
27
  attribute :total_amount, Decimal # deprecated
27
28
  attribute :received, Boolean # deprecated
@@ -0,0 +1,18 @@
1
+ module Cobrato
2
+ module Entities
3
+ class ChargeTemplate < Base
4
+ attribute :id, Integer
5
+ attribute :name, String
6
+ attribute :charged_amount, Decimal
7
+ attribute :document_kind, String
8
+ attribute :charge_config_id, Integer
9
+ attribute :instructions, String
10
+ attribute :demonstrative, String
11
+ attribute :registrable, Boolean
12
+ attribute :auto_send_billet, Boolean
13
+ attribute :interest_amount_per_month, Decimal
14
+ attribute :mulct_type, String
15
+ attribute :mulct_value, Decimal
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,7 @@
1
+ module Cobrato
2
+ module Resources
3
+ class ChargeTemplate < Base
4
+ crud :all
5
+ end
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module Cobrato
2
- VERSION = '0.12.0'
2
+ VERSION = '0.13.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cobrato-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcio Ricardo Santos
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2016-10-03 00:00:00.000000000 Z
13
+ date: 2016-11-28 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: typhoeus
@@ -199,6 +199,7 @@ files:
199
199
  - lib/cobrato/entities/base.rb
200
200
  - lib/cobrato/entities/charge.rb
201
201
  - lib/cobrato/entities/charge_config.rb
202
+ - lib/cobrato/entities/charge_template.rb
202
203
  - lib/cobrato/entities/credit_card.rb
203
204
  - lib/cobrato/entities/payee.rb
204
205
  - lib/cobrato/entities/payer.rb
@@ -212,6 +213,7 @@ files:
212
213
  - lib/cobrato/resources/base.rb
213
214
  - lib/cobrato/resources/charge.rb
214
215
  - lib/cobrato/resources/charge_config.rb
216
+ - lib/cobrato/resources/charge_template.rb
215
217
  - lib/cobrato/resources/charging_type.rb
216
218
  - lib/cobrato/resources/credit_card.rb
217
219
  - lib/cobrato/resources/hooks.rb