enotas_nfe 0.0.16 → 0.0.17
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 +4 -4
- data/lib/enotas_nfe/connection.rb +1 -1
- data/lib/enotas_nfe/endpoints.rb +5 -1
- data/lib/enotas_nfe/model/certificado_digital.rb +11 -0
- data/lib/enotas_nfe/request.rb +18 -1
- data/lib/enotas_nfe/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a53fbf29ac1b3cb257a1af2ae054735db71f5616
|
4
|
+
data.tar.gz: 455d90bee4405169603adf370ed5ae5978ff9e5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6087ae57439296c4fe54b683d99800c9794cd0d79de14b13cb0caa80479857d19765bcdf8e5d9cd41b579c801609c00123555282aa5686ec2937ddf0c426abee
|
7
|
+
data.tar.gz: '09b4159f1ef1ee5ff37fc900fc0cf41090648012ec60531cedf8b77a163666c65875c34ea453695a85c2cb71c3a9b79268d7274386d5f2eb8c871fcb4cdcdaaf'
|
data/lib/enotas_nfe/endpoints.rb
CHANGED
@@ -16,7 +16,11 @@ module EnotasNfe
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def set_logo(firm_id, body)
|
19
|
-
|
19
|
+
multipart_post("empresas/#{firm_id}/logo", body)
|
20
|
+
end
|
21
|
+
|
22
|
+
def set_certificado_digital(firm_id, body)
|
23
|
+
multipart_post("empresas/#{firm_id}/certificadoDigital", body)
|
20
24
|
end
|
21
25
|
|
22
26
|
## rota para carta de correcao
|
data/lib/enotas_nfe/request.rb
CHANGED
@@ -14,8 +14,26 @@ module EnotasNfe
|
|
14
14
|
request(:delete, path, body)
|
15
15
|
end
|
16
16
|
|
17
|
+
def multipart_post(path, body = {})
|
18
|
+
request_multipart(path, body)
|
19
|
+
end
|
20
|
+
|
17
21
|
private
|
18
22
|
|
23
|
+
def request_multipart(path, body)
|
24
|
+
response = connection.post do |request|
|
25
|
+
multipart_body = {}
|
26
|
+
multipart_body["arquivo"] = Faraday::UploadIO.new(body[:arquivo].tempfile, "application/x-pkcs12")
|
27
|
+
multipart_body["senha"] = body[:senha]
|
28
|
+
|
29
|
+
request.path = path
|
30
|
+
request.body = multipart_body
|
31
|
+
request.headers['Content-Type'] = 'multipart/form-data'
|
32
|
+
end
|
33
|
+
|
34
|
+
response.body
|
35
|
+
end
|
36
|
+
|
19
37
|
def request(method, path, body)
|
20
38
|
body_serialized = serialize_body(body)
|
21
39
|
|
@@ -38,6 +56,5 @@ module EnotasNfe
|
|
38
56
|
def serialize_body(body)
|
39
57
|
VirtusConvert.new(body, reject_nils: true).to_hash
|
40
58
|
end
|
41
|
-
|
42
59
|
end
|
43
60
|
end
|
data/lib/enotas_nfe/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enotas_nfe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luis Fernando Pimenta
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -133,6 +133,7 @@ files:
|
|
133
133
|
- lib/enotas_nfe/model/ambiente_homologacao.rb
|
134
134
|
- lib/enotas_nfe/model/ambiente_producao.rb
|
135
135
|
- lib/enotas_nfe/model/carta_correcao.rb
|
136
|
+
- lib/enotas_nfe/model/certificado_digital.rb
|
136
137
|
- lib/enotas_nfe/model/cliente.rb
|
137
138
|
- lib/enotas_nfe/model/cofins.rb
|
138
139
|
- lib/enotas_nfe/model/configuracoes_nfse_homologacao.rb
|