cobrato-client 0.2.11 → 0.3.0.rc1

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: 57b5f969a5fd3448d3081e0a3db5297469f52059
4
- data.tar.gz: e31dac4fbf2b61108bae0cc71f7d202aac287add
3
+ metadata.gz: 34e41e9ef0321c8cf312f03d315e020a9afc3567
4
+ data.tar.gz: cfcfe54f2026a64fdd3a720db55f189f348bfc88
5
5
  SHA512:
6
- metadata.gz: 774278c276b90d75cac4784b107fc356a8ef467770f144555c7915f7bc107447751050c41b90c4f5f6d6092852ce1efe4e37a4d216aa82b5da8480e742e5c18d
7
- data.tar.gz: 9e8fd600df08ebdca64e8421dd3ce97718ebbd6bdbddd5968c4377806ff01fe6cbd8daece94ba92ea855b07aa34b13c911bc4cbeeab76f5f3d37381b5e81de30
6
+ metadata.gz: 62a05d8c70b7b526d41389c4d46fbc70188cccb5959960368608e85b8e9f416ea4b76a07d392bb48ec9296d30ea2bd503ce550f7a261578949e9401342debec2
7
+ data.tar.gz: 744e551420c4b37ca0741ede0a4045a7811209bbff54f1b2843efc8d8b826f9336b037499ad55b1940a65ea33617045ffb6999a8beb1da099581f6d7b2dcf3f7
data/CHANGELOG.md ADDED
@@ -0,0 +1,55 @@
1
+ # Changelog
2
+
3
+ ## v0.3.0
4
+
5
+ ### Structural changes
6
+
7
+ To open the path for new charging methods beyond Bank Billet, we made some structural changes:
8
+
9
+ #### `ChargeAccount` is now `ChargeConfig`
10
+
11
+ `ChargeAccount` is now `ChargeConfig` and have new attributes:
12
+
13
+ - `type`: the only possible value at this moment is `"billet"` that is the default value
14
+
15
+ #### Changes on `Charge`
16
+
17
+ ##### Changed `Charge` attribute names
18
+
19
+ - `Charge#status` now is `Charge#registration_status`
20
+ - `Charge#registered` now is `Charge#registrable`
21
+ - `Charge#charge_account_id` now is `Charge#charge_config_id`
22
+
23
+ ##### Removed `Charge` attributes
24
+
25
+ - `Charge#has_cnab_remittance`
26
+
27
+ ##### Added `Charge` attributes
28
+
29
+ - `type`: the only possible value at this moment is `"billet"`
30
+
31
+ ##### Changed `Charge#registration_status` (old `Charge#status`) names
32
+
33
+ - `"not_generated_remittance"` is now `"without_remittance"`
34
+ - `"generated_remittance"` is now `"remitted"`
35
+ - `"registered"` stays the same
36
+ - `"registered_with_error"` was added
37
+
38
+ #### Changes on `RegressCnab`
39
+
40
+ ##### Changed `RegressCnab` attribute names
41
+
42
+ - `RegressCnab#charge_account_id` now is `RegressCnab#charge_config_id`
43
+
44
+ #### Changes on `RemittanceCnab`
45
+
46
+ ##### Changed `RemittanceCnab` attribute names
47
+
48
+ - `RemittanceCnab#charge_account_id` now is `RemittanceCnab#charge_config_id`
49
+
50
+
51
+ ## v0.2.11
52
+
53
+ ### Add `ChargeAccount` attributes:
54
+
55
+ - `transmission-code`: it is a remittance related attribute only used by billet ChargeConfig for Santander bank
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cobrato-client (0.2.11)
4
+ cobrato-client (0.3.0.rc1)
5
5
  multi_json (~> 1.11.1)
6
6
  typhoeus (~> 0.7.2)
7
7
  virtus (~> 1.0.5)
data/README.md CHANGED
@@ -49,7 +49,7 @@ end
49
49
 
50
50
  * [Payees API](http://docs.cobrato.com/#beneficiário)
51
51
  * [Bank Accounts API](http://docs.cobrato.com/#conta-bancária)
52
- * [Charge Accounts API](http://docs.cobrato.com/#conta-de-cobrança)
52
+ * [Charge Configs API](http://docs.cobrato.com/#configuração-de-cobrança)
53
53
  * [Charges API](http://docs.cobrato.com/#cobrança)
54
54
  * [Regress Cnab](http://docs.cobrato.com/#cnab-de-retorno)
55
55
  * [Remittance Cnab](http://docs.cobrato.com/#cnab-de-remessa)
@@ -78,15 +78,15 @@ end
78
78
  | DELETE | [api/v1/bank_accounts/:id](http://docs.cobrato.com/#exclusão-de-conta-bancária) | client.bank_accounts.destroy |
79
79
  | GET | [api/v1/bank_accounts/portfolio_codes](http://docs.cobrato.com/#carteiras-disponíveis) | client.bank_accounts.portfolio_codes |
80
80
 
81
- #### [Charge Accounts](http://docs.cobrato.com/#conta-de-cobrança)
81
+ #### [Charge Configs](http://docs.cobrato.com/#configuração-de-cobrança)
82
82
 
83
- | HTTP method | Endpoint | Client method |
84
- | ----------- | --------------------------------------------------------------------------------------- | ------------------------------ |
85
- | POST | [api/v1/charge_accounts](http://docs.cobrato.com/#criação-de-conta-de-cobrança) | client.charge_accounts.create |
86
- | GET | [api/v1/charge_accounts](http://docs.cobrato.com/#lista-de-todas-as-contas-de-cobrança) | client.charge_accounts.list |
87
- | GET | [api/v1/charge_accounts/:id](http://docs.cobrato.com/#informações-da-conta-de-cobrança) | client.charge_accounts.show |
88
- | PUT | [api/v1/charge_accounts/:id](http://docs.cobrato.com/#atualização-de-conta-de-cobrança) | client.charge_accounts.update |
89
- | DELETE | [api/v1/charge_accounts/:id](http://docs.cobrato.com/#exclusão-de-conta-de-cobrança) | client.charge_accounts.destroy |
83
+ | HTTP method | Endpoint | Client method |
84
+ | ----------- | --------------------------------------------------------------------------------------------- | ------------------------------ |
85
+ | POST | [api/v1/charge_configs](http://docs.cobrato.com/#criação-de-configuração-de-cobrança) | client.charge_configs.create |
86
+ | GET | [api/v1/charge_configs](http://docs.cobrato.com/#lista-de-todas-as-configurações-de-cobrança) | client.charge_configs.list |
87
+ | GET | [api/v1/charge_configs/:id](http://docs.cobrato.com/#informações-de-configuração-de-cobrança) | client.charge_configs.show |
88
+ | PUT | [api/v1/charge_configs/:id](http://docs.cobrato.com/#atualização-de-configuração-de-cobrança) | client.charge_configs.update |
89
+ | DELETE | [api/v1/charge_configs/:id](http://docs.cobrato.com/#exclusão-de-configuração-de-cobrança) | client.charge_configs.destroy |
90
90
 
91
91
  #### [Charges](http://docs.cobrato.com/#cobrança)
92
92
 
@@ -190,9 +190,9 @@ When you call `client.payees.destroy(1)`, an event `cobrato.payees.destroy` will
190
190
  * bank_accounts
191
191
  - cobrato.bank_accounts.create
192
192
  - cobrato.bank_accounts.destroy
193
- * charge_accounts
194
- - cobrato.charge_accounts.create
195
- - cobrato.charge_accounts.destroy
193
+ * charge_configs
194
+ - cobrato.charge_configs.create
195
+ - cobrato.charge_configs.destroy
196
196
  * charges
197
197
  - cobrato.charges.create
198
198
  - cobrato.charges.destroy
data/lib/cobrato.rb CHANGED
@@ -11,7 +11,7 @@ require "cobrato/signature"
11
11
  require "cobrato/entities/base"
12
12
  require "cobrato/entities/payee"
13
13
  require "cobrato/entities/bank_account"
14
- require "cobrato/entities/charge_account"
14
+ require "cobrato/entities/charge_config"
15
15
  require "cobrato/entities/charge"
16
16
  require "cobrato/entities/webhook"
17
17
  require "cobrato/entities/bank_billet"
@@ -21,7 +21,7 @@ require "cobrato/entities/remittance_cnab"
21
21
  require "cobrato/resources/base"
22
22
  require "cobrato/resources/payee"
23
23
  require "cobrato/resources/bank_account"
24
- require "cobrato/resources/charge_account"
24
+ require "cobrato/resources/charge_config"
25
25
  require "cobrato/resources/charge"
26
26
  require "cobrato/resources/webhook"
27
27
  require "cobrato/resources/charging_type"
@@ -23,8 +23,8 @@ module Cobrato
23
23
  Resources::BankAccount.new(http)
24
24
  end
25
25
 
26
- def charge_accounts
27
- Resources::ChargeAccount.new(http)
26
+ def charge_configs
27
+ Resources::ChargeConfig.new(http)
28
28
  end
29
29
 
30
30
  def charges
@@ -2,7 +2,8 @@ module Cobrato
2
2
  module Entities
3
3
  class Charge < Base
4
4
  attribute :id, Integer
5
- attribute :charge_account_id, Integer
5
+ attribute :type, String
6
+ attribute :charge_config_id, Integer
6
7
  attribute :due_date, Date
7
8
  attribute :processing_date, Date
8
9
  attribute :document_kind, String
@@ -21,9 +22,8 @@ module Cobrato
21
22
  attribute :received_at, Date
22
23
  attribute :processing_date, Date
23
24
  attribute :for_homologation, Boolean
24
- attribute :has_cnab_remittance, Boolean
25
- attribute :registered, Boolean
26
- attribute :status, String
25
+ attribute :registrable, Boolean
26
+ attribute :registration_status, String
27
27
  attribute :payer_national_identifier_type, String
28
28
  attribute :payer_national_identifier, String
29
29
  attribute :payer_name, String
@@ -36,4 +36,4 @@ module Cobrato
36
36
  attribute :payer_state, String
37
37
  end
38
38
  end
39
- end
39
+ end
@@ -1,7 +1,8 @@
1
1
  module Cobrato
2
2
  module Entities
3
- class ChargeAccount < Base
3
+ class ChargeConfig < Base
4
4
  attribute :id, Integer
5
+ attribute :type, String
5
6
  attribute :bank_account_id, Integer
6
7
  attribute :portfolio_code, String
7
8
  attribute :agreement_code, String
@@ -1,10 +1,10 @@
1
1
  module Cobrato
2
2
  module Entities
3
3
  class RegressCnab < Base
4
- attribute :id, Integer
5
- attribute :charge_account_id, Integer
6
- attribute :status, String
7
- attribute :report, Hash
4
+ attribute :id, Integer
5
+ attribute :charge_config_id, Integer
6
+ attribute :status, String
7
+ attribute :report, Hash
8
8
  end
9
9
  end
10
10
  end
@@ -1,9 +1,9 @@
1
1
  module Cobrato
2
2
  module Entities
3
3
  class RemittanceCnab < Base
4
- attribute :id, Integer
5
- attribute :charge_account_id, Integer
6
- attribute :status, String
4
+ attribute :id, Integer
5
+ attribute :charge_config_id, Integer
6
+ attribute :status, String
7
7
  end
8
8
  end
9
9
  end
@@ -1,6 +1,6 @@
1
1
  module Cobrato
2
2
  module Resources
3
- class ChargeAccount < Base
3
+ class ChargeConfig < Base
4
4
  crud :all
5
5
  end
6
6
  end
@@ -1,3 +1,3 @@
1
1
  module Cobrato
2
- VERSION = '0.2.11'
2
+ VERSION = '0.3.0.rc1'
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.2.11
4
+ version: 0.3.0.rc1
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-04-01 00:00:00.000000000 Z
13
+ date: 2016-04-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: typhoeus
@@ -180,6 +180,7 @@ files:
180
180
  - .hound.yml
181
181
  - .rspec
182
182
  - .travis.yml
183
+ - CHANGELOG.md
183
184
  - Gemfile
184
185
  - Gemfile.lock
185
186
  - LICENSE
@@ -195,7 +196,7 @@ files:
195
196
  - lib/cobrato/entities/bank_billet.rb
196
197
  - lib/cobrato/entities/base.rb
197
198
  - lib/cobrato/entities/charge.rb
198
- - lib/cobrato/entities/charge_account.rb
199
+ - lib/cobrato/entities/charge_config.rb
199
200
  - lib/cobrato/entities/payee.rb
200
201
  - lib/cobrato/entities/regress_cnab.rb
201
202
  - lib/cobrato/entities/remittance_cnab.rb
@@ -206,7 +207,7 @@ files:
206
207
  - lib/cobrato/resources/bank_account.rb
207
208
  - lib/cobrato/resources/base.rb
208
209
  - lib/cobrato/resources/charge.rb
209
- - lib/cobrato/resources/charge_account.rb
210
+ - lib/cobrato/resources/charge_config.rb
210
211
  - lib/cobrato/resources/charging_type.rb
211
212
  - lib/cobrato/resources/hooks.rb
212
213
  - lib/cobrato/resources/payee.rb
@@ -231,9 +232,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
231
232
  version: '0'
232
233
  required_rubygems_version: !ruby/object:Gem::Requirement
233
234
  requirements:
234
- - - '>='
235
+ - - '>'
235
236
  - !ruby/object:Gem::Version
236
- version: '0'
237
+ version: 1.3.1
237
238
  requirements: []
238
239
  rubyforge_project:
239
240
  rubygems_version: 2.0.14.1