correios_sigep 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/.rspec +3 -0
- data/.rubocop.yml +7 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +31 -0
- data/Rakefile +5 -0
- data/bin/rake +16 -0
- data/correios_sigep.gemspec +30 -0
- data/lib/correios_sigep.rb +38 -0
- data/lib/correios_sigep/builders/xml/authentication.rb +36 -0
- data/lib/correios_sigep/builders/xml/collect.rb +33 -0
- data/lib/correios_sigep/builders/xml/collect_objects.rb +25 -0
- data/lib/correios_sigep/builders/xml/product.rb +21 -0
- data/lib/correios_sigep/builders/xml/recipient.rb +30 -0
- data/lib/correios_sigep/builders/xml/request_collect_number.rb +16 -0
- data/lib/correios_sigep/builders/xml/sender.rb +34 -0
- data/lib/correios_sigep/configuration.rb +6 -0
- data/lib/correios_sigep/logistic_reverse/base_client.rb +32 -0
- data/lib/correios_sigep/logistic_reverse/request_collect_number.rb +53 -0
- data/lib/correios_sigep/models/collect.rb +27 -0
- data/lib/correios_sigep/models/correios_response_codes.rb +12 -0
- data/lib/correios_sigep/models/errors/collect_not_answered_for_the_zipcode.rb +8 -0
- data/lib/correios_sigep/models/errors/inexistent_zipcode.rb +8 -0
- data/lib/correios_sigep/models/errors/ticket_already_used.rb +8 -0
- data/lib/correios_sigep/models/errors/unavailable_house_collect.rb +8 -0
- data/lib/correios_sigep/models/errors/unavailable_service.rb +8 -0
- data/lib/correios_sigep/models/errors/unknown_error.rb +8 -0
- data/lib/correios_sigep/models/logistic_reverse.rb +23 -0
- data/lib/correios_sigep/models/object.rb +16 -0
- data/lib/correios_sigep/models/product.rb +14 -0
- data/lib/correios_sigep/models/recipient.rb +25 -0
- data/lib/correios_sigep/models/sender.rb +30 -0
- data/lib/correios_sigep/version.rb +3 -0
- data/spec/correios_sigep/builders/xml/request_collect_number_spec.rb +22 -0
- data/spec/correios_sigep/configuration_spec.rb +84 -0
- data/spec/correios_sigep/logistic_reverse/base_client_spec.rb +25 -0
- data/spec/correios_sigep/logistic_reverse/request_collect_number_spec.rb +101 -0
- data/spec/correios_sigep/models/collect_spec.rb +149 -0
- data/spec/correios_sigep/models/logistic_reverse_spec.rb +62 -0
- data/spec/correios_sigep/models/object_spec.rb +53 -0
- data/spec/correios_sigep/models/product_spec.rb +37 -0
- data/spec/correios_sigep/models/recipient_spec.rb +108 -0
- data/spec/correios_sigep/models/sender_spec.rb +141 -0
- data/spec/correios_sigep_spec.rb +41 -0
- data/spec/fixtures/correios/response_already_in_use.xml +14 -0
- data/spec/fixtures/correios/response_inexistent_zipcode.xml +14 -0
- data/spec/fixtures/correios/response_not_answered_for_zipcode.xml +14 -0
- data/spec/fixtures/correios/response_success.xml +27 -0
- data/spec/fixtures/correios/response_unavailable_house_collect.xml +14 -0
- data/spec/fixtures/correios/response_unavailable_service.xml +14 -0
- data/spec/fixtures/correios/response_unexpected.xml +14 -0
- data/spec/fixtures/correios/wsdl.xml +188 -0
- data/spec/spec_helper.rb +38 -0
- data/spec/support/fixture_helper.rb +5 -0
- data/spec/support/logistic_reverse_helper.rb +15 -0
- metadata +240 -0
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe CorreiosSigep do
|
4
|
+
describe '#configure' do
|
5
|
+
subject { described_class.configuration }
|
6
|
+
before do
|
7
|
+
described_class.configure do |config|
|
8
|
+
config.user = '60618043'
|
9
|
+
config.password = '8o8otn'
|
10
|
+
config.administrative_code = '08082650'
|
11
|
+
config.card = '0057018901'
|
12
|
+
config.contract = '9912208555'
|
13
|
+
config.service_code = '41076'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
it 'configures the correct user' do
|
17
|
+
expect(subject.user).to eq '60618043'
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'configures the correct password' do
|
21
|
+
expect(subject.password).to eq '8o8otn'
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'configures the correct administrative code' do
|
25
|
+
expect(subject.administrative_code).to eq '08082650'
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'configures the correct card' do
|
29
|
+
expect(subject.card).to eq '0057018901'
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'configures the correct contract' do
|
33
|
+
expect(subject.contract).to eq '9912208555'
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'configures the correct service_code' do
|
37
|
+
expect(subject.service_code).to eq '41076'
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
|
3
|
+
<S:Body>
|
4
|
+
<ns2:solicitarPostagemReversaResponse xmlns:ns2="http://webservice.scol.correios.com.br/">
|
5
|
+
<return>
|
6
|
+
<status_processamento>00</status_processamento>
|
7
|
+
<data_processamento>30/03/2014</data_processamento>
|
8
|
+
<hora_processamento>13:05</hora_processamento>
|
9
|
+
<cod_erro>195</cod_erro>
|
10
|
+
<msg_erro>NMERO DE E-TICKET J UTILIZADO (427222673)</msg_erro>
|
11
|
+
</return>
|
12
|
+
</ns2:solicitarPostagemReversaResponse>
|
13
|
+
</S:Body>
|
14
|
+
</S:Envelope>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
|
3
|
+
<S:Body>
|
4
|
+
<ns2:solicitarPostagemReversaResponse xmlns:ns2="http://webservice.scol.correios.com.br/">
|
5
|
+
<return>
|
6
|
+
<status_processamento>00</status_processamento>
|
7
|
+
<data_processamento>04/04/2014</data_processamento>
|
8
|
+
<hora_processamento>15:02</hora_processamento>
|
9
|
+
<cod_erro>113</cod_erro>
|
10
|
+
<msg_erro>CEP DO DESTINATRIO INEXISTENTE (07760000)</msg_erro>
|
11
|
+
</return>
|
12
|
+
</ns2:solicitarPostagemReversaResponse>
|
13
|
+
</S:Body>
|
14
|
+
</S:Envelope>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
|
3
|
+
<S:Body>
|
4
|
+
<ns2:solicitarPostagemReversaResponse xmlns:ns2="http://webservice.scol.correios.com.br/">
|
5
|
+
<return>
|
6
|
+
<status_processamento>00</status_processamento>
|
7
|
+
<data_processamento>09/04/2014</data_processamento>
|
8
|
+
<hora_processamento>11:42</hora_processamento>
|
9
|
+
<cod_erro>117</cod_erro>
|
10
|
+
<msg_erro>CEP DO REMETENTE INEXISTENTE (88900000)</msg_erro>
|
11
|
+
</return>
|
12
|
+
</ns2:solicitarPostagemReversaResponse>
|
13
|
+
</S:Body>
|
14
|
+
</S:Envelope>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
|
3
|
+
<S:Body>
|
4
|
+
<ns2:solicitarPostagemReversaResponse xmlns:ns2="http://webservice.scol.correios.com.br/">
|
5
|
+
<return>
|
6
|
+
<status_processamento>01</status_processamento>
|
7
|
+
<data_processamento>28/03/2014</data_processamento>
|
8
|
+
<hora_processamento>11:14</hora_processamento>
|
9
|
+
<cod_erro>00</cod_erro>
|
10
|
+
<msg_erro/>
|
11
|
+
<resultado_solicitacao>
|
12
|
+
<tipo>A</tipo>
|
13
|
+
<id_cliente>2102774</id_cliente>
|
14
|
+
<numero_coleta>373533437</numero_coleta>
|
15
|
+
<numero_etiqueta/>
|
16
|
+
<id_obj>2102774</id_obj>
|
17
|
+
<status_objeto>01</status_objeto>
|
18
|
+
<prazo>07/04/2014</prazo>
|
19
|
+
<data_solicitacao>28/03/2014</data_solicitacao>
|
20
|
+
<hora_solicitacao>11:14</hora_solicitacao>
|
21
|
+
<codigo_erro>0</codigo_erro>
|
22
|
+
<descricao_erro/>
|
23
|
+
</resultado_solicitacao>
|
24
|
+
</return>
|
25
|
+
</ns2:solicitarPostagemReversaResponse>
|
26
|
+
</S:Body>
|
27
|
+
</S:Envelope>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
|
3
|
+
<S:Body>
|
4
|
+
<ns2:solicitarPostagemReversaResponse xmlns:ns2="http://webservice.scol.correios.com.br/">
|
5
|
+
<return>
|
6
|
+
<status_processamento>00</status_processamento>
|
7
|
+
<data_processamento>26/06/2014</data_processamento>
|
8
|
+
<hora_processamento>16:03</hora_processamento>
|
9
|
+
<cod_erro>111</cod_erro>
|
10
|
+
<msg_erro>COLETA DOMICILIAR NO DISPONVEL PARA ESSA LOCALIDADE (07776900)</msg_erro>
|
11
|
+
</return>
|
12
|
+
</ns2:solicitarPostagemReversaResponse>
|
13
|
+
</S:Body>
|
14
|
+
</S:Envelope>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
|
3
|
+
<S:Body>
|
4
|
+
<ns2:solicitarPostagemReversaResponse xmlns:ns2="http://webservice.scol.correios.com.br/">
|
5
|
+
<return>
|
6
|
+
<status_processamento>00</status_processamento>
|
7
|
+
<data_processamento>09/04/2014</data_processamento>
|
8
|
+
<hora_processamento>14:22</hora_processamento>
|
9
|
+
<cod_erro>210</cod_erro>
|
10
|
+
<msg_erro>SERVIO INDISPONVEL NO MOMENTO </msg_erro>
|
11
|
+
</return>
|
12
|
+
</ns2:solicitarPostagemReversaResponse>
|
13
|
+
</S:Body>
|
14
|
+
</S:Envelope>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
|
3
|
+
<S:Body>
|
4
|
+
<ns2:solicitarPostagemReversaResponse xmlns:ns2="http://webservice.scol.correios.com.br/">
|
5
|
+
<return>
|
6
|
+
<status_processamento>66</status_processamento>
|
7
|
+
<data_processamento>30/03/2014</data_processamento>
|
8
|
+
<hora_processamento>13:05</hora_processamento>
|
9
|
+
<cod_erro>7657643786578436675843</cod_erro>
|
10
|
+
<msg_erro>NMERO DE E-TICKET J UTILIZADO (427222673)</msg_erro>
|
11
|
+
</return>
|
12
|
+
</ns2:solicitarPostagemReversaResponse>
|
13
|
+
</S:Body>
|
14
|
+
</S:Envelope>
|
@@ -0,0 +1,188 @@
|
|
1
|
+
<?xml version='1.0' encoding='UTF-8'?><!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Oracle JAX-WS 2.1.5. --><!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Oracle JAX-WS 2.1.5. --><definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://webservice.scol.correios.com.br/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://webservice.scol.correios.com.br/" name="WebServiceScol">
|
2
|
+
<types>
|
3
|
+
<xsd:schema>
|
4
|
+
<xsd:import namespace="http://webservice.scol.correios.com.br/" schemaLocation="http://webservicescolhomologacao.correios.com.br:80/ScolWeb/WebServiceScol?xsd=1"/>
|
5
|
+
</xsd:schema>
|
6
|
+
</types>
|
7
|
+
<message name="solicitarPostagem">
|
8
|
+
<part name="parameters" element="tns:solicitarPostagem"/>
|
9
|
+
</message>
|
10
|
+
<message name="solicitarPostagemResponse">
|
11
|
+
<part name="parameters" element="tns:solicitarPostagemResponse"/>
|
12
|
+
</message>
|
13
|
+
<message name="solicitarPostagemReversa">
|
14
|
+
<part name="parameters" element="tns:solicitarPostagemReversa"/>
|
15
|
+
</message>
|
16
|
+
<message name="solicitarPostagemReversaResponse">
|
17
|
+
<part name="parameters" element="tns:solicitarPostagemReversaResponse"/>
|
18
|
+
</message>
|
19
|
+
<message name="solicitarPostagemSimultanea">
|
20
|
+
<part name="parameters" element="tns:solicitarPostagemSimultanea"/>
|
21
|
+
</message>
|
22
|
+
<message name="solicitarPostagemSimultaneaResponse">
|
23
|
+
<part name="parameters" element="tns:solicitarPostagemSimultaneaResponse"/>
|
24
|
+
</message>
|
25
|
+
<message name="cancelarPedido">
|
26
|
+
<part name="parameters" element="tns:cancelarPedido"/>
|
27
|
+
</message>
|
28
|
+
<message name="cancelarPedidoResponse">
|
29
|
+
<part name="parameters" element="tns:cancelarPedidoResponse"/>
|
30
|
+
</message>
|
31
|
+
<message name="acompanharPedido">
|
32
|
+
<part name="parameters" element="tns:acompanharPedido"/>
|
33
|
+
</message>
|
34
|
+
<message name="acompanharPedidoResponse">
|
35
|
+
<part name="parameters" element="tns:acompanharPedidoResponse"/>
|
36
|
+
</message>
|
37
|
+
<message name="validarPostagemSimultanea">
|
38
|
+
<part name="parameters" element="tns:validarPostagemSimultanea"/>
|
39
|
+
</message>
|
40
|
+
<message name="validarPostagemSimultaneaResponse">
|
41
|
+
<part name="parameters" element="tns:validarPostagemSimultaneaResponse"/>
|
42
|
+
</message>
|
43
|
+
<message name="validarPostagemReversa">
|
44
|
+
<part name="parameters" element="tns:validarPostagemReversa"/>
|
45
|
+
</message>
|
46
|
+
<message name="validarPostagemReversaResponse">
|
47
|
+
<part name="parameters" element="tns:validarPostagemReversaResponse"/>
|
48
|
+
</message>
|
49
|
+
<message name="calcularDigitoVerificador">
|
50
|
+
<part name="parameters" element="tns:calcularDigitoVerificador"/>
|
51
|
+
</message>
|
52
|
+
<message name="calcularDigitoVerificadorResponse">
|
53
|
+
<part name="parameters" element="tns:calcularDigitoVerificadorResponse"/>
|
54
|
+
</message>
|
55
|
+
<message name="solicitarRange">
|
56
|
+
<part name="parameters" element="tns:solicitarRange"/>
|
57
|
+
</message>
|
58
|
+
<message name="solicitarRangeResponse">
|
59
|
+
<part name="parameters" element="tns:solicitarRangeResponse"/>
|
60
|
+
</message>
|
61
|
+
<portType name="WebServiceScol">
|
62
|
+
<operation name="solicitarPostagem">
|
63
|
+
<input message="tns:solicitarPostagem"/>
|
64
|
+
<output message="tns:solicitarPostagemResponse"/>
|
65
|
+
</operation>
|
66
|
+
<operation name="solicitarPostagemReversa">
|
67
|
+
<input message="tns:solicitarPostagemReversa"/>
|
68
|
+
<output message="tns:solicitarPostagemReversaResponse"/>
|
69
|
+
</operation>
|
70
|
+
<operation name="solicitarPostagemSimultanea">
|
71
|
+
<input message="tns:solicitarPostagemSimultanea"/>
|
72
|
+
<output message="tns:solicitarPostagemSimultaneaResponse"/>
|
73
|
+
</operation>
|
74
|
+
<operation name="cancelarPedido">
|
75
|
+
<input message="tns:cancelarPedido"/>
|
76
|
+
<output message="tns:cancelarPedidoResponse"/>
|
77
|
+
</operation>
|
78
|
+
<operation name="acompanharPedido">
|
79
|
+
<input message="tns:acompanharPedido"/>
|
80
|
+
<output message="tns:acompanharPedidoResponse"/>
|
81
|
+
</operation>
|
82
|
+
<operation name="validarPostagemSimultanea">
|
83
|
+
<input message="tns:validarPostagemSimultanea"/>
|
84
|
+
<output message="tns:validarPostagemSimultaneaResponse"/>
|
85
|
+
</operation>
|
86
|
+
<operation name="validarPostagemReversa">
|
87
|
+
<input message="tns:validarPostagemReversa"/>
|
88
|
+
<output message="tns:validarPostagemReversaResponse"/>
|
89
|
+
</operation>
|
90
|
+
<operation name="calcularDigitoVerificador">
|
91
|
+
<input message="tns:calcularDigitoVerificador"/>
|
92
|
+
<output message="tns:calcularDigitoVerificadorResponse"/>
|
93
|
+
</operation>
|
94
|
+
<operation name="solicitarRange">
|
95
|
+
<input message="tns:solicitarRange"/>
|
96
|
+
<output message="tns:solicitarRangeResponse"/>
|
97
|
+
</operation>
|
98
|
+
</portType>
|
99
|
+
<binding name="WebServiceScolPortBinding" type="tns:WebServiceScol">
|
100
|
+
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
|
101
|
+
<operation name="solicitarPostagem">
|
102
|
+
<soap:operation soapAction=""/>
|
103
|
+
<input>
|
104
|
+
<soap:body use="literal"/>
|
105
|
+
</input>
|
106
|
+
<output>
|
107
|
+
<soap:body use="literal"/>
|
108
|
+
</output>
|
109
|
+
</operation>
|
110
|
+
<operation name="solicitarPostagemReversa">
|
111
|
+
<soap:operation soapAction=""/>
|
112
|
+
<input>
|
113
|
+
<soap:body use="literal"/>
|
114
|
+
</input>
|
115
|
+
<output>
|
116
|
+
<soap:body use="literal"/>
|
117
|
+
</output>
|
118
|
+
</operation>
|
119
|
+
<operation name="solicitarPostagemSimultanea">
|
120
|
+
<soap:operation soapAction=""/>
|
121
|
+
<input>
|
122
|
+
<soap:body use="literal"/>
|
123
|
+
</input>
|
124
|
+
<output>
|
125
|
+
<soap:body use="literal"/>
|
126
|
+
</output>
|
127
|
+
</operation>
|
128
|
+
<operation name="cancelarPedido">
|
129
|
+
<soap:operation soapAction=""/>
|
130
|
+
<input>
|
131
|
+
<soap:body use="literal"/>
|
132
|
+
</input>
|
133
|
+
<output>
|
134
|
+
<soap:body use="literal"/>
|
135
|
+
</output>
|
136
|
+
</operation>
|
137
|
+
<operation name="acompanharPedido">
|
138
|
+
<soap:operation soapAction=""/>
|
139
|
+
<input>
|
140
|
+
<soap:body use="literal"/>
|
141
|
+
</input>
|
142
|
+
<output>
|
143
|
+
<soap:body use="literal"/>
|
144
|
+
</output>
|
145
|
+
</operation>
|
146
|
+
<operation name="validarPostagemSimultanea">
|
147
|
+
<soap:operation soapAction=""/>
|
148
|
+
<input>
|
149
|
+
<soap:body use="literal"/>
|
150
|
+
</input>
|
151
|
+
<output>
|
152
|
+
<soap:body use="literal"/>
|
153
|
+
</output>
|
154
|
+
</operation>
|
155
|
+
<operation name="validarPostagemReversa">
|
156
|
+
<soap:operation soapAction=""/>
|
157
|
+
<input>
|
158
|
+
<soap:body use="literal"/>
|
159
|
+
</input>
|
160
|
+
<output>
|
161
|
+
<soap:body use="literal"/>
|
162
|
+
</output>
|
163
|
+
</operation>
|
164
|
+
<operation name="calcularDigitoVerificador">
|
165
|
+
<soap:operation soapAction=""/>
|
166
|
+
<input>
|
167
|
+
<soap:body use="literal"/>
|
168
|
+
</input>
|
169
|
+
<output>
|
170
|
+
<soap:body use="literal"/>
|
171
|
+
</output>
|
172
|
+
</operation>
|
173
|
+
<operation name="solicitarRange">
|
174
|
+
<soap:operation soapAction=""/>
|
175
|
+
<input>
|
176
|
+
<soap:body use="literal"/>
|
177
|
+
</input>
|
178
|
+
<output>
|
179
|
+
<soap:body use="literal"/>
|
180
|
+
</output>
|
181
|
+
</operation>
|
182
|
+
</binding>
|
183
|
+
<service name="WebServiceScol">
|
184
|
+
<port name="WebServiceScolPort" binding="tns:WebServiceScolPortBinding">
|
185
|
+
<soap:address location="http://webservicescolhomologacao.correios.com.br:80/ScolWeb/WebServiceScol"/>
|
186
|
+
</port>
|
187
|
+
</service>
|
188
|
+
</definitions>
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
ENV['GEM_ENV'] = 'test'
|
2
|
+
require 'simplecov'
|
3
|
+
require 'support/logistic_reverse_helper'
|
4
|
+
require 'support/fixture_helper'
|
5
|
+
require 'webmock/rspec'
|
6
|
+
require 'pry'
|
7
|
+
|
8
|
+
File.expand_path(File.dirname(File.dirname(__FILE__)))
|
9
|
+
|
10
|
+
SimpleCov.start do
|
11
|
+
add_filter "/spec/"
|
12
|
+
end
|
13
|
+
|
14
|
+
require 'correios_sigep'
|
15
|
+
|
16
|
+
RSpec.configure do |config|
|
17
|
+
config.expect_with :rspec do |expectations|
|
18
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
19
|
+
end
|
20
|
+
|
21
|
+
config.mock_with :rspec do |mocks|
|
22
|
+
mocks.verify_partial_doubles = true
|
23
|
+
end
|
24
|
+
|
25
|
+
config.include LogisticReverseHelper
|
26
|
+
config.include FixtureHelper
|
27
|
+
|
28
|
+
config.before do
|
29
|
+
CorreiosSigep.configure do |config|
|
30
|
+
config.user = '60618043'
|
31
|
+
config.password = '8o8otn'
|
32
|
+
config.administrative_code = '08082650'
|
33
|
+
config.card = '0057018901'
|
34
|
+
config.contract = '9912208555'
|
35
|
+
config.service_code = '41076'
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module LogisticReverseHelper
|
2
|
+
def seed_logistic_reverse(logistic_reverse)
|
3
|
+
recipient = CorreiosSigep::Models::Recipient.new(name: "ESTABELECIMENT W*M", address: "ESTRADA DE ACESSO A JANDIRA", number: 1400, complement: "G4", neighborhood: "FAZENDA ITAQUI", reference: "REFERENCE", city: "BARUERI", state: "SP", postal_code: "06442130", area_code: 11, phone: "21683228", email: "teste@example.com")
|
4
|
+
|
5
|
+
sender = CorreiosSigep::Models::Sender.new(name: "JEFERSON VAZ DOS SANTOS", address: "RUA BLA BLA BLA", number: 666, complement: "APT 100", neighborhood: "PINHEIROS", city: "SÃO PAULO", state: "SP", postal_code: "05427020", reference: "REFERENCE", area_code: 16, phone: "41606809", email: "jeff@example.com")
|
6
|
+
object1 = CorreiosSigep::Models::Object.new(item: "127078", id: "1405670", description: "Pen Drive SAndisk 16GB SDCZ50-016G-A95", ship: "ship", num: 1)
|
7
|
+
object2 = CorreiosSigep::Models::Object.new(item: "277574", id: "1405670", description: "Chip unico claro Pre pago", ship: "ship", num: 2)
|
8
|
+
product = CorreiosSigep::Models::Product.new(code: "code", type: "type", quantity: 3)
|
9
|
+
|
10
|
+
collect = CorreiosSigep::Models::Collect.new(type: "CA", number: 1, client_id: "1405670", ag: "1", card: "1234", declared_value: "100.5", aditional_service: "20.5", description: "teste", ar: "2", checklist: "cklist", sender: sender, objects: [object1, object2], product: product)
|
11
|
+
|
12
|
+
logistic_reverse.recipient = recipient
|
13
|
+
logistic_reverse.collect = collect
|
14
|
+
end
|
15
|
+
end
|
metadata
ADDED
@@ -0,0 +1,240 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: correios_sigep
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Carlos Ribeiro
|
8
|
+
- Felipe Gentil
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2015-03-02 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: savon
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '2.0'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '2.0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: bundler
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '1.7'
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "~>"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '1.7'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: pry-meta
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - "~>"
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 0.0.10
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - "~>"
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 0.0.10
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: rake
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '10.0'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '10.0'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: rspec
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - "~>"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '3.0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - "~>"
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '3.0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: rubocop
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - "~>"
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0.29'
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - "~>"
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0.29'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: simplecov
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - "~>"
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0.9'
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - "~>"
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0.9'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: webmock
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - "~>"
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '1.0'
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - "~>"
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '1.0'
|
126
|
+
description: An integration with Correios SIGEP WEB system (http://www.correios.com.br/para-sua-empresa/encomendas/sigep-web)
|
127
|
+
email:
|
128
|
+
- duduribeiro.gba@gmail.com
|
129
|
+
- mail@carlosribeiro.me
|
130
|
+
- cdigentil@gmail.com
|
131
|
+
executables:
|
132
|
+
- rake
|
133
|
+
extensions: []
|
134
|
+
extra_rdoc_files: []
|
135
|
+
files:
|
136
|
+
- ".gitignore"
|
137
|
+
- ".rspec"
|
138
|
+
- ".rubocop.yml"
|
139
|
+
- ".ruby-gemset"
|
140
|
+
- ".ruby-version"
|
141
|
+
- Gemfile
|
142
|
+
- LICENSE.txt
|
143
|
+
- README.md
|
144
|
+
- Rakefile
|
145
|
+
- bin/rake
|
146
|
+
- correios_sigep.gemspec
|
147
|
+
- lib/correios_sigep.rb
|
148
|
+
- lib/correios_sigep/builders/xml/authentication.rb
|
149
|
+
- lib/correios_sigep/builders/xml/collect.rb
|
150
|
+
- lib/correios_sigep/builders/xml/collect_objects.rb
|
151
|
+
- lib/correios_sigep/builders/xml/product.rb
|
152
|
+
- lib/correios_sigep/builders/xml/recipient.rb
|
153
|
+
- lib/correios_sigep/builders/xml/request_collect_number.rb
|
154
|
+
- lib/correios_sigep/builders/xml/sender.rb
|
155
|
+
- lib/correios_sigep/configuration.rb
|
156
|
+
- lib/correios_sigep/logistic_reverse/base_client.rb
|
157
|
+
- lib/correios_sigep/logistic_reverse/request_collect_number.rb
|
158
|
+
- lib/correios_sigep/models/collect.rb
|
159
|
+
- lib/correios_sigep/models/correios_response_codes.rb
|
160
|
+
- lib/correios_sigep/models/errors/collect_not_answered_for_the_zipcode.rb
|
161
|
+
- lib/correios_sigep/models/errors/inexistent_zipcode.rb
|
162
|
+
- lib/correios_sigep/models/errors/ticket_already_used.rb
|
163
|
+
- lib/correios_sigep/models/errors/unavailable_house_collect.rb
|
164
|
+
- lib/correios_sigep/models/errors/unavailable_service.rb
|
165
|
+
- lib/correios_sigep/models/errors/unknown_error.rb
|
166
|
+
- lib/correios_sigep/models/logistic_reverse.rb
|
167
|
+
- lib/correios_sigep/models/object.rb
|
168
|
+
- lib/correios_sigep/models/product.rb
|
169
|
+
- lib/correios_sigep/models/recipient.rb
|
170
|
+
- lib/correios_sigep/models/sender.rb
|
171
|
+
- lib/correios_sigep/version.rb
|
172
|
+
- spec/correios_sigep/builders/xml/request_collect_number_spec.rb
|
173
|
+
- spec/correios_sigep/configuration_spec.rb
|
174
|
+
- spec/correios_sigep/logistic_reverse/base_client_spec.rb
|
175
|
+
- spec/correios_sigep/logistic_reverse/request_collect_number_spec.rb
|
176
|
+
- spec/correios_sigep/models/collect_spec.rb
|
177
|
+
- spec/correios_sigep/models/logistic_reverse_spec.rb
|
178
|
+
- spec/correios_sigep/models/object_spec.rb
|
179
|
+
- spec/correios_sigep/models/product_spec.rb
|
180
|
+
- spec/correios_sigep/models/recipient_spec.rb
|
181
|
+
- spec/correios_sigep/models/sender_spec.rb
|
182
|
+
- spec/correios_sigep_spec.rb
|
183
|
+
- spec/fixtures/correios/response_already_in_use.xml
|
184
|
+
- spec/fixtures/correios/response_inexistent_zipcode.xml
|
185
|
+
- spec/fixtures/correios/response_not_answered_for_zipcode.xml
|
186
|
+
- spec/fixtures/correios/response_success.xml
|
187
|
+
- spec/fixtures/correios/response_unavailable_house_collect.xml
|
188
|
+
- spec/fixtures/correios/response_unavailable_service.xml
|
189
|
+
- spec/fixtures/correios/response_unexpected.xml
|
190
|
+
- spec/fixtures/correios/wsdl.xml
|
191
|
+
- spec/spec_helper.rb
|
192
|
+
- spec/support/fixture_helper.rb
|
193
|
+
- spec/support/logistic_reverse_helper.rb
|
194
|
+
homepage: ''
|
195
|
+
licenses:
|
196
|
+
- MIT
|
197
|
+
metadata: {}
|
198
|
+
post_install_message:
|
199
|
+
rdoc_options: []
|
200
|
+
require_paths:
|
201
|
+
- lib
|
202
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
203
|
+
requirements:
|
204
|
+
- - ">="
|
205
|
+
- !ruby/object:Gem::Version
|
206
|
+
version: '0'
|
207
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
208
|
+
requirements:
|
209
|
+
- - ">="
|
210
|
+
- !ruby/object:Gem::Version
|
211
|
+
version: '0'
|
212
|
+
requirements: []
|
213
|
+
rubyforge_project:
|
214
|
+
rubygems_version: 2.4.3
|
215
|
+
signing_key:
|
216
|
+
specification_version: 4
|
217
|
+
summary: A gem that integrates with Correios SIGEP WEB.
|
218
|
+
test_files:
|
219
|
+
- spec/correios_sigep/builders/xml/request_collect_number_spec.rb
|
220
|
+
- spec/correios_sigep/configuration_spec.rb
|
221
|
+
- spec/correios_sigep/logistic_reverse/base_client_spec.rb
|
222
|
+
- spec/correios_sigep/logistic_reverse/request_collect_number_spec.rb
|
223
|
+
- spec/correios_sigep/models/collect_spec.rb
|
224
|
+
- spec/correios_sigep/models/logistic_reverse_spec.rb
|
225
|
+
- spec/correios_sigep/models/object_spec.rb
|
226
|
+
- spec/correios_sigep/models/product_spec.rb
|
227
|
+
- spec/correios_sigep/models/recipient_spec.rb
|
228
|
+
- spec/correios_sigep/models/sender_spec.rb
|
229
|
+
- spec/correios_sigep_spec.rb
|
230
|
+
- spec/fixtures/correios/response_already_in_use.xml
|
231
|
+
- spec/fixtures/correios/response_inexistent_zipcode.xml
|
232
|
+
- spec/fixtures/correios/response_not_answered_for_zipcode.xml
|
233
|
+
- spec/fixtures/correios/response_success.xml
|
234
|
+
- spec/fixtures/correios/response_unavailable_house_collect.xml
|
235
|
+
- spec/fixtures/correios/response_unavailable_service.xml
|
236
|
+
- spec/fixtures/correios/response_unexpected.xml
|
237
|
+
- spec/fixtures/correios/wsdl.xml
|
238
|
+
- spec/spec_helper.rb
|
239
|
+
- spec/support/fixture_helper.rb
|
240
|
+
- spec/support/logistic_reverse_helper.rb
|