nfse-carioca 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/lib/nfse_carioca.rb +4 -0
- data/lib/nfse_carioca/gerar_nfse.rb +4 -0
- data/lib/nfse_carioca/gerar_nfse_xml.rb +121 -85
- data/lib/nfse_carioca/version.rb +1 -1
- data/nfse_carioca.gemspec +3 -2
- data/spec/fixtures/vcr_cassettes/NFSeCarioca_CancelarNFSe/_execute_/when_NFSeCarioca_rps_number_does_not_exist/returns_error_message.yml +4 -4
- data/spec/fixtures/vcr_cassettes/NFSeCarioca_CancelarNFSe/_execute_/when_NFSeCarioca_rps_number_does_not_exist/returns_false.yml +4 -4
- data/spec/fixtures/vcr_cassettes/NFSeCarioca_CancelarNFSe/_execute_/when_NFSeCarioca_rps_number_exist/returns_false.yml +8 -8
- data/spec/fixtures/vcr_cassettes/NFSeCarioca_GerarNFSe/_call/when_NFSeCarioca_rps_number_already_exist/responds_with_error.yml +14 -66
- data/spec/fixtures/vcr_cassettes/NFSeCarioca_GerarNFSe/_call/when_NFSeCarioca_rps_number_already_exist/responds_with_error_code_E10_.yml +248 -0
- data/spec/fixtures/vcr_cassettes/NFSeCarioca_GerarNFSe/_call/when_NFSeCarioca_rps_number_already_exist/responds_with_error_message_E10_.yml +248 -0
- data/spec/fixtures/vcr_cassettes/NFSeCarioca_GerarNFSe/_call/when_NFSeCarioca_rps_number_already_exist/responds_with_message_error_E10_.yml +14 -66
- data/spec/fixtures/vcr_cassettes/NFSeCarioca_GerarNFSe/_call/when_NFSeCarioca_rps_number_does_not_exist_yet/generates_NFSeCarioca.yml +22 -74
- data/spec/fixtures/vcr_cassettes/NFSeCarioca_GerarNFSe/_call/when_NfseCarioca_has_only_the_minimum_values/generates_NfseCarioca.yml +20 -59
- data/spec/lib/nfse_carioca/cancelar_nfse_spec.rb +1 -9
- data/spec/lib/nfse_carioca/gerar_nfse_spec.rb +58 -52
- data/spec/spec_helper.rb +17 -0
- metadata +23 -8
- data/spec/support/helpers.rb +0 -21
@@ -31,7 +31,7 @@ http_interactions:
|
|
31
31
|
X-Powered-By:
|
32
32
|
- ASP.NET
|
33
33
|
Date:
|
34
|
-
-
|
34
|
+
- Mon, 13 Apr 2015 20:45:43 GMT
|
35
35
|
Content-Length:
|
36
36
|
- '1338'
|
37
37
|
body:
|
@@ -169,80 +169,28 @@ http_interactions:
|
|
169
169
|
\ <soap:address location=\"https://homologacao.notacarioca.rio.gov.br/WSNacional/nfse.asmx\"
|
170
170
|
/>\r\n </wsdl:port>\r\n </wsdl:service>\r\n</wsdl:definitions>"
|
171
171
|
http_version:
|
172
|
-
recorded_at:
|
172
|
+
recorded_at: Mon, 13 Apr 2015 20:45:42 GMT
|
173
173
|
- request:
|
174
174
|
method: post
|
175
175
|
uri: https://homologacao.notacarioca.rio.gov.br/WSNacional/nfse.asmx
|
176
176
|
body:
|
177
177
|
encoding: UTF-8
|
178
|
-
string:
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
</IdentificacaoRps>
|
188
|
-
<DataEmissao>2015-02-05T17:59:02</DataEmissao>
|
189
|
-
<NaturezaOperacao>1</NaturezaOperacao>
|
190
|
-
<OptanteSimplesNacional>1</OptanteSimplesNacional>
|
191
|
-
<IncentivadorCultural>2</IncentivadorCultural>
|
192
|
-
<Status>1</Status>
|
193
|
-
<Servico>
|
194
|
-
<Valores>
|
195
|
-
<ValorServicos>12.0</ValorServicos>
|
196
|
-
<ValorPis>0</ValorPis>
|
197
|
-
<ValorCofins>0</ValorCofins>
|
198
|
-
<ValorInss>0</ValorInss>
|
199
|
-
<ValorIr>0</ValorIr>
|
200
|
-
<ValorCsll>0</ValorCsll>
|
201
|
-
<IssRetido>2</IssRetido>
|
202
|
-
<ValorIss>0</ValorIss>
|
203
|
-
<Aliquota>0</Aliquota>
|
204
|
-
</Valores>
|
205
|
-
<ItemListaServico>0105</ItemListaServico>
|
206
|
-
<CodigoTributacaoMunicipio>010501</CodigoTributacaoMunicipio>
|
207
|
-
<Discriminacao>Venda do Serviço XYZ.</Discriminacao>
|
208
|
-
<CodigoMunicipio>3304557</CodigoMunicipio>
|
209
|
-
</Servico>
|
210
|
-
<Prestador>
|
211
|
-
<Cnpj>12390095000186</Cnpj>
|
212
|
-
<InscricaoMunicipal>04807995</InscricaoMunicipal>
|
213
|
-
</Prestador>
|
214
|
-
<Tomador>
|
215
|
-
<IdentificacaoTomador>
|
216
|
-
<CpfCnpj>
|
217
|
-
<Cnpj>98924674000187</Cnpj>
|
218
|
-
</CpfCnpj>
|
219
|
-
</IdentificacaoTomador>
|
220
|
-
<RazaoSocial>XPTO Tecnologia Ltda.</RazaoSocial>
|
221
|
-
<Endereco>
|
222
|
-
<Endereco>Rua qualquer nome</Endereco>
|
223
|
-
<Numero>33</Numero>
|
224
|
-
<Complemento>Sala 1</Complemento>
|
225
|
-
<Bairro>Seu bairro</Bairro>
|
226
|
-
<CodigoMunicipio>3550308</CodigoMunicipio>
|
227
|
-
<Uf>SP</Uf>
|
228
|
-
<Cep>22255777</Cep>
|
229
|
-
</Endereco>
|
230
|
-
<Contato>
|
231
|
-
<Telefone>2222-2222</Telefone>
|
232
|
-
<Email>customer@example.com</Email>
|
233
|
-
</Contato>
|
234
|
-
</Tomador>
|
235
|
-
</InfRps>
|
236
|
-
</Rps>
|
237
|
-
</GerarNfseEnvio>
|
238
|
-
</inputXML></GerarNfseRequest></soap:Body></soap:Envelope>
|
178
|
+
string: <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
179
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://notacarioca.rio.gov.br/"
|
180
|
+
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><GerarNfseRequest><inputXML><GerarNfseEnvio
|
181
|
+
xmlns="http://notacarioca.rio.gov.br/WSNacional/XSD/1/nfse_pcrj_v01.xsd"><Rps><InfRps
|
182
|
+
xmlns="http://www.abrasf.org.br/ABRASF/arquivos/nfse.xsd" Id="1030"><IdentificacaoRps><Numero>1030</Numero><Serie>A</Serie><Tipo>1</Tipo></IdentificacaoRps><DataEmissao>2015-04-13T17:45:36</DataEmissao><NaturezaOperacao>1</NaturezaOperacao><OptanteSimplesNacional>1</OptanteSimplesNacional><IncentivadorCultural>2</IncentivadorCultural><Status>1</Status><Servico><Valores><ValorServicos>12.0</ValorServicos><ValorPis>0</ValorPis><ValorCofins>0</ValorCofins><ValorInss>0</ValorInss><ValorIr>0</ValorIr><ValorCsll>0</ValorCsll><IssRetido>2</IssRetido><ValorIss>0</ValorIss><Aliquota>0</Aliquota></Valores><ItemListaServico>0105</ItemListaServico><CodigoTributacaoMunicipio>010501</CodigoTributacaoMunicipio><Discriminacao>Venda
|
183
|
+
do Serviço XYZ.</Discriminacao><CodigoMunicipio>3304557</CodigoMunicipio></Servico><Prestador><Cnpj>12390095000186</Cnpj><InscricaoMunicipal>04807995</InscricaoMunicipal></Prestador><Tomador><IdentificacaoTomador><CpfCnpj><Cnpj>98924674000187</Cnpj></CpfCnpj></IdentificacaoTomador><RazaoSocial>XPTO
|
184
|
+
Tecnologia Ltda.</RazaoSocial><Endereco><Endereco>Rua qualquer
|
185
|
+
nome</Endereco><Numero>33</Numero><Complemento>Sala
|
186
|
+
1</Complemento><Bairro>Seu bairro</Bairro><CodigoMunicipio>3550308</CodigoMunicipio><Uf>SP</Uf><Cep>22255777</Cep></Endereco><Contato><Telefone>2222-2222</Telefone><Email>customer@example.com</Email></Contato></Tomador></InfRps></Rps></GerarNfseEnvio></inputXML></GerarNfseRequest></soap:Body></soap:Envelope>
|
239
187
|
headers:
|
240
188
|
Soapaction:
|
241
189
|
- '"http://notacarioca.rio.gov.br/GerarNfse"'
|
242
190
|
Content-Type:
|
243
191
|
- text/xml;charset=UTF-8
|
244
192
|
Content-Length:
|
245
|
-
- '
|
193
|
+
- '2420'
|
246
194
|
Accept-Encoding:
|
247
195
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
248
196
|
Accept:
|
@@ -267,7 +215,7 @@ http_interactions:
|
|
267
215
|
X-Powered-By:
|
268
216
|
- ASP.NET
|
269
217
|
Date:
|
270
|
-
-
|
218
|
+
- Mon, 13 Apr 2015 20:45:43 GMT
|
271
219
|
Content-Length:
|
272
220
|
- '575'
|
273
221
|
body:
|
@@ -296,5 +244,5 @@ http_interactions:
|
|
296
244
|
PC9HZXJhck5mc2VSZXNwb25zZT48L3NvYXA6Qm9keT48L3NvYXA6RW52ZWxv
|
297
245
|
cGU+
|
298
246
|
http_version:
|
299
|
-
recorded_at:
|
247
|
+
recorded_at: Mon, 13 Apr 2015 20:45:43 GMT
|
300
248
|
recorded_with: VCR 2.9.3
|
@@ -31,7 +31,7 @@ http_interactions:
|
|
31
31
|
X-Powered-By:
|
32
32
|
- ASP.NET
|
33
33
|
Date:
|
34
|
-
-
|
34
|
+
- Mon, 13 Apr 2015 20:45:48 GMT
|
35
35
|
Content-Length:
|
36
36
|
- '1338'
|
37
37
|
body:
|
@@ -169,80 +169,28 @@ http_interactions:
|
|
169
169
|
\ <soap:address location=\"https://homologacao.notacarioca.rio.gov.br/WSNacional/nfse.asmx\"
|
170
170
|
/>\r\n </wsdl:port>\r\n </wsdl:service>\r\n</wsdl:definitions>"
|
171
171
|
http_version:
|
172
|
-
recorded_at:
|
172
|
+
recorded_at: Mon, 13 Apr 2015 20:45:48 GMT
|
173
173
|
- request:
|
174
174
|
method: post
|
175
175
|
uri: https://homologacao.notacarioca.rio.gov.br/WSNacional/nfse.asmx
|
176
176
|
body:
|
177
177
|
encoding: UTF-8
|
178
|
-
string:
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
</IdentificacaoRps>
|
188
|
-
<DataEmissao>2015-02-05T17:58:55</DataEmissao>
|
189
|
-
<NaturezaOperacao>1</NaturezaOperacao>
|
190
|
-
<OptanteSimplesNacional>1</OptanteSimplesNacional>
|
191
|
-
<IncentivadorCultural>2</IncentivadorCultural>
|
192
|
-
<Status>1</Status>
|
193
|
-
<Servico>
|
194
|
-
<Valores>
|
195
|
-
<ValorServicos>12.0</ValorServicos>
|
196
|
-
<ValorPis>0</ValorPis>
|
197
|
-
<ValorCofins>0</ValorCofins>
|
198
|
-
<ValorInss>0</ValorInss>
|
199
|
-
<ValorIr>0</ValorIr>
|
200
|
-
<ValorCsll>0</ValorCsll>
|
201
|
-
<IssRetido>2</IssRetido>
|
202
|
-
<ValorIss>0</ValorIss>
|
203
|
-
<Aliquota>0</Aliquota>
|
204
|
-
</Valores>
|
205
|
-
<ItemListaServico>0105</ItemListaServico>
|
206
|
-
<CodigoTributacaoMunicipio>010501</CodigoTributacaoMunicipio>
|
207
|
-
<Discriminacao>Venda do Serviço XYZ.</Discriminacao>
|
208
|
-
<CodigoMunicipio>3304557</CodigoMunicipio>
|
209
|
-
</Servico>
|
210
|
-
<Prestador>
|
211
|
-
<Cnpj>12390095000186</Cnpj>
|
212
|
-
<InscricaoMunicipal>04807995</InscricaoMunicipal>
|
213
|
-
</Prestador>
|
214
|
-
<Tomador>
|
215
|
-
<IdentificacaoTomador>
|
216
|
-
<CpfCnpj>
|
217
|
-
<Cnpj>98924674000187</Cnpj>
|
218
|
-
</CpfCnpj>
|
219
|
-
</IdentificacaoTomador>
|
220
|
-
<RazaoSocial>XPTO Tecnologia Ltda.</RazaoSocial>
|
221
|
-
<Endereco>
|
222
|
-
<Endereco>Rua qualquer nome</Endereco>
|
223
|
-
<Numero>33</Numero>
|
224
|
-
<Complemento>Sala 1</Complemento>
|
225
|
-
<Bairro>Seu bairro</Bairro>
|
226
|
-
<CodigoMunicipio>3550308</CodigoMunicipio>
|
227
|
-
<Uf>SP</Uf>
|
228
|
-
<Cep>22255777</Cep>
|
229
|
-
</Endereco>
|
230
|
-
<Contato>
|
231
|
-
<Telefone>2222-2222</Telefone>
|
232
|
-
<Email>customer@example.com</Email>
|
233
|
-
</Contato>
|
234
|
-
</Tomador>
|
235
|
-
</InfRps>
|
236
|
-
</Rps>
|
237
|
-
</GerarNfseEnvio>
|
238
|
-
</inputXML></GerarNfseRequest></soap:Body></soap:Envelope>
|
178
|
+
string: <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
179
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://notacarioca.rio.gov.br/"
|
180
|
+
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><GerarNfseRequest><inputXML><GerarNfseEnvio
|
181
|
+
xmlns="http://notacarioca.rio.gov.br/WSNacional/XSD/1/nfse_pcrj_v01.xsd"><Rps><InfRps
|
182
|
+
xmlns="http://www.abrasf.org.br/ABRASF/arquivos/nfse.xsd" Id="1042"><IdentificacaoRps><Numero>1042</Numero><Serie>A</Serie><Tipo>1</Tipo></IdentificacaoRps><DataEmissao>2015-04-13T17:45:47</DataEmissao><NaturezaOperacao>1</NaturezaOperacao><OptanteSimplesNacional>1</OptanteSimplesNacional><IncentivadorCultural>2</IncentivadorCultural><Status>1</Status><Servico><Valores><ValorServicos>12.0</ValorServicos><ValorPis>0</ValorPis><ValorCofins>0</ValorCofins><ValorInss>0</ValorInss><ValorIr>0</ValorIr><ValorCsll>0</ValorCsll><IssRetido>2</IssRetido><ValorIss>0</ValorIss><Aliquota>0</Aliquota></Valores><ItemListaServico>0105</ItemListaServico><CodigoTributacaoMunicipio>010501</CodigoTributacaoMunicipio><Discriminacao>Venda
|
183
|
+
do Serviço XYZ.</Discriminacao><CodigoMunicipio>3304557</CodigoMunicipio></Servico><Prestador><Cnpj>12390095000186</Cnpj><InscricaoMunicipal>04807995</InscricaoMunicipal></Prestador><Tomador><IdentificacaoTomador><CpfCnpj><Cnpj>98924674000187</Cnpj></CpfCnpj></IdentificacaoTomador><RazaoSocial>XPTO
|
184
|
+
Tecnologia Ltda.</RazaoSocial><Endereco><Endereco>Rua qualquer
|
185
|
+
nome</Endereco><Numero>33</Numero><Complemento>Sala
|
186
|
+
1</Complemento><Bairro>Seu bairro</Bairro><CodigoMunicipio>3550308</CodigoMunicipio><Uf>SP</Uf><Cep>22255777</Cep></Endereco><Contato><Telefone>2222-2222</Telefone><Email>customer@example.com</Email></Contato></Tomador></InfRps></Rps></GerarNfseEnvio></inputXML></GerarNfseRequest></soap:Body></soap:Envelope>
|
239
187
|
headers:
|
240
188
|
Soapaction:
|
241
189
|
- '"http://notacarioca.rio.gov.br/GerarNfse"'
|
242
190
|
Content-Type:
|
243
191
|
- text/xml;charset=UTF-8
|
244
192
|
Content-Length:
|
245
|
-
- '
|
193
|
+
- '2420'
|
246
194
|
Accept-Encoding:
|
247
195
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
248
196
|
Accept:
|
@@ -267,9 +215,9 @@ http_interactions:
|
|
267
215
|
X-Powered-By:
|
268
216
|
- ASP.NET
|
269
217
|
Date:
|
270
|
-
-
|
218
|
+
- Mon, 13 Apr 2015 20:45:50 GMT
|
271
219
|
Content-Length:
|
272
|
-
- '
|
220
|
+
- '1269'
|
273
221
|
body:
|
274
222
|
encoding: ASCII-8BIT
|
275
223
|
string: !binary |-
|
@@ -286,18 +234,18 @@ http_interactions:
|
|
286
234
|
aW9uYWwvWFNELzEvbmZzZV9wY3JqX3YwMS54c2QiJmd0OyZsdDtDb21wTmZz
|
287
235
|
ZSB4bWxucz0iaHR0cDovL3d3dy5hYnJhc2Yub3JnLmJyL0FCUkFTRi9hcnF1
|
288
236
|
aXZvcy9uZnNlLnhzZCImZ3Q7Jmx0O05mc2UmZ3Q7Jmx0O0luZk5mc2UmZ3Q7
|
289
|
-
|
290
|
-
|
291
|
-
|
237
|
+
Jmx0O051bWVybyZndDs3MCZsdDsvTnVtZXJvJmd0OyZsdDtDb2RpZ29WZXJp
|
238
|
+
ZmljYWNhbyZndDtMTEdGLVhNQ0ImbHQ7L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Z3Q7PC9vdXRwdXRYTUw+PC9HZXJhck5mc2VSZXNwb25zZT48
|
343
291
|
L3NvYXA6Qm9keT48L3NvYXA6RW52ZWxvcGU+
|
344
292
|
http_version:
|
345
|
-
recorded_at:
|
293
|
+
recorded_at: Mon, 13 Apr 2015 20:45:49 GMT
|
346
294
|
recorded_with: VCR 2.9.3
|
@@ -31,7 +31,7 @@ http_interactions:
|
|
31
31
|
X-Powered-By:
|
32
32
|
- ASP.NET
|
33
33
|
Date:
|
34
|
-
-
|
34
|
+
- Mon, 13 Apr 2015 20:45:47 GMT
|
35
35
|
Content-Length:
|
36
36
|
- '1338'
|
37
37
|
body:
|
@@ -169,65 +169,26 @@ http_interactions:
|
|
169
169
|
\ <soap:address location=\"https://homologacao.notacarioca.rio.gov.br/WSNacional/nfse.asmx\"
|
170
170
|
/>\r\n </wsdl:port>\r\n </wsdl:service>\r\n</wsdl:definitions>"
|
171
171
|
http_version:
|
172
|
-
recorded_at:
|
172
|
+
recorded_at: Mon, 13 Apr 2015 20:45:46 GMT
|
173
173
|
- request:
|
174
174
|
method: post
|
175
175
|
uri: https://homologacao.notacarioca.rio.gov.br/WSNacional/nfse.asmx
|
176
176
|
body:
|
177
177
|
encoding: UTF-8
|
178
|
-
string:
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
<Serie>A</Serie>
|
186
|
-
<Tipo>1</Tipo>
|
187
|
-
</IdentificacaoRps>
|
188
|
-
<DataEmissao>2015-02-05T17:59:00</DataEmissao>
|
189
|
-
<NaturezaOperacao>1</NaturezaOperacao>
|
190
|
-
<OptanteSimplesNacional>1</OptanteSimplesNacional>
|
191
|
-
<IncentivadorCultural>2</IncentivadorCultural>
|
192
|
-
<Status>1</Status>
|
193
|
-
<Servico>
|
194
|
-
<Valores>
|
195
|
-
<ValorServicos>12.0</ValorServicos>
|
196
|
-
<ValorPis>0</ValorPis>
|
197
|
-
<ValorCofins>0</ValorCofins>
|
198
|
-
<ValorInss>0</ValorInss>
|
199
|
-
<ValorIr>0</ValorIr>
|
200
|
-
<ValorCsll>0</ValorCsll>
|
201
|
-
<IssRetido>2</IssRetido>
|
202
|
-
<ValorIss>0</ValorIss>
|
203
|
-
<Aliquota>0</Aliquota>
|
204
|
-
</Valores>
|
205
|
-
<ItemListaServico>0105</ItemListaServico>
|
206
|
-
<CodigoTributacaoMunicipio>010501</CodigoTributacaoMunicipio>
|
207
|
-
<Discriminacao>Venda do Serviço XYZ.</Discriminacao>
|
208
|
-
<CodigoMunicipio>3304557</CodigoMunicipio>
|
209
|
-
</Servico>
|
210
|
-
<Prestador>
|
211
|
-
<Cnpj>12390095000186</Cnpj>
|
212
|
-
<InscricaoMunicipal>04807995</InscricaoMunicipal>
|
213
|
-
</Prestador>
|
214
|
-
<Tomador>
|
215
|
-
<RazaoSocial>XPTO Tecnologia Ltda.</RazaoSocial>
|
216
|
-
<Contato>
|
217
|
-
<Email>customer@example.com</Email>
|
218
|
-
</Contato>
|
219
|
-
</Tomador>
|
220
|
-
</InfRps>
|
221
|
-
</Rps>
|
222
|
-
</GerarNfseEnvio>
|
223
|
-
</inputXML></GerarNfseRequest></soap:Body></soap:Envelope>
|
178
|
+
string: <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
179
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://notacarioca.rio.gov.br/"
|
180
|
+
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><GerarNfseRequest><inputXML><GerarNfseEnvio
|
181
|
+
xmlns="http://notacarioca.rio.gov.br/WSNacional/XSD/1/nfse_pcrj_v01.xsd"><Rps><InfRps
|
182
|
+
xmlns="http://www.abrasf.org.br/ABRASF/arquivos/nfse.xsd" Id="1043"><IdentificacaoRps><Numero>1043</Numero><Serie>A</Serie><Tipo>1</Tipo></IdentificacaoRps><DataEmissao>2015-04-13T17:45:45</DataEmissao><NaturezaOperacao>1</NaturezaOperacao><OptanteSimplesNacional>1</OptanteSimplesNacional><IncentivadorCultural>2</IncentivadorCultural><Status>1</Status><Servico><Valores><ValorServicos>12.0</ValorServicos><ValorPis>0</ValorPis><ValorCofins>0</ValorCofins><ValorInss>0</ValorInss><ValorIr>0</ValorIr><ValorCsll>0</ValorCsll><IssRetido>2</IssRetido><ValorIss>0</ValorIss><Aliquota>0</Aliquota></Valores><ItemListaServico>0105</ItemListaServico><CodigoTributacaoMunicipio>010501</CodigoTributacaoMunicipio><Discriminacao>Venda
|
183
|
+
do Serviço XYZ.</Discriminacao><CodigoMunicipio>3304557</CodigoMunicipio></Servico><Prestador><Cnpj>12390095000186</Cnpj><InscricaoMunicipal>04807995</InscricaoMunicipal></Prestador><Tomador><RazaoSocial>XPTO
|
184
|
+
Tecnologia Ltda.</RazaoSocial><Contato><Email>customer@example.com</Email></Contato></Tomador></InfRps></Rps></GerarNfseEnvio></inputXML></GerarNfseRequest></soap:Body></soap:Envelope>
|
224
185
|
headers:
|
225
186
|
Soapaction:
|
226
187
|
- '"http://notacarioca.rio.gov.br/GerarNfse"'
|
227
188
|
Content-Type:
|
228
189
|
- text/xml;charset=UTF-8
|
229
190
|
Content-Length:
|
230
|
-
- '
|
191
|
+
- '1945'
|
231
192
|
Accept-Encoding:
|
232
193
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
233
194
|
Accept:
|
@@ -252,9 +213,9 @@ http_interactions:
|
|
252
213
|
X-Powered-By:
|
253
214
|
- ASP.NET
|
254
215
|
Date:
|
255
|
-
-
|
216
|
+
- Mon, 13 Apr 2015 20:45:48 GMT
|
256
217
|
Content-Length:
|
257
|
-
- '
|
218
|
+
- '1144'
|
258
219
|
body:
|
259
220
|
encoding: ASCII-8BIT
|
260
221
|
string: !binary |-
|
@@ -271,18 +232,18 @@ http_interactions:
|
|
271
232
|
aW9uYWwvWFNELzEvbmZzZV9wY3JqX3YwMS54c2QiJmd0OyZsdDtDb21wTmZz
|
272
233
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TUtMDQtMTNU
|
286
247
|
MDA6MDA6MDAmbHQ7L0NvbXBldGVuY2lhJmd0OyZsdDtTZXJ2aWNvJmd0OyZs
|
287
248
|
dDtWYWxvcmVzJmd0OyZsdDtWYWxvclNlcnZpY29zJmd0OzEyJmx0Oy9WYWxv
|
288
249
|
clNlcnZpY29zJmd0OyZsdDtJc3NSZXRpZG8mZ3Q7MiZsdDsvSXNzUmV0aWRv
|
@@ -318,5 +279,5 @@ http_interactions:
|
|
318
279
|
R2VyYXJOZnNlUmVzcG9zdGEmZ3Q7PC9vdXRwdXRYTUw+PC9HZXJhck5mc2VS
|
319
280
|
ZXNwb25zZT48L3NvYXA6Qm9keT48L3NvYXA6RW52ZWxvcGU+
|
320
281
|
http_version:
|
321
|
-
recorded_at:
|
282
|
+
recorded_at: Mon, 13 Apr 2015 20:45:47 GMT
|
322
283
|
recorded_with: VCR 2.9.3
|
@@ -1,12 +1,4 @@
|
|
1
1
|
RSpec.describe NfseCarioca::CancelarNfse do
|
2
|
-
before do
|
3
|
-
NfseCarioca.configure do |config|
|
4
|
-
config.cnpj = "12390095000186"
|
5
|
-
config.inscricao_municipal = "04807995"
|
6
|
-
config.test_mode = true
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
2
|
describe "#execute!" do
|
11
3
|
context 'when NFSeCarioca rps number does not exist', :vcr do
|
12
4
|
let(:invoice_canceller) do
|
@@ -26,7 +18,7 @@ RSpec.describe NfseCarioca::CancelarNfse do
|
|
26
18
|
|
27
19
|
context 'when NFSeCarioca rps number exist', :vcr do
|
28
20
|
let(:invoice_canceller) do
|
29
|
-
described_class.new("
|
21
|
+
described_class.new("70")
|
30
22
|
end
|
31
23
|
|
32
24
|
let(:response) { invoice_canceller.execute! }
|
@@ -1,4 +1,6 @@
|
|
1
1
|
RSpec.describe NfseCarioca::GerarNfse do
|
2
|
+
let(:phone_number) { "2222-2222" }
|
3
|
+
let(:zipcode) { "22255777" }
|
2
4
|
let(:nota_fiscal_info) do
|
3
5
|
{
|
4
6
|
identification_number: invoice_number,
|
@@ -8,7 +10,7 @@ RSpec.describe NfseCarioca::GerarNfse do
|
|
8
10
|
document_type: "Cnpj",
|
9
11
|
document_number: "98924674000187",
|
10
12
|
name: "XPTO Tecnologia Ltda.",
|
11
|
-
phone_number:
|
13
|
+
phone_number: phone_number,
|
12
14
|
email: "customer@example.com",
|
13
15
|
address: {
|
14
16
|
street: "Rua qualquer nome",
|
@@ -17,7 +19,7 @@ RSpec.describe NfseCarioca::GerarNfse do
|
|
17
19
|
neighborhood: "Seu bairro",
|
18
20
|
city_ibge_code: "3550308",
|
19
21
|
state_code: "SP",
|
20
|
-
zipcode:
|
22
|
+
zipcode: zipcode
|
21
23
|
}
|
22
24
|
}
|
23
25
|
}
|
@@ -25,71 +27,71 @@ RSpec.describe NfseCarioca::GerarNfse do
|
|
25
27
|
|
26
28
|
let!(:invoice_generator) { described_class.new(nota_fiscal_info) }
|
27
29
|
|
28
|
-
before do
|
29
|
-
NfseCarioca.configure do |config|
|
30
|
-
config.cnpj = "12390095000186"
|
31
|
-
config.inscricao_municipal = "04807995"
|
32
|
-
config.test_mode = true
|
33
|
-
|
34
|
-
# config.cert_path = file_path("cert.pem")
|
35
|
-
# config.cert_key_path = file_path("key.pem")
|
36
|
-
# config.ca_cert_path = file_path("ca_cert.pem")
|
37
|
-
# config.cert_key_password = "PASSWORD"
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
30
|
describe '#to_xml' do
|
42
31
|
let(:invoice_number) { "1024" }
|
43
32
|
let(:xml) { invoice_generator.to_xml }
|
44
33
|
|
34
|
+
context "when everything is fine" do
|
35
|
+
it 'contains correct identification number' do
|
36
|
+
expect(xml).to include %{<Numero>1024</Numero>}
|
37
|
+
end
|
45
38
|
|
46
|
-
|
47
|
-
|
48
|
-
|
39
|
+
it 'contains correct description' do
|
40
|
+
expect(xml).to include %{<Discriminacao>Venda do Serviço XYZ.}
|
41
|
+
end
|
49
42
|
|
50
|
-
|
51
|
-
|
52
|
-
|
43
|
+
it 'contains correct description' do
|
44
|
+
expect(xml).to include %{<ValorServicos>12.0</ValorServicos>}
|
45
|
+
end
|
53
46
|
|
54
|
-
|
55
|
-
|
47
|
+
it 'contains correct provider information' do
|
48
|
+
expect(xml).to include %{<Prestador><Cnpj>12390095000186</Cnpj><InscricaoMunicipal>04807995</InscricaoMunicipal></Prestador>}
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'contains correct customer information' do
|
52
|
+
expect(xml).to include %{<IdentificacaoTomador><CpfCnpj><Cnpj>98924674000187</Cnpj></CpfCnpj></IdentificacaoTomador><RazaoSocial>XPTO Tecnologia Ltda.</RazaoSocial><Endereco><Endereco>Rua qualquer nome</Endereco><Numero>33</Numero><Complemento>Sala 1</Complemento><Bairro>Seu bairro</Bairro><CodigoMunicipio>3550308</CodigoMunicipio><Uf>SP</Uf><Cep>22255777</Cep></Endereco>}
|
53
|
+
end
|
56
54
|
end
|
57
55
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
<
|
62
|
-
|
56
|
+
context "when phone is wrong" do
|
57
|
+
context "when number is 551148073291" do
|
58
|
+
let(:phone_number) { "551148073291" }
|
59
|
+
it { expect(xml).to include %{<Telefone>1148073291</Telefone>} }
|
60
|
+
end
|
61
|
+
|
62
|
+
context "when number is 313184002584" do
|
63
|
+
let(:phone_number) { "313184002584" }
|
64
|
+
it { expect(xml).to include %{<Telefone>3184002584</Telefone>} }
|
65
|
+
end
|
66
|
+
|
67
|
+
context "when number is 011949860019" do
|
68
|
+
let(:phone_number) { "011949860019" }
|
69
|
+
it { expect(xml).to include %{<Telefone>11949860019</Telefone>} }
|
70
|
+
end
|
71
|
+
|
72
|
+
context "when number is (11) 94986-0019" do
|
73
|
+
let(:phone_number) { "(11) 94986-0019" }
|
74
|
+
it { expect(xml).to include %{<Telefone>11949860019</Telefone>} }
|
75
|
+
end
|
76
|
+
|
63
77
|
end
|
64
78
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
</CpfCnpj>
|
71
|
-
</IdentificacaoTomador>
|
72
|
-
<RazaoSocial>XPTO Tecnologia Ltda.</RazaoSocial>
|
73
|
-
<Endereco>
|
74
|
-
<Endereco>Rua qualquer nome</Endereco>
|
75
|
-
<Numero>33</Numero>
|
76
|
-
<Complemento>Sala 1</Complemento>
|
77
|
-
<Bairro>Seu bairro</Bairro>
|
78
|
-
<CodigoMunicipio>3550308</CodigoMunicipio>
|
79
|
-
<Uf>SP</Uf>
|
80
|
-
<Cep>22255777</Cep>
|
81
|
-
</Endereco>}
|
79
|
+
context "when zipcode is wrong" do
|
80
|
+
context "when number is 05116-050" do
|
81
|
+
let(:zipcode) { "05116-050" }
|
82
|
+
it { expect(xml).to include %{<Cep>05116050</Cep>} }
|
83
|
+
end
|
82
84
|
end
|
83
85
|
end
|
84
86
|
|
85
87
|
describe "#call" do
|
86
88
|
context 'when NfseCarioca rps number does not exist yet', :vcr do
|
87
89
|
let(:response) { invoice_generator.execute! }
|
88
|
-
let(:invoice_number) { "
|
90
|
+
let(:invoice_number) { "1042" }
|
89
91
|
|
90
92
|
it 'generates NfseCarioca' do
|
91
|
-
expect(response.number).to eq "
|
92
|
-
expect(response.verification_code).to eq "
|
93
|
+
expect(response.number).to eq "70"
|
94
|
+
expect(response.verification_code).to eq "LLGF-XMCB"
|
93
95
|
end
|
94
96
|
end
|
95
97
|
|
@@ -101,9 +103,13 @@ RSpec.describe NfseCarioca::GerarNfse do
|
|
101
103
|
expect(response.error?).to be_truthy
|
102
104
|
end
|
103
105
|
|
104
|
-
it "responds with message
|
106
|
+
it "responds with error message E10 " do
|
105
107
|
expect(response.error_message).to eq "RPS já informado."
|
106
108
|
end
|
109
|
+
|
110
|
+
it "responds with error code E10 " do
|
111
|
+
expect(response.error_code).to eq "E10"
|
112
|
+
end
|
107
113
|
end
|
108
114
|
|
109
115
|
context "when NfseCarioca has only the minimum values", :vcr do
|
@@ -119,11 +125,11 @@ RSpec.describe NfseCarioca::GerarNfse do
|
|
119
125
|
}
|
120
126
|
end
|
121
127
|
let(:response) { invoice_generator.execute! }
|
122
|
-
let(:invoice_number) { "
|
128
|
+
let(:invoice_number) { "1043" }
|
123
129
|
|
124
130
|
it 'generates NfseCarioca' do
|
125
|
-
expect(response.number).to eq "
|
126
|
-
expect(response.verification_code).to eq "
|
131
|
+
expect(response.number).to eq "69"
|
132
|
+
expect(response.verification_code).to eq "I4RK-NUYD"
|
127
133
|
end
|
128
134
|
end
|
129
135
|
end
|