rnfse 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3d3ab9632a4b088627df30fc724e454e27f4274a
4
- data.tar.gz: 5f5edf8ee4af6cb1856c03891b712f65d67e125a
3
+ metadata.gz: 89a09fcd9d03c18bd4405108cd62d313f268370e
4
+ data.tar.gz: 604bb29f0942bd888642f2bf8ebf5ed32d99c0d1
5
5
  SHA512:
6
- metadata.gz: cdc2e3cadd1c36b458d77657d224d49e63d20b9723dce53fd39ed0ff361ac74671348fb3a47a30df45e61fc5084190d161ee106e7423ec8a70be558e3718e4ef
7
- data.tar.gz: 08ef6287aaa124463be2e8b7d200084ace1caecc5839f13ccad3076a66331bc7b468e853b731c8de576a9eee5998c033ff152c7854d3aa4b44a85b08dc741be0
6
+ metadata.gz: 6a9c9cd8f8382edac9aa740dbb4f6cb73b360ec172a6ac72b83d8e9ad482811b6bcf0fe13bb3925334baa0cb5765b870ca75354fe420afe485f8a2c48df72b0e
7
+ data.tar.gz: 4cf5a7c06adea882d6e3179bdc6248fa774a3e6b58fe5e13539f803e53e11d3f0f7729a7e303b949091e8f938cf96a070bde32b28ed73db8fcf66098e02e7a1d
@@ -21,6 +21,7 @@ module Rnfse::API::SpeedGov10
21
21
 
22
22
  def consultar_situacao_lote_rps(hash = {})
23
23
  validate_options(hash)
24
+ validate_ascii(hash)
24
25
  header = xml_builder.build_header_xml()
25
26
  parameters = xml_builder.build_consultar_situacao_lote_rps_envio_xml(hash)
26
27
  response = self.soap_client.call(
@@ -34,6 +35,7 @@ module Rnfse::API::SpeedGov10
34
35
 
35
36
  def consultar_lote_rps(hash = {})
36
37
  validate_options(hash)
38
+ validate_ascii(hash)
37
39
  header = xml_builder.build_header_xml()
38
40
  parameters = xml_builder.build_consultar_lote_rps_envio_xml(hash)
39
41
  response = self.soap_client.call(
@@ -61,6 +63,7 @@ module Rnfse::API::SpeedGov10
61
63
 
62
64
  def consultar_nfse(hash = {})
63
65
  validate_options(hash)
66
+ validate_ascii(hash)
64
67
  header = xml_builder.build_header_xml()
65
68
  parameters = xml_builder.build_consultar_nfse_envio_xml(hash)
66
69
  response = self.soap_client.call(
data/lib/rnfse/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rnfse
2
- VERSION = '0.6.0'
2
+ VERSION = '0.6.1'
3
3
  end
@@ -215,6 +215,24 @@ describe Rnfse::API::SpeedGov10 do
215
215
 
216
216
  it { expect(client).to respond_to(:consultar_nfse) }
217
217
 
218
+ context 'quando existem parametros não ASCII,' do
219
+ it { expect do
220
+ VCR.use_cassette('speed_gov_1_0_consultar_nfse_ascii') do
221
+ client.consultar_nfse({
222
+ prestador: {
223
+ cnpj: "12.552.510/0001-50",
224
+ inscricao_municipal: "68"
225
+ },
226
+ intermediario_servico: {
227
+ razao_social: 'àõéúîàõéúîàõéúîàõéúîàõéúî',
228
+ cnpj: "62.894.995/0001-39",
229
+ inscricao_municipal: "12345670"
230
+ }
231
+ })
232
+ end
233
+ end.to raise_error(Rnfse::Error::NonASCIIEncoding) }
234
+ end
235
+
218
236
  subject do
219
237
  VCR.use_cassette('speed_gov_1_0_consultar_nfse') do
220
238
  client.consultar_nfse({
@@ -0,0 +1,110 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://speedgov.com.br/wsmod/Nfes
6
+ body:
7
+ encoding: UTF-8
8
+ string: |-
9
+ <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:nfse="http://www.abrasf.org.br/ABRASF/arquivos/nfse.xsd"><soapenv:Body><nfse:ConsultarNfse><header><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
10
+ <p:cabecalho xmlns:p="http://ws.speedgov.com.br/cabecalho_v1.xsd" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:p1="http://ws.speedgov.com.br/tipos_v1.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" versao="1" xsi:schemaLocation="http://ws.speedgov.com.br/cabecalho_v1.xsd">
11
+ <versaoDados>1</versaoDados>
12
+ </p:cabecalho>
13
+ ]]></header><parameters><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
14
+ <p:ConsultarNfseEnvio xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:p1="http://ws.speedgov.com.br/tipos_v1.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://ws.speedgov.com.br/consultar_nfse_envio_v1.xsd" xsi:schemaLocation="http://ws.speedgov.com.br/consultar_nfse_envio_v1.xsd">
15
+ <p:Prestador>
16
+ <p1:Cnpj>12552510000150</p1:Cnpj>
17
+ <p1:InscricaoMunicipal>68</p1:InscricaoMunicipal>
18
+ </p:Prestador>
19
+ <p:IntermediarioServico>
20
+ <p1:RazaoSocial>àõéúîàõéúîàõéúîàõéúîàõéúî</p1:RazaoSocial>
21
+ <p1:CpfCnpj>
22
+ <p1:Cnpj>62894995000139</p1:Cnpj>
23
+ </p1:CpfCnpj>
24
+ <p1:InscricaoMunicipal>12345670</p1:InscricaoMunicipal>
25
+ </p:IntermediarioServico>
26
+ </p:ConsultarNfseEnvio>
27
+ ]]></parameters></nfse:ConsultarNfse></soapenv:Body></soapenv:Envelope>
28
+ headers:
29
+ Soapaction:
30
+ - '"ConsultarNfse"'
31
+ Content-Type:
32
+ - text/xml;charset=UTF-8
33
+ Content-Length:
34
+ - '1595'
35
+ Accept-Encoding:
36
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
37
+ Accept:
38
+ - "*/*"
39
+ User-Agent:
40
+ - Ruby
41
+ response:
42
+ status:
43
+ code: 500
44
+ message: Internal Server Error
45
+ headers:
46
+ Cache-Control:
47
+ - no-cache="set-cookie"
48
+ Content-Type:
49
+ - text/xml;charset=utf-8
50
+ Date:
51
+ - Wed, 19 Nov 2014 22:08:11 GMT
52
+ Server:
53
+ - Apache-Coyote/1.1
54
+ Set-Cookie:
55
+ - AWSELB=33FDC97B088EC7D48E554EA7951916335FCF4DD3330FF363E61E26C47E1495D25A7D0ED17ADFB0210868A985B0949924EE66806F2727334DB4D04B2CE4F6462BEA42C169F4;PATH=/
56
+ Transfer-Encoding:
57
+ - chunked
58
+ Connection:
59
+ - keep-alive
60
+ body:
61
+ encoding: UTF-8
62
+ string: <?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><S:Fault
63
+ xmlns:ns4="http://www.w3.org/2003/05/soap-envelope"><faultcode>S:Server</faultcode><faultstring>java.lang.NullPointerException</faultstring><detail><ns2:exception
64
+ xmlns:ns2="http://jax-ws.dev.java.net/" class="java.lang.NullPointerException"
65
+ note="To disable this feature, set com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace
66
+ system property to false"><ns2:stackTrace><ns2:frame class="com.intersol.envio.ConsultarNfseEnvio"
67
+ file="ConsultarNfseEnvio.java" line="48" method="acessoDatabase"/><ns2:frame
68
+ class="com.intersol.envio.ConsultarNfseEnvio" file="ConsultarNfseEnvio.java"
69
+ line="43" method="processaEnvio"/><ns2:frame class="com.intersol.Nfes" file="Nfes.java"
70
+ line="190" method="ConsultarNfse"/><ns2:frame class="sun.reflect.NativeMethodAccessorImpl"
71
+ file="NativeMethodAccessorImpl.java" line="native" method="invoke0"/><ns2:frame
72
+ class="sun.reflect.NativeMethodAccessorImpl" file="NativeMethodAccessorImpl.java"
73
+ line="39" method="invoke"/><ns2:frame class="sun.reflect.DelegatingMethodAccessorImpl"
74
+ file="DelegatingMethodAccessorImpl.java" line="25" method="invoke"/><ns2:frame
75
+ class="java.lang.reflect.Method" file="Method.java" line="597" method="invoke"/><ns2:frame
76
+ class="com.sun.xml.ws.api.server.InstanceResolver$1" file="InstanceResolver.java"
77
+ line="246" method="invoke"/><ns2:frame class="com.sun.xml.ws.server.InvokerTube$2"
78
+ file="InvokerTube.java" line="146" method="invoke"/><ns2:frame class="com.sun.xml.ws.server.sei.EndpointMethodHandler"
79
+ file="EndpointMethodHandler.java" line="257" method="invoke"/><ns2:frame class="com.sun.xml.ws.server.sei.SEIInvokerTube"
80
+ file="SEIInvokerTube.java" line="95" method="processRequest"/><ns2:frame class="com.sun.xml.ws.api.pipe.Fiber"
81
+ file="Fiber.java" line="629" method="__doRun"/><ns2:frame class="com.sun.xml.ws.api.pipe.Fiber"
82
+ file="Fiber.java" line="588" method="_doRun"/><ns2:frame class="com.sun.xml.ws.api.pipe.Fiber"
83
+ file="Fiber.java" line="573" method="doRun"/><ns2:frame class="com.sun.xml.ws.api.pipe.Fiber"
84
+ file="Fiber.java" line="470" method="runSync"/><ns2:frame class="com.sun.xml.ws.server.WSEndpointImpl$2"
85
+ file="WSEndpointImpl.java" line="295" method="process"/><ns2:frame class="com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit"
86
+ file="HttpAdapter.java" line="519" method="handle"/><ns2:frame class="com.sun.xml.ws.transport.http.HttpAdapter"
87
+ file="HttpAdapter.java" line="288" method="handle"/><ns2:frame class="com.sun.xml.ws.transport.http.servlet.ServletAdapter"
88
+ file="ServletAdapter.java" line="143" method="handle"/><ns2:frame class="com.sun.xml.ws.transport.http.servlet.WSServletDelegate"
89
+ file="WSServletDelegate.java" line="155" method="doGet"/><ns2:frame class="com.sun.xml.ws.transport.http.servlet.WSServletDelegate"
90
+ file="WSServletDelegate.java" line="189" method="doPost"/><ns2:frame class="com.sun.xml.ws.transport.http.servlet.WSServlet"
91
+ file="WSServlet.java" line="76" method="doPost"/><ns2:frame class="javax.servlet.http.HttpServlet"
92
+ file="HttpServlet.java" line="637" method="service"/><ns2:frame class="javax.servlet.http.HttpServlet"
93
+ file="HttpServlet.java" line="717" method="service"/><ns2:frame class="org.apache.catalina.core.ApplicationFilterChain"
94
+ file="ApplicationFilterChain.java" line="290" method="internalDoFilter"/><ns2:frame
95
+ class="org.apache.catalina.core.ApplicationFilterChain" file="ApplicationFilterChain.java"
96
+ line="206" method="doFilter"/><ns2:frame class="org.apache.catalina.core.StandardWrapperValve"
97
+ file="StandardWrapperValve.java" line="233" method="invoke"/><ns2:frame class="org.apache.catalina.core.StandardContextValve"
98
+ file="StandardContextValve.java" line="191" method="invoke"/><ns2:frame class="org.apache.catalina.core.StandardHostValve"
99
+ file="StandardHostValve.java" line="127" method="invoke"/><ns2:frame class="com.googlecode.psiprobe.Tomcat60AgentValve"
100
+ file="Tomcat60AgentValve.java" line="30" method="invoke"/><ns2:frame class="org.apache.catalina.valves.ErrorReportValve"
101
+ file="ErrorReportValve.java" line="103" method="invoke"/><ns2:frame class="org.apache.catalina.core.StandardEngineValve"
102
+ file="StandardEngineValve.java" line="109" method="invoke"/><ns2:frame class="org.apache.catalina.connector.CoyoteAdapter"
103
+ file="CoyoteAdapter.java" line="293" method="service"/><ns2:frame class="org.apache.coyote.http11.Http11AprProcessor"
104
+ file="Http11AprProcessor.java" line="879" method="process"/><ns2:frame class="org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler"
105
+ file="Http11AprProtocol.java" line="600" method="process"/><ns2:frame class="org.apache.tomcat.util.net.AprEndpoint$Worker"
106
+ file="AprEndpoint.java" line="1703" method="run"/><ns2:frame class="java.lang.Thread"
107
+ file="Thread.java" line="662" method="run"/></ns2:stackTrace></ns2:exception></detail></S:Fault></S:Body></S:Envelope>
108
+ http_version:
109
+ recorded_at: Wed, 19 Nov 2014 22:08:12 GMT
110
+ recorded_with: VCR 2.9.3
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rnfse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Renan Mendes Carvalho
@@ -423,6 +423,7 @@ files:
423
423
  - spec/fixtures/vcr_cassettes/iss_net_1_0_recepcionar_lote_rps.yml
424
424
  - spec/fixtures/vcr_cassettes/speed_gov_1_0_consultar_lote_rps.yml
425
425
  - spec/fixtures/vcr_cassettes/speed_gov_1_0_consultar_nfse.yml
426
+ - spec/fixtures/vcr_cassettes/speed_gov_1_0_consultar_nfse_ascii.yml
426
427
  - spec/fixtures/vcr_cassettes/speed_gov_1_0_consultar_nfse_por_rps.yml
427
428
  - spec/fixtures/vcr_cassettes/speed_gov_1_0_consultar_situacao_lote_rps.yml
428
429
  - spec/fixtures/vcr_cassettes/speed_gov_1_0_recepcionar_lote_rps.yml
@@ -461,56 +462,57 @@ signing_key:
461
462
  specification_version: 4
462
463
  summary: Biblioteca para a API de Nota Fiscal de Serviços eletrônica (NFS-e) da ABRASF.
463
464
  test_files:
465
+ - spec/error_spec.rb
466
+ - spec/version_spec.rb
467
+ - spec/api/speed_gov_1_0_spec.rb
468
+ - spec/api/abrasf_1_0_spec.rb
469
+ - spec/api/abrasf_1_0/consultar_situacao_lote_rps_json_spec.rb
470
+ - spec/api/abrasf_1_0/consultar_nfse_por_rps_json_spec.rb
464
471
  - spec/api/abrasf_1_0/cancelar_nfse_json_spec.rb
465
- - spec/api/abrasf_1_0/consultar_lote_rps_json_spec.rb
466
472
  - spec/api/abrasf_1_0/consultar_nfse_json_spec.rb
467
- - spec/api/abrasf_1_0/consultar_nfse_por_rps_json_spec.rb
468
- - spec/api/abrasf_1_0/consultar_situacao_lote_rps_json_spec.rb
473
+ - spec/api/abrasf_1_0/consultar_lote_rps_json_spec.rb
469
474
  - spec/api/abrasf_1_0/recepcionar_lote_rps_json_spec.rb
470
- - spec/api/abrasf_1_0_spec.rb
471
475
  - spec/api/iss_net_1_0_spec.rb
472
- - spec/api/speed_gov_1_0_spec.rb
473
- - spec/api_spec.rb
474
- - spec/core_spec.rb
475
- - spec/error_spec.rb
476
- - spec/fixtures/abrasf_1_0/cancelar_nfse_envio.xml
477
- - spec/fixtures/abrasf_1_0/consultar_lote_rps_envio.xml
478
- - spec/fixtures/abrasf_1_0/consultar_nfse.xml
479
- - spec/fixtures/abrasf_1_0/consultar_nfse_por_rps.xml
480
- - spec/fixtures/abrasf_1_0/consultar_situacao_lote_rps_envio.xml
481
- - spec/fixtures/abrasf_1_0/enviar_lote_rps_envio.xml
482
- - spec/fixtures/abrasf_1_0/nfse.xsd
483
- - spec/fixtures/certificate.pem
484
- - spec/fixtures/iss_net_1_0/cancelar_nfse_envio.xml
485
- - spec/fixtures/iss_net_1_0/consultar_lote_rps_envio.xml
486
- - spec/fixtures/iss_net_1_0/consultar_nfse.xml
487
476
  - spec/fixtures/iss_net_1_0/consultar_nfse_por_rps.xml
488
- - spec/fixtures/iss_net_1_0/consultar_situacao_lote_rps_envio.xml
477
+ - spec/fixtures/iss_net_1_0/consultar_nfse.xml
489
478
  - spec/fixtures/iss_net_1_0/enviar_lote_rps_envio.xml
490
- - spec/fixtures/key.pem
491
- - spec/fixtures/speed_gov_1_0/consultar_lote_rps_envio.xml
492
- - spec/fixtures/speed_gov_1_0/consultar_nfse_envio.xml
493
- - spec/fixtures/speed_gov_1_0/consultar_nfse_rps_envio.xml
494
- - spec/fixtures/speed_gov_1_0/consultar_situacao_lote_rps_envio.xml
495
- - spec/fixtures/speed_gov_1_0/enviar_lote_rps_envio.xml
496
- - spec/fixtures/speed_gov_1_0/header.xml
497
- - spec/fixtures/vcr_cassettes/iss_net_1_0_cancelar_nfse.yml
498
- - spec/fixtures/vcr_cassettes/iss_net_1_0_consultar_lote_rps.yml
479
+ - spec/fixtures/iss_net_1_0/consultar_situacao_lote_rps_envio.xml
480
+ - spec/fixtures/iss_net_1_0/cancelar_nfse_envio.xml
481
+ - spec/fixtures/iss_net_1_0/consultar_lote_rps_envio.xml
482
+ - spec/fixtures/vcr_cassettes/speed_gov_1_0_recepcionar_lote_rps_ascii.yml
499
483
  - spec/fixtures/vcr_cassettes/iss_net_1_0_consultar_nfse.yml
500
- - spec/fixtures/vcr_cassettes/iss_net_1_0_consultar_nfse_por_rps.yml
501
- - spec/fixtures/vcr_cassettes/iss_net_1_0_consultar_situacao_lote_rps.yml
484
+ - spec/fixtures/vcr_cassettes/iss_net_1_0_cancelar_nfse.yml
485
+ - spec/fixtures/vcr_cassettes/speed_gov_1_0_recepcionar_lote_rps.yml
502
486
  - spec/fixtures/vcr_cassettes/iss_net_1_0_recepcionar_lote_rps.yml
503
- - spec/fixtures/vcr_cassettes/speed_gov_1_0_consultar_lote_rps.yml
504
- - spec/fixtures/vcr_cassettes/speed_gov_1_0_consultar_nfse.yml
505
487
  - spec/fixtures/vcr_cassettes/speed_gov_1_0_consultar_nfse_por_rps.yml
488
+ - spec/fixtures/vcr_cassettes/speed_gov_1_0_consultar_nfse.yml
489
+ - spec/fixtures/vcr_cassettes/speed_gov_1_0_consultar_nfse_ascii.yml
490
+ - spec/fixtures/vcr_cassettes/iss_net_1_0_consultar_situacao_lote_rps.yml
491
+ - spec/fixtures/vcr_cassettes/iss_net_1_0_consultar_lote_rps.yml
492
+ - spec/fixtures/vcr_cassettes/iss_net_1_0_consultar_nfse_por_rps.yml
506
493
  - spec/fixtures/vcr_cassettes/speed_gov_1_0_consultar_situacao_lote_rps.yml
507
- - spec/fixtures/vcr_cassettes/speed_gov_1_0_recepcionar_lote_rps.yml
508
- - spec/fixtures/vcr_cassettes/speed_gov_1_0_recepcionar_lote_rps_ascii.yml
509
- - spec/hash_spec.rb
494
+ - spec/fixtures/vcr_cassettes/speed_gov_1_0_consultar_lote_rps.yml
495
+ - spec/fixtures/abrasf_1_0/consultar_nfse_por_rps.xml
496
+ - spec/fixtures/abrasf_1_0/nfse.xsd
497
+ - spec/fixtures/abrasf_1_0/consultar_nfse.xml
498
+ - spec/fixtures/abrasf_1_0/enviar_lote_rps_envio.xml
499
+ - spec/fixtures/abrasf_1_0/consultar_situacao_lote_rps_envio.xml
500
+ - spec/fixtures/abrasf_1_0/cancelar_nfse_envio.xml
501
+ - spec/fixtures/abrasf_1_0/consultar_lote_rps_envio.xml
502
+ - spec/fixtures/key.pem
503
+ - spec/fixtures/certificate.pem
504
+ - spec/fixtures/speed_gov_1_0/consultar_nfse_envio.xml
505
+ - spec/fixtures/speed_gov_1_0/consultar_nfse_rps_envio.xml
506
+ - spec/fixtures/speed_gov_1_0/header.xml
507
+ - spec/fixtures/speed_gov_1_0/enviar_lote_rps_envio.xml
508
+ - spec/fixtures/speed_gov_1_0/consultar_situacao_lote_rps_envio.xml
509
+ - spec/fixtures/speed_gov_1_0/consultar_lote_rps_envio.xml
510
510
  - spec/spec_helper.rb
511
511
  - spec/string_spec.rb
512
- - spec/version_spec.rb
512
+ - spec/api_spec.rb
513
+ - spec/hash_spec.rb
514
+ - spec/core_spec.rb
515
+ - spec/xml_builder_spec.rb
516
+ - spec/xml_builder/speed_gov_1_0_spec.rb
513
517
  - spec/xml_builder/abrasf_1_0_spec.rb
514
518
  - spec/xml_builder/iss_net_1_0_spec.rb
515
- - spec/xml_builder/speed_gov_1_0_spec.rb
516
- - spec/xml_builder_spec.rb