sigep_web 0.2.0 → 0.2.1
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/Gemfile.lock +3 -3
- data/README.md +2 -0
- data/lib/sigep_web/generate_labels_digit_verifier.rb +10 -2
- data/lib/sigep_web/postage_card_status.rb +10 -2
- data/lib/sigep_web/request_labels.rb +8 -2
- data/lib/sigep_web/request_plp_services.rb +10 -2
- data/lib/sigep_web/search_client.rb +9 -3
- data/lib/sigep_web/service_availability.rb +21 -9
- data/lib/sigep_web/version.rb +1 -1
- data/lib/sigep_web/zip_query.rb +8 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 171fb05793ca9e554aafa219dbfc92cca2944b6b
|
4
|
+
data.tar.gz: 00e6a7362573132b6bf84c4fef682baf29ed4b04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7deed62676ce171997b2edece70f2a356a556d0871c8bcf44016b4837376b43f4e17efdfdf881539b54a0063c43aa90cfcdc82afb0bc18545e6e3c2bb1b35d12
|
7
|
+
data.tar.gz: a5b261995a9eb43c464df157764be328cb6b7998d6ce9430fdb6d66cf3bf7c6ac450db38a71a0b6e0d85758ea1a4d50d2ef26d7fbfc4bbe9915f994011c2a7d4
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
sigep_web (0.1
|
4
|
+
sigep_web (0.2.1)
|
5
|
+
nokogiri (~> 1.6)
|
6
|
+
savon (~> 2.10.0)
|
5
7
|
|
6
8
|
GEM
|
7
9
|
remote: https://rubygems.org/
|
@@ -57,10 +59,8 @@ PLATFORMS
|
|
57
59
|
|
58
60
|
DEPENDENCIES
|
59
61
|
bundler (~> 1.11)
|
60
|
-
nokogiri (~> 1.6)
|
61
62
|
rake (~> 10.0)
|
62
63
|
rspec (~> 3.0)
|
63
|
-
savon (~> 2.10.0)
|
64
64
|
sigep_web!
|
65
65
|
|
66
66
|
BUNDLED WITH
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# sigep_web
|
2
2
|
|
3
3
|
[](https://travis-ci.org/Sidoniuns/sigep_web)
|
4
|
+
[](https://badge.fury.io/rb/sigep_web)
|
5
|
+
[](https://codeclimate.com/github/Sidoniuns/sigep_web)
|
4
6
|
|
5
7
|
## Installation
|
6
8
|
gem install sigep_web
|
@@ -8,13 +8,21 @@ module SigepWeb
|
|
8
8
|
def request
|
9
9
|
authenticate = SigepWeb.configuration.authenticate
|
10
10
|
begin
|
11
|
-
process(:gera_digito_verificador_etiquetas, {
|
11
|
+
response = process(:gera_digito_verificador_etiquetas, {
|
12
12
|
etiquetas: @labels,
|
13
13
|
usuario: authenticate.user,
|
14
14
|
senha: authenticate.password
|
15
15
|
}).to_hash[:gera_digito_verificador_etiquetas_response][:return]
|
16
|
+
|
17
|
+
{
|
18
|
+
success: true,
|
19
|
+
response: response
|
20
|
+
}
|
16
21
|
rescue Savon::SOAPFault => msg
|
17
|
-
|
22
|
+
{
|
23
|
+
success: false,
|
24
|
+
error: msg
|
25
|
+
}
|
18
26
|
end
|
19
27
|
end
|
20
28
|
end
|
@@ -8,13 +8,21 @@ module SigepWeb
|
|
8
8
|
def request
|
9
9
|
authenticate = SigepWeb.configuration.authenticate
|
10
10
|
begin
|
11
|
-
process(:get_status_cartao_postagem, {
|
11
|
+
response = process(:get_status_cartao_postagem, {
|
12
12
|
numeroCartaoPostagem: @postage_number_card,
|
13
13
|
usuario: authenticate.user,
|
14
14
|
senha: authenticate.password
|
15
15
|
}).to_hash[:get_status_cartao_postagem_response][:return]
|
16
|
+
|
17
|
+
{
|
18
|
+
success: true,
|
19
|
+
response: response
|
20
|
+
}
|
16
21
|
rescue Savon::SOAPFault => msg
|
17
|
-
|
22
|
+
{
|
23
|
+
success: false,
|
24
|
+
error: msg
|
25
|
+
}
|
18
26
|
end
|
19
27
|
end
|
20
28
|
end
|
@@ -20,9 +20,15 @@ module SigepWeb
|
|
20
20
|
senha: authenticate.password
|
21
21
|
}).to_hash[:solicita_etiquetas_response][:return]
|
22
22
|
|
23
|
-
|
23
|
+
{
|
24
|
+
success: true,
|
25
|
+
response: build_label_array(response)
|
26
|
+
}
|
24
27
|
rescue Savon::SOAPFault => msg
|
25
|
-
|
28
|
+
{
|
29
|
+
success: false,
|
30
|
+
error: msg
|
31
|
+
}
|
26
32
|
end
|
27
33
|
end
|
28
34
|
|
@@ -11,7 +11,7 @@ module SigepWeb
|
|
11
11
|
def request
|
12
12
|
authenticate = SigepWeb.configuration.authenticate
|
13
13
|
begin
|
14
|
-
process(:fecha_plp_varios_servicos, {
|
14
|
+
response = process(:fecha_plp_varios_servicos, {
|
15
15
|
xml: @plp.to_xml,
|
16
16
|
idPlpCliente: @id_plp_client,
|
17
17
|
cartaoPostagem: authenticate.card,
|
@@ -19,8 +19,16 @@ module SigepWeb
|
|
19
19
|
usuario: authenticate.user,
|
20
20
|
senha: authenticate.password
|
21
21
|
}).to_hash[:fecha_plp_varios_servicos_response][:return].to_s
|
22
|
+
|
23
|
+
{
|
24
|
+
success: true,
|
25
|
+
response: response
|
26
|
+
}
|
22
27
|
rescue Savon::SOAPFault => msg
|
23
|
-
|
28
|
+
{
|
29
|
+
success: false,
|
30
|
+
error: msg
|
31
|
+
}
|
24
32
|
end
|
25
33
|
end
|
26
34
|
end
|
@@ -14,11 +14,17 @@ module SigepWeb
|
|
14
14
|
idCartaoPostagem: @id_post_card,
|
15
15
|
usuario: authenticate.user,
|
16
16
|
senha: authenticate.password
|
17
|
-
})
|
17
|
+
}).to_hash[:busca_cliente_response][:return]
|
18
18
|
|
19
|
-
|
19
|
+
{
|
20
|
+
success: true,
|
21
|
+
response: response
|
22
|
+
}
|
20
23
|
rescue Savon::SOAPFault => msg
|
21
|
-
|
24
|
+
{
|
25
|
+
success: false,
|
26
|
+
error: msg
|
27
|
+
}
|
22
28
|
end
|
23
29
|
end
|
24
30
|
end
|
@@ -8,15 +8,27 @@ module SigepWeb
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def request
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
11
|
+
begin
|
12
|
+
authenticate = SigepWeb.configuration.authenticate
|
13
|
+
response = process(:verifica_disponibilidade_servico, {
|
14
|
+
codAdministrativo: authenticate.administrative_code,
|
15
|
+
numeroServico: @service_number,
|
16
|
+
cepOrigem: @source_zip,
|
17
|
+
cepDestino: @target_zip,
|
18
|
+
usuario: authenticate.user,
|
19
|
+
senha: authenticate.password
|
20
|
+
}).to_hash[:verifica_disponibilidade_servico_response][:return]
|
21
|
+
|
22
|
+
{
|
23
|
+
success: true,
|
24
|
+
response: response
|
25
|
+
}
|
26
|
+
rescue Savon::SOAPFault => msg
|
27
|
+
{
|
28
|
+
success: false,
|
29
|
+
error: msg
|
30
|
+
}
|
31
|
+
end
|
20
32
|
end
|
21
33
|
end
|
22
34
|
end
|
data/lib/sigep_web/version.rb
CHANGED
data/lib/sigep_web/zip_query.rb
CHANGED
@@ -11,9 +11,15 @@ module SigepWeb
|
|
11
11
|
cep: @zip
|
12
12
|
}).to_hash[:consulta_cep_response][:return]
|
13
13
|
|
14
|
-
|
14
|
+
{
|
15
|
+
success: true,
|
16
|
+
response: ApiResponse.new(response)
|
17
|
+
}
|
15
18
|
rescue Savon::SOAPFault => msg
|
16
|
-
|
19
|
+
{
|
20
|
+
success: false,
|
21
|
+
error: msg
|
22
|
+
}
|
17
23
|
end
|
18
24
|
end
|
19
25
|
end
|