cobrato-client 0.2.2 → 0.2.3.pre

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: 112ba1eabefa989e34a00aac464a9be27a066364
4
- data.tar.gz: 4f27f61021173a1ebdb28a326e752b32c64effb6
3
+ metadata.gz: 65252228b0a9bf02570475a31b6b5f4678f0af7e
4
+ data.tar.gz: e8aefd1aa1803bacd0342b9146b113e8e76a948e
5
5
  SHA512:
6
- metadata.gz: c9930905765eb2ba4aa66ae78513d2b9eb53cef230358163ab79a0f308ef25ea8e71dc19f37d1a0172ae008eb0f94935575bf2b50e2cb95763299d87b5318015
7
- data.tar.gz: 1f5d842b53e737f96852a798282f6c1f6a055c550ec935315d56ac3f2d4ae73c0f3cdb0feae3e1a7519784a47055d43b2bfdc10ca02e1726a1a0fdd5dacfc758
6
+ metadata.gz: 4c1c15f03045c045f3d692fe13684c97c7a0629304ec530497d3118c110e7abe1e44e17acf4f8bcfaf62017fd481123b191b3fac0bf5f55dd88ec000b2b48f1b
7
+ data.tar.gz: 4c00d5893424c79b7d8adc5eb6c211f4c9ef6721a8334f647a16c1a776ac856a9ab317730390fbf2551a76c4716847467289e37b97b97b8f84b5e555a392ad70
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cobrato-client (0.2.2)
4
+ cobrato-client (0.2.3.pre)
5
5
  multi_json (~> 1.11.1)
6
6
  typhoeus (~> 0.7.2)
7
7
  virtus (~> 1.0.5)
data/README.md CHANGED
@@ -47,73 +47,74 @@ end
47
47
 
48
48
  ##### Now you have acess to every API endpoint:
49
49
 
50
- * [Payees API](http://myfreecomm.github.io/cobrato/api/v1/payees/index.html#index)
51
- * [Bank Accounts API](http://myfreecomm.github.io/cobrato/api/v1/bank_accounts/index.html#index)
52
- * [Charge Accounts API](http://myfreecomm.github.io/cobrato/api/v1/charge_accounts/index.html#index)
53
- * [Charges API](http://myfreecomm.github.io/cobrato/api/v1/charges/index.html#index)
54
- * [Webhooks API](http://myfreecomm.github.io/cobrato/api/v1/webhooks/index.html#index)
50
+ * [Payees API](http://docs.cobrato.com/#beneficiário)
51
+ * [Bank Accounts API](http://docs.cobrato.com/#conta-bancária)
52
+ * [Charge Accounts API](http://docs.cobrato.com/#conta-de-cobrança)
53
+ * [Charges API](http://docs.cobrato.com/#cobrança)
54
+ * [Webhooks API](http://docs.cobrato.com/#webhook)
55
55
 
56
56
  ## Endpoints
57
57
 
58
- #### [Payees](http://myfreecomm.github.io/cobrato/api/v1/payees/index.html#index)
59
-
60
- | HTTP method | Endpoint | Client method |
61
- | ----------- | ---------------------------------------------------------------------------------------- | --------------------- |
62
- | POST | [api/v1/payees](http://myfreecomm.github.io/cobrato/api/v1/payees/index.html#create) | client.payees.create |
63
- | GET | [api/v1/payees](http://myfreecomm.github.io/cobrato/api/v1/payees/index.html#list) | client.payees.list |
64
- | GET | [api/v1/payees/:id](http://myfreecomm.github.io/cobrato/api/v1/payees/index.html#show) | client.payees.show |
65
- | PUT | [api/v1/payees/:id](http://myfreecomm.github.io/cobrato/api/v1/payees/index.html#update) | client.payees.update |
66
- | DELETE | [api/v1/payees/:id](http://myfreecomm.github.io/cobrato/api/v1/payees/index.html#delete) | client.payees.destroy |
67
-
68
- #### [Bank Accounts](http://myfreecomm.github.io/cobrato/api/v1/bank_accounts/index.html#index)
69
-
70
- | HTTP method | Endpoint | Client method |
71
- | ----------- | --------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- |
72
- | POST | [api/v1/bank_accounts](http://myfreecomm.github.io/cobrato/api/v1/bank_accounts/index.html#create) | client.bank_accounts.create |
73
- | GET | [api/v1/bank_accounts](http://myfreecomm.github.io/cobrato/api/v1/bank_accounts/index.html#list) | client.bank_accounts.list |
74
- | GET | [api/v1/bank_accounts/:id](http://myfreecomm.github.io/cobrato/api/v1/bank_accounts/index.html#show) | client.bank_accounts.show |
75
- | PUT | [api/v1/bank_accounts/:id](http://myfreecomm.github.io/cobrato/api/v1/bank_accounts/index.html#update) | client.bank_accounts.update |
76
- | DELETE | [api/v1/bank_accounts/:id](http://myfreecomm.github.io/cobrato/api/v1/bank_accounts/index.html#delete) | client.bank_accounts.destroy |
77
- | GET | [api/v1/bank_accounts/portfolio_codes](http://myfreecomm.github.io/cobrato/api/v1/bank_accounts/index.html#portfolio_codes) | client.bank_accounts.portfolio_codes |
78
-
79
- #### [Charge Accounts](http://myfreecomm.github.io/cobrato/api/v1/charge_accounts/index.html#index)
80
-
81
- | HTTP method | Endpoint | Client method |
82
- | ----------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------ |
83
- | POST | [api/v1/charge_accounts](http://myfreecomm.github.io/cobrato/api/v1/charge_accounts/index.html#create) | client.charge_accounts.create |
84
- | GET | [api/v1/charge_accounts](http://myfreecomm.github.io/cobrato/api/v1/charge_accounts/index.html#list) | client.charge_accounts.list |
85
- | GET | [api/v1/charge_accounts/:id](http://myfreecomm.github.io/cobrato/api/v1/charge_accounts/index.html#show) | client.charge_accounts.show |
86
- | PUT | [api/v1/charge_accounts/:id](http://myfreecomm.github.io/cobrato/api/v1/charge_accounts/index.html#update) | client.charge_accounts.update |
87
- | DELETE | [api/v1/charge_accounts/:id](http://myfreecomm.github.io/cobrato/api/v1/charge_accounts/index.html#delete) | client.charge_accounts.destroy |
88
-
89
- #### [Charges](http://myfreecomm.github.io/cobrato/api/v1/charges/index.html#index)
90
-
91
- | HTTP method | Endpoint | Client method |
92
- | ----------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------- |
93
- | POST | [api/v1/charges](http://myfreecomm.github.io/cobrato/api/v1/charges/index.html#create) | client.charges.create |
94
- | GET | [api/v1/charges](http://myfreecomm.github.io/cobrato/api/v1/charges/index.html#list) | client.charges.list |
95
- | GET | [api/v1/charges/:id](http://myfreecomm.github.io/cobrato/api/v1/charges/index.html#show) | client.charges.show |
96
- | PUT | [api/v1/charges/:id](http://myfreecomm.github.io/cobrato/api/v1/charges/index.html#update) | client.charges.update |
97
- | DELETE | [api/v1/charges/:id](http://myfreecomm.github.io/cobrato/api/v1/charges/index.html#delete) | client.charges.destroy |
98
- | POST | [api/v1/charges/:id/receive](http://myfreecomm.github.io/cobrato/api/v1/charges/index.html#receive) | client.charges.receive |
99
- | POST | [api/v1/charges/:id/undo_receive](http://myfreecomm.github.io/cobrato/api/v1/charges/index.html#undo_receive) | client.charges.undo_receive |
100
- | POST | [api/v1/charges/:id/deliver_billet](http://myfreecomm.github.io/cobrato/api/v1/charges/index.html#deliver_billet) | client.charges.deliver_billet |
101
-
102
- #### [Webhooks](http://myfreecomm.github.io/cobrato/api/v1/webhooks/index.html#index)
103
-
104
- | HTTP method | Endpoint | Client method |
105
- | ----------- | --------------------------------------------------------------------------------------------- | ----------------------- |
106
- | POST | [api/v1/webhooks](http://myfreecomm.github.io/cobrato//api/v1/webhooks/index.html#create) | client.webhooks.create |
107
- | GET | [api/v1/webhooks](http://myfreecomm.github.io/cobrato//api/v1/webhooks/index.html#list) | client.webhooks.list |
108
- | GET | [api/v1/webhooks/:id](http://myfreecomm.github.io/cobrato//api/v1/webhooks/index.html#show) | client.webhooks.show |
109
- | PUT | [api/v1/webhooks/:id](http://myfreecomm.github.io/cobrato//api/v1/webhooks/index.html#update) | client.webhooks.update |
110
- | DELETE | [api/v1/webhooks/:id](http://myfreecomm.github.io/cobrato//api/v1/webhooks/index.html#delete) | client.webhooks.destroy |
111
-
112
- #### [Charging types](#todo)
113
-
114
- | HTTP method | Endpoint | Client method |
115
- | ----------- | ------------------------------------- | -------------------------- |
116
- | GET | [api/v1/charging_types](#todo) | client.changing_types.list |
58
+ #### [Payees](http://docs.cobrato.com/#beneficiário)
59
+
60
+ | HTTP method | Endpoint | Client method |
61
+ | ----------- | ------------------------------------------------------------------------- | --------------------- |
62
+ | POST | [api/v1/payees](http://docs.cobrato.com/#criação-de-beneficiário) | client.payees.create |
63
+ | GET | [api/v1/payees](http://docs.cobrato.com/#lista-de-todos-os-beneficiários) | client.payees.list |
64
+ | GET | [api/v1/payees/:id](http://docs.cobrato.com/#informações-do-beneficiário) | client.payees.show |
65
+ | PUT | [api/v1/payees/:id](http://docs.cobrato.com/#atualização-de-beneficiário) | client.payees.update |
66
+ | DELETE | [api/v1/payees/:id](http://docs.cobrato.com/#exclusão-de-beneficiário) | client.payees.destroy |
67
+
68
+ #### [Bank Accounts](http://docs.cobrato.com/#conta-bancária)
69
+
70
+ | HTTP method | Endpoint | Client method |
71
+ | ----------- | -------------------------------------------------------------------------------------- | ------------------------------------ |
72
+ | POST | [api/v1/bank_accounts](http://docs.cobrato.com/#criação-de-conta-bancária) | client.bank_accounts.create |
73
+ | GET | [api/v1/bank_accounts](http://docs.cobrato.com/#lista-de-todas-as-contas-bancárias) | client.bank_accounts.list |
74
+ | GET | [api/v1/bank_accounts/:id](http://docs.cobrato.com/#informações-da-conta-bancária) | client.bank_accounts.show |
75
+ | PUT | [api/v1/bank_accounts/:id](http://docs.cobrato.com/#atualização-de-conta-bancária) | client.bank_accounts.update |
76
+ | DELETE | [api/v1/bank_accounts/:id](http://docs.cobrato.com/#exclusão-de-conta-bancária) | client.bank_accounts.destroy |
77
+ | GET | [api/v1/bank_accounts/portfolio_codes](http://docs.cobrato.com/#carteiras-disponíveis) | client.bank_accounts.portfolio_codes |
78
+
79
+ #### [Charge Accounts](http://docs.cobrato.com/#conta-de-cobrança)
80
+
81
+ | HTTP method | Endpoint | Client method |
82
+ | ----------- | --------------------------------------------------------------------------------------- | ------------------------------ |
83
+ | POST | [api/v1/charge_accounts](http://docs.cobrato.com/#criação-de-conta-de-cobrança) | client.charge_accounts.create |
84
+ | GET | [api/v1/charge_accounts](http://docs.cobrato.com/#lista-de-todas-as-contas-de-cobrança) | client.charge_accounts.list |
85
+ | GET | [api/v1/charge_accounts/:id](http://docs.cobrato.com/#informações-da-conta-de-cobrança) | client.charge_accounts.show |
86
+ | PUT | [api/v1/charge_accounts/:id](http://docs.cobrato.com/#atualização-de-conta-de-cobrança) | client.charge_accounts.update |
87
+ | DELETE | [api/v1/charge_accounts/:id](http://docs.cobrato.com/#exclusão-de-conta-de-cobrança) | client.charge_accounts.destroy |
88
+
89
+ #### [Charges](http://docs.cobrato.com/#cobrança)
90
+
91
+ | HTTP method | Endpoint | Client method |
92
+ | ----------- | -------------------------------------------------------------------------------------------- | ----------------------------- |
93
+ | POST | [api/v1/charges](http://docs.cobrato.com/#criação-de-cobrança) | client.charges.create |
94
+ | GET | [api/v1/charges](http://docs.cobrato.com/#lista-de-todas-as-cobrança) | client.charges.list |
95
+ | GET | [api/v1/charges/:id](http://docs.cobrato.com/#informações-da-cobrança) | client.charges.show |
96
+ | PUT | [api/v1/charges/:id](http://docs.cobrato.com/#atualização-de-cobrança) | client.charges.update |
97
+ | DELETE | [api/v1/charges/:id](http://docs.cobrato.com/#exclusão-de-cobrança) | client.charges.destroy |
98
+ | POST | [api/v1/charges/:id/receive](http://docs.cobrato.com/#recebimento-de-cobrança) | client.charges.receive |
99
+ | POST | [api/v1/charges/:id/undo_receive](http://docs.cobrato.com/#desfazer-recebimento-de-cobrança) | client.charges.undo_receive |
100
+ | POST | [api/v1/charges/:id/deliver_billet](http://docs.cobrato.com/#envio-de-boleto-da-cobrança) | client.charges.deliver_billet |
101
+ | GET | [api/v1/charges/:id/billet](http://docs.cobrato.com/#boleto-da-cobrança) | client.charges.billet |
102
+
103
+ #### [Webhooks](http://docs.cobrato.com/#webhook)
104
+
105
+ | HTTP method | Endpoint | Client method |
106
+ | ----------- | ---------------------------------------------------------------------- | ----------------------- |
107
+ | POST | [api/v1/webhooks](http://docs.cobrato.com/#criação-de-webhook) | client.webhooks.create |
108
+ | GET | [api/v1/webhooks](http://docs.cobrato.com/#lista-de-todos-os-webhooks) | client.webhooks.list |
109
+ | GET | [api/v1/webhooks/:id](http://docs.cobrato.com/#informações-do-webhook) | client.webhooks.show |
110
+ | PUT | [api/v1/webhooks/:id](http://docs.cobrato.com/#atualização-de-webhook) | client.webhooks.update |
111
+ | DELETE | [api/v1/webhooks/:id](http://docs.cobrato.com/#exclusão-de-webhook) | client.webhooks.destroy |
112
+
113
+ #### [Charging types](http://docs.cobrato.com/#tipos-de-cobrança)
114
+
115
+ | HTTP method | Endpoint | Client method |
116
+ | ----------- | ------------------------------------------------------------------------------------- | -------------------------- |
117
+ | GET | [api/v1/charging_types](http://docs.cobrato.com/#lista-de-todos-os-tipos-de-cobrança) | client.changing_types.list |
117
118
 
118
119
  ## Callbacks
119
120
 
@@ -1,7 +1,7 @@
1
1
  module Cobrato
2
2
  module Entities
3
3
  class BankAccount < Base
4
- attribute :id, Integer
4
+ attribute :id, Integer
5
5
  attribute :payee_id, Integer
6
6
  attribute :bank_code, String
7
7
  attribute :agency, String
@@ -23,13 +23,6 @@ module Cobrato
23
23
  attribute :for_homologation, Boolean
24
24
  attribute :payment_method, String
25
25
  attribute :has_cnab_remittance, Boolean
26
- attribute :billet_url, String
27
-
28
- def initialize(attrs)
29
- attrs = JSON.parse(attrs.to_json, symbolize_names: true)
30
- attrs[:billet_url] = attrs[:_links].find { |l| l[:rel] == 'billet' }[:href]
31
- super attrs
32
- end
33
26
  end
34
27
  end
35
28
  end
@@ -1,7 +1,7 @@
1
1
  module Cobrato
2
2
  class Request
3
3
  attr_reader :args
4
-
4
+
5
5
  def initialize(args)
6
6
  @args = args
7
7
  end
@@ -21,6 +21,12 @@ module Cobrato
21
21
  end
22
22
  end
23
23
 
24
+ def billet(id)
25
+ http.get("#{resource_base_path}/#{id}/billet") do |response|
26
+ OpenStruct.new(MultiJson.load(response.body))
27
+ end
28
+ end
29
+
24
30
  notify :receive, :undo_receive
25
31
 
26
32
  end
@@ -1,3 +1,3 @@
1
1
  module Cobrato
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3.pre"
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.2
4
+ version: 0.2.3.pre
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: 2015-10-15 00:00:00.000000000 Z
13
+ date: 2015-10-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: typhoeus
@@ -226,9 +226,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
226
226
  version: '0'
227
227
  required_rubygems_version: !ruby/object:Gem::Requirement
228
228
  requirements:
229
- - - ">="
229
+ - - ">"
230
230
  - !ruby/object:Gem::Version
231
- version: '0'
231
+ version: 1.3.1
232
232
  requirements: []
233
233
  rubyforge_project:
234
234
  rubygems_version: 2.4.5.1