br_nfe 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (760) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -0
  3. data/.travis.yml +0 -0
  4. data/Gemfile +0 -0
  5. data/Gemfile.lock +4 -4
  6. data/LICENSE +0 -0
  7. data/README.markdown +0 -0
  8. data/Rakefile +0 -0
  9. data/br_nfe.gemspec +2 -2
  10. data/lib/br_nfe.rb +22 -20
  11. data/lib/br_nfe/active_model/associations.rb +0 -0
  12. data/lib/br_nfe/active_model/has_many.rb +0 -0
  13. data/lib/br_nfe/active_model/has_one.rb +0 -0
  14. data/lib/br_nfe/active_model_base.rb +0 -0
  15. data/lib/br_nfe/association/have_address.rb +0 -0
  16. data/lib/br_nfe/association/have_condicao_pagamento.rb +0 -0
  17. data/lib/br_nfe/association/have_destinatario.rb +0 -0
  18. data/lib/br_nfe/association/have_emitente.rb +0 -0
  19. data/lib/br_nfe/base.rb +10 -22
  20. data/lib/br_nfe/calculos/fatores_de_multiplicacao.rb +0 -0
  21. data/lib/br_nfe/calculos/modulo11.rb +0 -0
  22. data/lib/br_nfe/calculos/modulo11_fator_de2a9.rb +0 -0
  23. data/lib/br_nfe/calculos/modulo11_fator_de2a9_resto_zero.rb +0 -0
  24. data/lib/br_nfe/condicao_pagamento.rb +0 -0
  25. data/lib/br_nfe/constants.rb +0 -2
  26. data/lib/br_nfe/endereco.rb +4 -0
  27. data/lib/br_nfe/helper/cpf_cnpj.rb +0 -0
  28. data/lib/br_nfe/helper/string_methods.rb +0 -0
  29. data/lib/br_nfe/person.rb +1 -0
  30. data/lib/br_nfe/product/destinatario.rb +3 -0
  31. data/lib/br_nfe/product/emitente.rb +0 -0
  32. data/lib/br_nfe/product/evento/base.rb +0 -0
  33. data/lib/br_nfe/product/evento/cancelamento.rb +0 -0
  34. data/lib/br_nfe/product/nf_xml_value.rb +1 -1
  35. data/lib/br_nfe/product/nfe/adicao_importacao.rb +0 -0
  36. data/lib/br_nfe/product/nfe/cobranca/duplicata.rb +0 -0
  37. data/lib/br_nfe/product/nfe/cobranca/fatura.rb +0 -0
  38. data/lib/br_nfe/product/nfe/cobranca/pagamento.rb +13 -0
  39. data/lib/br_nfe/product/nfe/declaracao_importacao.rb +0 -0
  40. data/lib/br_nfe/product/nfe/detalhe_exportacao.rb +0 -0
  41. data/lib/br_nfe/product/nfe/item.rb +0 -0
  42. data/lib/br_nfe/product/nfe/item_tax/cofins.rb +0 -0
  43. data/lib/br_nfe/product/nfe/item_tax/cofins_st.rb +0 -0
  44. data/lib/br_nfe/product/nfe/item_tax/icms.rb +0 -0
  45. data/lib/br_nfe/product/nfe/item_tax/icms_uf_destino.rb +0 -0
  46. data/lib/br_nfe/product/nfe/item_tax/importacao.rb +0 -0
  47. data/lib/br_nfe/product/nfe/item_tax/ipi.rb +0 -0
  48. data/lib/br_nfe/product/nfe/item_tax/issqn.rb +0 -0
  49. data/lib/br_nfe/product/nfe/item_tax/pis.rb +0 -0
  50. data/lib/br_nfe/product/nfe/item_tax/pis_st.rb +0 -0
  51. data/lib/br_nfe/product/nfe/processo_referencia.rb +0 -0
  52. data/lib/br_nfe/product/nfe/transporte/base.rb +0 -0
  53. data/lib/br_nfe/product/nfe/transporte/transportador.rb +0 -0
  54. data/lib/br_nfe/product/nfe/transporte/veiculo.rb +0 -0
  55. data/lib/br_nfe/product/nfe/transporte/volume.rb +0 -0
  56. data/lib/br_nfe/product/nota_fiscal.rb +5 -0
  57. data/lib/br_nfe/product/operation/base.rb +118 -44
  58. data/lib/br_nfe/product/operation/nfe_autorizacao.rb +3 -29
  59. data/lib/br_nfe/product/operation/nfe_consulta_protocolo.rb +2 -27
  60. data/lib/br_nfe/product/operation/nfe_download_nf.rb +6 -28
  61. data/lib/br_nfe/product/operation/nfe_inutilizacao.rb +2 -27
  62. data/lib/br_nfe/product/operation/nfe_recepcao_evento.rb +6 -27
  63. data/lib/br_nfe/product/operation/nfe_ret_autorizacao.rb +2 -27
  64. data/lib/br_nfe/product/operation/nfe_status_servico.rb +2 -27
  65. data/lib/br_nfe/product/reader/destinatario.rb +39 -0
  66. data/lib/br_nfe/product/reader/emitente.rb +39 -0
  67. data/lib/br_nfe/product/reader/endereco_retirada_entrega.rb +27 -0
  68. data/lib/br_nfe/product/reader/fatura.rb +41 -0
  69. data/lib/br_nfe/product/reader/item.rb +236 -0
  70. data/lib/br_nfe/product/reader/nfe.rb +200 -0
  71. data/lib/br_nfe/product/reader/transporte.rb +79 -0
  72. data/lib/br_nfe/product/response/base.rb +1 -1
  73. data/lib/br_nfe/product/response/build/base.rb +19 -9
  74. data/lib/br_nfe/product/response/build/nfe_autorizacao.rb +27 -15
  75. data/lib/br_nfe/product/response/build/nfe_consulta_protocolo.rb +35 -38
  76. data/lib/br_nfe/product/response/build/nfe_inutilizacao.rb +18 -16
  77. data/lib/br_nfe/product/response/build/nfe_recepcao_evento.rb +96 -0
  78. data/lib/br_nfe/product/response/build/nfe_ret_autorizacao.rb +11 -8
  79. data/lib/br_nfe/product/response/build/nfe_status_servico.rb +13 -10
  80. data/lib/br_nfe/product/response/event.rb +24 -3
  81. data/lib/br_nfe/product/response/nfe_autorizacao.rb +3 -2
  82. data/lib/br_nfe/product/response/nfe_consulta_protocolo.rb +1 -0
  83. data/lib/br_nfe/product/response/nfe_inutilizacao.rb +0 -0
  84. data/lib/br_nfe/product/response/nfe_recepcao_evento.rb +20 -0
  85. data/lib/br_nfe/product/response/nfe_ret_autorizacao.rb +0 -0
  86. data/lib/br_nfe/product/response/nfe_status_servico.rb +0 -0
  87. data/lib/br_nfe/product/xml/_signed_info_sh1.xml.slim +0 -0
  88. data/lib/br_nfe/product/xml/_tc_cpf_cnpj.xml.slim +0 -0
  89. data/lib/br_nfe/product/xml/signature_sh1.xml.slim +0 -0
  90. data/lib/br_nfe/product/xml/soap_env.xml.slim +1 -1
  91. data/lib/br_nfe/product/xml/v1_00/evento/infEventoCancelamento.xml.slim +0 -0
  92. data/lib/br_nfe/product/xml/v1_00/root/NfeDownloadNf.xml.slim +0 -0
  93. data/lib/br_nfe/product/xml/v1_00/root/NfeRecepcaoEvento.xml.slim +0 -0
  94. data/lib/br_nfe/product/xml/v2_00/_tc_endereco.xml.slim +0 -0
  95. data/lib/br_nfe/product/xml/v2_00/_tc_infNFe.xml.slim +0 -0
  96. data/lib/br_nfe/product/xml/v2_00/infInut.xml.slim +0 -0
  97. data/lib/br_nfe/product/xml/v2_00/infNFe.xml.slim +0 -0
  98. data/lib/br_nfe/product/xml/v2_00/infNFe/NFe.xml.slim +0 -0
  99. data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_cobr.xml.slim +0 -0
  100. data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_dest.xml.slim +0 -0
  101. data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_det.xml.slim +0 -0
  102. data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_emit.xml.slim +0 -0
  103. data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_entrega.xml.slim +0 -0
  104. data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_exporta.xml.slim +0 -0
  105. data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_ide.xml.slim +0 -0
  106. data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_infAdic.xml.slim +0 -0
  107. data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_retirada.xml.slim +0 -0
  108. data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_total.xml.slim +0 -0
  109. data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_transp.xml.slim +0 -0
  110. data/lib/br_nfe/product/xml/v2_00/infNFe/det/_tc_imposto.xml.slim +0 -0
  111. data/lib/br_nfe/product/xml/v2_00/infNFe/det/_tc_prod.xml.slim +0 -0
  112. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS00.xml.slim +0 -0
  113. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS10.xml.slim +0 -0
  114. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS101.xml.slim +0 -0
  115. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS102.xml.slim +0 -0
  116. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS20.xml.slim +0 -0
  117. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS201.xml.slim +0 -0
  118. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS202.xml.slim +0 -0
  119. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS30.xml.slim +0 -0
  120. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS40.xml.slim +0 -0
  121. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS500.xml.slim +0 -0
  122. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS51.xml.slim +0 -0
  123. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS60.xml.slim +0 -0
  124. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS70.xml.slim +0 -0
  125. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS90.xml.slim +0 -0
  126. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS900.xml.slim +0 -0
  127. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/_tc_COFINS.xml.slim +0 -0
  128. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/_tc_COFINS_ST.xml.slim +0 -0
  129. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/_tc_ICMS.xml.slim +0 -0
  130. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/_tc_II.xml.slim +0 -0
  131. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/_tc_IPI.xml.slim +0 -0
  132. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/_tc_PIS.xml.slim +0 -0
  133. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/_tc_PIS_ST.xml.slim +0 -0
  134. data/lib/br_nfe/product/xml/v2_00/infNFe/det/prod/_tc_di.xml.slim +0 -0
  135. data/lib/br_nfe/product/xml/v2_00/infNFe/transp/_tc_retTransp.xml.slim +0 -0
  136. data/lib/br_nfe/product/xml/v2_00/infNFe/transp/_tc_transporta.xml.slim +0 -0
  137. data/lib/br_nfe/product/xml/v2_00/infNFe/transp/_tc_vol.xml.slim +0 -0
  138. data/lib/br_nfe/product/xml/v2_00/root/NfeAutorizacao.xml.slim +0 -0
  139. data/lib/br_nfe/product/xml/v2_00/root/NfeInutilizacao.xml.slim +0 -0
  140. data/lib/br_nfe/product/xml/v2_00/root/NfeRetAutorizacao.xml.slim +0 -0
  141. data/lib/br_nfe/product/xml/v2_00/root/NfeStatusServico.xml.slim +0 -0
  142. data/lib/br_nfe/product/xml/v2_01/root/NfeConsultaProtocolo.xml.slim +0 -0
  143. data/lib/br_nfe/product/xml/v3_10/_tc_infNFe.xml.slim +0 -0
  144. data/lib/br_nfe/product/xml/v3_10/infNFe/_tc_dest.xml.slim +1 -1
  145. data/lib/br_nfe/product/xml/v3_10/infNFe/_tc_det.xml.slim +0 -0
  146. data/lib/br_nfe/product/xml/v3_10/infNFe/_tc_exporta.xml.slim +0 -0
  147. data/lib/br_nfe/product/xml/v3_10/infNFe/_tc_ide.xml.slim +0 -0
  148. data/lib/br_nfe/product/xml/v3_10/infNFe/_tc_pag.xml.slim +0 -0
  149. data/lib/br_nfe/product/xml/v3_10/infNFe/_tc_total.xml.slim +0 -0
  150. data/lib/br_nfe/product/xml/v3_10/infNFe/det/_tc_imposto.xml.slim +0 -0
  151. data/lib/br_nfe/product/xml/v3_10/infNFe/det/_tc_prod.xml.slim +0 -0
  152. data/lib/br_nfe/product/xml/v3_10/infNFe/det/imposto/ICMS/_tc_ICMS20.xml.slim +0 -0
  153. data/lib/br_nfe/product/xml/v3_10/infNFe/det/imposto/ICMS/_tc_ICMS30.xml.slim +0 -0
  154. data/lib/br_nfe/product/xml/v3_10/infNFe/det/imposto/ICMS/_tc_ICMS40.xml.slim +0 -0
  155. data/lib/br_nfe/product/xml/v3_10/infNFe/det/imposto/ICMS/_tc_ICMS51.xml.slim +0 -0
  156. data/lib/br_nfe/product/xml/v3_10/infNFe/det/imposto/ICMS/_tc_ICMS70.xml.slim +0 -0
  157. data/lib/br_nfe/product/xml/v3_10/infNFe/det/imposto/ICMS/_tc_ICMS90.xml.slim +0 -0
  158. data/lib/br_nfe/product/xml/v3_10/infNFe/det/imposto/_tc_ICMSUFDest.xml.slim +0 -0
  159. data/lib/br_nfe/product/xml/v3_10/infNFe/det/imposto/_tc_ISSQN.xml.slim +0 -0
  160. data/lib/br_nfe/product/xml/v3_10/infNFe/det/prod/_tc_det_export.xml.slim +0 -0
  161. data/lib/br_nfe/product/xml/v3_10/infNFe/det/prod/_tc_di.xml.slim +0 -0
  162. data/lib/br_nfe/product/xml/v3_10/root/NfeAutorizacao.xml.slim +0 -0
  163. data/lib/br_nfe/service/association/have_intermediario.rb +0 -0
  164. data/lib/br_nfe/service/association/have_rps.rb +0 -0
  165. data/lib/br_nfe/service/base.rb +0 -0
  166. data/lib/br_nfe/service/betha/base.rb +0 -0
  167. data/lib/br_nfe/service/betha/v1/cancela_nfse.rb +1 -1
  168. data/lib/br_nfe/service/betha/v1/consulta_lote_rps.rb +1 -1
  169. data/lib/br_nfe/service/betha/v1/consulta_nfs_por_rps.rb +1 -1
  170. data/lib/br_nfe/service/betha/v1/consulta_nfse.rb +1 -1
  171. data/lib/br_nfe/service/betha/v1/consulta_situacao_lote_rps.rb +1 -1
  172. data/lib/br_nfe/service/betha/v1/gateway.rb +0 -0
  173. data/lib/br_nfe/service/betha/v1/recepcao_lote_rps.rb +1 -1
  174. data/lib/br_nfe/service/betha/v1/xml/_tc_identificacao_prestador.xml.slim +0 -0
  175. data/lib/br_nfe/service/betha/v1/xml/_tc_pedido_cancelamento.xml.slim +0 -0
  176. data/lib/br_nfe/service/concerns/rules/cancelamento_nfs.rb +0 -0
  177. data/lib/br_nfe/service/concerns/rules/consulta_nfs_por_rps.rb +0 -0
  178. data/lib/br_nfe/service/concerns/rules/consulta_nfse.rb +0 -0
  179. data/lib/br_nfe/service/concerns/rules/recepcao_lote_rps.rb +0 -0
  180. data/lib/br_nfe/service/concerns/values_ts/service_v1.rb +0 -0
  181. data/lib/br_nfe/service/destinatario.rb +0 -0
  182. data/lib/br_nfe/service/emitente.rb +0 -0
  183. data/lib/br_nfe/service/intermediario.rb +0 -0
  184. data/lib/br_nfe/service/item.rb +0 -0
  185. data/lib/br_nfe/service/response/build/base.rb +0 -0
  186. data/lib/br_nfe/service/response/build/cancelamento.rb +0 -0
  187. data/lib/br_nfe/service/response/build/consulta_lote_rps.rb +0 -0
  188. data/lib/br_nfe/service/response/build/consulta_nfs_por_rps.rb +0 -0
  189. data/lib/br_nfe/service/response/build/consulta_nfse.rb +0 -0
  190. data/lib/br_nfe/service/response/build/consulta_situacao_lote_rps.rb +0 -0
  191. data/lib/br_nfe/service/response/build/invoice_build.rb +0 -0
  192. data/lib/br_nfe/service/response/build/recepcao_lote_rps.rb +0 -0
  193. data/lib/br_nfe/service/response/cancelamento.rb +0 -0
  194. data/lib/br_nfe/service/response/consulta_lote_rps.rb +0 -0
  195. data/lib/br_nfe/service/response/consulta_nfs_por_rps.rb +0 -0
  196. data/lib/br_nfe/service/response/consulta_nfse.rb +0 -0
  197. data/lib/br_nfe/service/response/consulta_situacao_lote_rps.rb +0 -0
  198. data/lib/br_nfe/service/response/default.rb +0 -0
  199. data/lib/br_nfe/service/response/nota_fiscal.rb +0 -0
  200. data/lib/br_nfe/service/response/paths/v1/tc_nfse.rb +0 -0
  201. data/lib/br_nfe/service/response/recepcao_lote_rps.rb +0 -0
  202. data/lib/br_nfe/service/rps.rb +0 -0
  203. data/lib/br_nfe/service/sc/florianopolis/base.rb +0 -0
  204. data/lib/br_nfe/service/sc/florianopolis/cancellation.rb +0 -0
  205. data/lib/br_nfe/service/sc/florianopolis/emission_rps.rb +0 -0
  206. data/lib/br_nfe/service/sc/florianopolis/xml/_address.xml.slim +0 -0
  207. data/lib/br_nfe/service/sc/florianopolis/xml/_contact.xml.slim +0 -0
  208. data/lib/br_nfe/service/sc/florianopolis/xml/_service_item.xml.slim +0 -0
  209. data/lib/br_nfe/service/sc/florianopolis/xml/cancellation.xml.slim +0 -0
  210. data/lib/br_nfe/service/sc/florianopolis/xml/inf_requisicao.xml.slim +0 -0
  211. data/lib/br_nfe/service/simpliss/v1/base.rb +1 -1
  212. data/lib/br_nfe/service/simpliss/v1/cancela_nfse.rb +0 -0
  213. data/lib/br_nfe/service/simpliss/v1/consulta_lote_rps.rb +0 -0
  214. data/lib/br_nfe/service/simpliss/v1/consulta_nfs_por_rps.rb +0 -0
  215. data/lib/br_nfe/service/simpliss/v1/consulta_nfse.rb +0 -0
  216. data/lib/br_nfe/service/simpliss/v1/consulta_situacao_lote_rps.rb +0 -0
  217. data/lib/br_nfe/service/simpliss/v1/recepcao_lote_rps.rb +0 -0
  218. data/lib/br_nfe/service/simpliss/v1/xml/_login.xml.slim +0 -0
  219. data/lib/br_nfe/service/simpliss/v1/xml/_tc_dados_servico.xml.slim +0 -0
  220. data/lib/br_nfe/service/simpliss/v1/xml/_tc_item_servico.xml.slim +0 -0
  221. data/lib/br_nfe/service/simpliss/v1/xml/servico_cancelar_nfse_envio.xml.slim +0 -0
  222. data/lib/br_nfe/service/simpliss/v1/xml/servico_consultar_lote_rps_envio.xml.slim +0 -0
  223. data/lib/br_nfe/service/simpliss/v1/xml/servico_consultar_nfse_envio.xml.slim +0 -0
  224. data/lib/br_nfe/service/simpliss/v1/xml/servico_consultar_nfse_rps_envio.xml.slim +0 -0
  225. data/lib/br_nfe/service/simpliss/v1/xml/servico_consultar_situacao_lote_rps_envio.xml.slim +0 -0
  226. data/lib/br_nfe/service/simpliss/v1/xml/servico_enviar_lote_rps_envio.xml.slim +0 -0
  227. data/lib/br_nfe/service/thema/v1/base.rb +0 -0
  228. data/lib/br_nfe/service/thema/v1/cancela_nfse.rb +1 -1
  229. data/lib/br_nfe/service/thema/v1/consulta_lote_rps.rb +1 -1
  230. data/lib/br_nfe/service/thema/v1/consulta_nfs_por_rps.rb +1 -1
  231. data/lib/br_nfe/service/thema/v1/consulta_nfse.rb +1 -1
  232. data/lib/br_nfe/service/thema/v1/consulta_situacao_lote_rps.rb +0 -0
  233. data/lib/br_nfe/service/thema/v1/recepcao_lote_rps.rb +1 -1
  234. data/lib/br_nfe/service/thema/v1/recepcao_lote_rps_limitado.rb +0 -0
  235. data/lib/br_nfe/service/xml/v1/_tc_contato.xml.slim +0 -0
  236. data/lib/br_nfe/service/xml/v1/_tc_cpf_cnpj.xml.slim +0 -0
  237. data/lib/br_nfe/service/xml/v1/_tc_dados_construcao_civil.xml.slim +0 -0
  238. data/lib/br_nfe/service/xml/v1/_tc_dados_prestador.xml.slim +0 -0
  239. data/lib/br_nfe/service/xml/v1/_tc_dados_servico.xml.slim +0 -0
  240. data/lib/br_nfe/service/xml/v1/_tc_dados_tomador.xml.slim +0 -0
  241. data/lib/br_nfe/service/xml/v1/_tc_endereco.xml.slim +0 -0
  242. data/lib/br_nfe/service/xml/v1/_tc_identificacao_intermediario_servico.xml.slim +0 -0
  243. data/lib/br_nfe/service/xml/v1/_tc_identificacao_nfse.xml.slim +0 -0
  244. data/lib/br_nfe/service/xml/v1/_tc_identificacao_orgao_gerador.xml.slim +0 -0
  245. data/lib/br_nfe/service/xml/v1/_tc_identificacao_prestador.xml.slim +0 -0
  246. data/lib/br_nfe/service/xml/v1/_tc_identificacao_rps.xml.slim +0 -0
  247. data/lib/br_nfe/service/xml/v1/_tc_identificacao_tomador.xml.slim +0 -0
  248. data/lib/br_nfe/service/xml/v1/_tc_inf_pedido_cancelamento.xml.slim +0 -0
  249. data/lib/br_nfe/service/xml/v1/_tc_inf_rps.xml.slim +0 -0
  250. data/lib/br_nfe/service/xml/v1/_tc_lote_rps.xml.slim +0 -0
  251. data/lib/br_nfe/service/xml/v1/_tc_pedido_cancelamento.xml.slim +0 -0
  252. data/lib/br_nfe/service/xml/v1/_tc_rps.xml.slim +0 -0
  253. data/lib/br_nfe/service/xml/v1/_tc_valores.xml.slim +0 -0
  254. data/lib/br_nfe/service/xml/v1/servico_cancelar_nfse_envio.xml.slim +0 -0
  255. data/lib/br_nfe/service/xml/v1/servico_consultar_lote_rps_envio.xml.slim +0 -0
  256. data/lib/br_nfe/service/xml/v1/servico_consultar_nfse_envio.xml.slim +0 -0
  257. data/lib/br_nfe/service/xml/v1/servico_consultar_nfse_rps_envio.xml.slim +0 -0
  258. data/lib/br_nfe/service/xml/v1/servico_consultar_situacao_lote_rps_envio.xml.slim +0 -0
  259. data/lib/br_nfe/service/xml/v1/servico_enviar_lote_rps_envio.xml.slim +0 -0
  260. data/lib/br_nfe/version.rb +1 -1
  261. data/lib/br_nfe/xml/_signed_info_sh1.xml.slim +0 -0
  262. data/lib/br_nfe/xml/signature_sh1.xml.slim +0 -0
  263. data/lib/br_nfe/xml/soap_env.xml.slim +0 -0
  264. data/lib/config/locales/br_nfe/en/product/nfe/cobranca/fatura.yml +0 -0
  265. data/lib/config/locales/br_nfe/en/product/nfe/declaracao_importacao.yml +0 -0
  266. data/lib/config/locales/br_nfe/en/product/nfe/item.yml +0 -0
  267. data/lib/config/locales/br_nfe/en/product/nfe/item_tax/icms_uf_destino.yml +0 -0
  268. data/lib/config/locales/br_nfe/en/product/nfe/transporte/base.yml +0 -0
  269. data/lib/config/locales/br_nfe/en/product/nota_fiscal.yml +0 -0
  270. data/lib/config/locales/br_nfe/en/product/operation/nfe_autorizacao.yml +0 -0
  271. data/lib/config/locales/br_nfe/en/product/operation/nfe_recepcao_evento.yml +0 -0
  272. data/lib/config/locales/br_nfe/pt-BR/product/nfe/cobranca/fatura.yml +0 -0
  273. data/lib/config/locales/br_nfe/pt-BR/product/nfe/declaracao_importacao.yml +0 -0
  274. data/lib/config/locales/br_nfe/pt-BR/product/nfe/item.yml +0 -0
  275. data/lib/config/locales/br_nfe/pt-BR/product/nfe/item_tax/icms_uf_destino.yml +0 -0
  276. data/lib/config/locales/br_nfe/pt-BR/product/nfe/transporte/base.yml +0 -0
  277. data/lib/config/locales/br_nfe/pt-BR/product/nota_fiscal.yml +0 -0
  278. data/lib/config/locales/br_nfe/pt-BR/product/operation/nfe_autorizacao.yml +0 -0
  279. data/lib/config/locales/br_nfe/pt-BR/product/operation/nfe_recepcao_evento.yml +0 -0
  280. data/lib/config/settings/nfe/reader_xml_paths.yml +372 -0
  281. data/lib/config/settings/nfe/v3_10/operation.yml +843 -0
  282. data/lib/config/settings/nfe/v3_10/soap_client.yml +804 -0
  283. data/lib/config/settings/nfe/v3_10/xml_paths.yml +577 -0
  284. data/lib/config/settings/nfse.yml +3 -0
  285. data/test/br_nfe/association/have_address_test.rb +0 -0
  286. data/test/br_nfe/association/have_condicao_pagamento_test.rb +0 -0
  287. data/test/br_nfe/association/have_destinatario_test.rb +0 -0
  288. data/test/br_nfe/association/have_emitente_test.rb +0 -0
  289. data/test/br_nfe/base_test.rb +26 -65
  290. data/test/br_nfe/condicao_pagamento_test.rb +0 -0
  291. data/test/br_nfe/endereco_test.rb +0 -0
  292. data/test/br_nfe/helper/cpf_cnpj_test.rb +0 -0
  293. data/test/br_nfe/person_test.rb +0 -0
  294. data/test/br_nfe/product/destinatario_test.rb +0 -0
  295. data/test/br_nfe/product/emitente_test.rb +0 -0
  296. data/test/br_nfe/product/evento/base_test.rb +0 -0
  297. data/test/br_nfe/product/evento/cancelamento_test.rb +0 -0
  298. data/test/br_nfe/product/nfe/adicao_importacao_test.rb +0 -0
  299. data/test/br_nfe/product/nfe/cobranca/duplicata_test.rb +0 -0
  300. data/test/br_nfe/product/nfe/cobranca/fatura_test.rb +0 -0
  301. data/test/br_nfe/product/nfe/cobranca/pagamento_test.rb +0 -0
  302. data/test/br_nfe/product/nfe/declaracao_importacao_test.rb +0 -0
  303. data/test/br_nfe/product/nfe/detalhe_exportacao_test.rb +0 -0
  304. data/test/br_nfe/product/nfe/item_tax/cofins_st_test.rb +0 -0
  305. data/test/br_nfe/product/nfe/item_tax/cofins_test.rb +0 -0
  306. data/test/br_nfe/product/nfe/item_tax/icms_test.rb +0 -0
  307. data/test/br_nfe/product/nfe/item_tax/icms_uf_destino_test.rb +0 -0
  308. data/test/br_nfe/product/nfe/item_tax/importacao_test.rb +0 -0
  309. data/test/br_nfe/product/nfe/item_tax/ipi_test.rb +0 -0
  310. data/test/br_nfe/product/nfe/item_tax/issqn_test.rb +0 -0
  311. data/test/br_nfe/product/nfe/item_tax/pis_st_test.rb +0 -0
  312. data/test/br_nfe/product/nfe/item_tax/pis_test.rb +0 -0
  313. data/test/br_nfe/product/nfe/item_test.rb +0 -0
  314. data/test/br_nfe/product/nfe/processo_referencia_test.rb +0 -0
  315. data/test/br_nfe/product/nfe/transporte/base_test.rb +0 -0
  316. data/test/br_nfe/product/nfe/transporte/transportador_test.rb +0 -0
  317. data/test/br_nfe/product/nfe/transporte/veiculo_test.rb +0 -0
  318. data/test/br_nfe/product/nfe/transporte/volume_test.rb +0 -0
  319. data/test/br_nfe/product/nota_fiscal_test.rb +0 -0
  320. data/test/br_nfe/product/operation/base_test.rb +197 -175
  321. data/test/br_nfe/product/operation/nfe_autorizacao_test.rb +719 -282
  322. data/test/br_nfe/product/operation/nfe_consulta_protocolo_test.rb +745 -305
  323. data/test/br_nfe/product/operation/nfe_download_nf_test.rb +0 -51
  324. data/test/br_nfe/product/operation/nfe_inutilizacao_test.rb +505 -88
  325. data/test/br_nfe/product/operation/nfe_recepcao_evento_test.rb +83 -36
  326. data/test/br_nfe/product/operation/nfe_ret_autorizacao_test.rb +683 -244
  327. data/test/br_nfe/product/operation/nfe_status_servico_test.rb +515 -74
  328. data/test/br_nfe/product/reader/nfe_test.rb +2535 -0
  329. data/test/br_nfe/product/response/base_test.rb +0 -0
  330. data/test/br_nfe/product/response/build/base_test.rb +0 -0
  331. data/test/br_nfe/product/response/nfe_ret_autorizacao_test.rb +0 -0
  332. data/test/br_nfe/service/association/have_intermediario_test.rb +0 -0
  333. data/test/br_nfe/service/association/have_rps_test.rb +0 -0
  334. data/test/br_nfe/service/base_test.rb +1 -1
  335. data/test/br_nfe/service/betha/base_test.rb +0 -0
  336. data/test/br_nfe/service/betha/v1/cancela_nfse_test.rb +4 -4
  337. data/test/br_nfe/service/betha/v1/consulta_lote_rps_test.rb +4 -4
  338. data/test/br_nfe/service/betha/v1/consulta_nfs_por_rps_test.rb +4 -4
  339. data/test/br_nfe/service/betha/v1/consulta_nfse_test.rb +4 -4
  340. data/test/br_nfe/service/betha/v1/consulta_situacao_lote_rps_test.rb +4 -4
  341. data/test/br_nfe/service/betha/v1/gateway_test.rb +0 -0
  342. data/test/br_nfe/service/betha/v1/recepcao_lote_rps_test.rb +4 -4
  343. data/test/br_nfe/service/betha/v1/xsd/TiposNFe_v01.xsd +0 -0
  344. data/test/br_nfe/service/betha/v1/xsd/nfse_v01.xsd +0 -0
  345. data/test/br_nfe/service/betha/v1/xsd/servico_cancelar_nfse_envio_v01.xsd +0 -0
  346. data/test/br_nfe/service/betha/v1/xsd/servico_consultar_lote_rps_envio_v01.xsd +0 -0
  347. data/test/br_nfe/service/betha/v1/xsd/servico_consultar_nfse_envio_v01.xsd +0 -0
  348. data/test/br_nfe/service/betha/v1/xsd/servico_consultar_nfse_rps_envio_v01.xsd +0 -0
  349. data/test/br_nfe/service/betha/v1/xsd/servico_consultar_situacao_lote_rps_envio_v01.xsd +0 -0
  350. data/test/br_nfe/service/betha/v1/xsd/servico_enviar_lote_rps_envio_v01.xsd +0 -0
  351. data/test/br_nfe/service/betha/v1/xsd/xmldsig-core-schema.xsd +0 -0
  352. data/test/br_nfe/service/betha/v1/xsd/xmldsig-core-schema_v01.xsd +0 -0
  353. data/test/br_nfe/service/concerns/rules/cancelamento_nfs_test.rb +0 -0
  354. data/test/br_nfe/service/concerns/rules/consulta_nfs_por_rps_test.rb +0 -0
  355. data/test/br_nfe/service/concerns/rules/consulta_nfse_test.rb +0 -0
  356. data/test/br_nfe/service/concerns/rules/recepcao_lote_rps_test.rb +0 -0
  357. data/test/br_nfe/service/concerns/values_ts/service_v1_test.rb +0 -0
  358. data/test/br_nfe/service/destinatario_test.rb +0 -0
  359. data/test/br_nfe/service/emitente_test.rb +0 -0
  360. data/test/br_nfe/service/intermediario_test.rb +0 -0
  361. data/test/br_nfe/service/item_test.rb +0 -0
  362. data/test/br_nfe/service/response/build/base_test.rb +0 -0
  363. data/test/br_nfe/service/response/default_test.rb +0 -0
  364. data/test/br_nfe/service/response/nota_fiscal_test.rb +0 -0
  365. data/test/br_nfe/service/response/paths/v1/tc_nfse_test.rb +0 -0
  366. data/test/br_nfe/service/rps_test.rb +0 -0
  367. data/test/br_nfe/service/sc/florianopolis/XSD/TiposNFSe_v2.0.xsd +0 -0
  368. data/test/br_nfe/service/sc/florianopolis/XSD/xmldsig-core-schema.xsd +0 -0
  369. data/test/br_nfe/service/sc/florianopolis/base_test.rb +0 -0
  370. data/test/br_nfe/service/sc/florianopolis/cancellation_test.rb +0 -0
  371. data/test/br_nfe/service/sc/florianopolis/emission_rps_test.rb +0 -0
  372. data/test/br_nfe/service/simpliss/v1/base_test.rb +3 -3
  373. data/test/br_nfe/service/simpliss/v1/cancela_nfse_test.rb +1 -1
  374. data/test/br_nfe/service/simpliss/v1/consulta_lote_rps_test.rb +1 -1
  375. data/test/br_nfe/service/simpliss/v1/consulta_nfs_por_rps_test.rb +1 -1
  376. data/test/br_nfe/service/simpliss/v1/consulta_nfse_test.rb +1 -1
  377. data/test/br_nfe/service/simpliss/v1/consulta_situacao_lote_rps_test.rb +1 -1
  378. data/test/br_nfe/service/simpliss/v1/recepcao_lote_rps_test.rb +1 -1
  379. data/test/br_nfe/service/simpliss/v1/xsd/nfse_3.xsd +0 -0
  380. data/test/br_nfe/service/simpliss/v1/xsd/xmldsig-core-schema20020212.xsd +0 -0
  381. data/test/br_nfe/service/thema/v1/base_test.rb +0 -0
  382. data/test/br_nfe/service/thema/v1/cancela_nfse_test.rb +6 -6
  383. data/test/br_nfe/service/thema/v1/consulta_lote_rps_test.rb +6 -6
  384. data/test/br_nfe/service/thema/v1/consulta_nfs_por_rps_test.rb +6 -6
  385. data/test/br_nfe/service/thema/v1/consulta_nfse_test.rb +6 -6
  386. data/test/br_nfe/service/thema/v1/consulta_situacao_lote_rps_test.rb +6 -6
  387. data/test/br_nfe/service/thema/v1/recepcao_lote_rps_limitado_test.rb +6 -6
  388. data/test/br_nfe/service/thema/v1/recepcao_lote_rps_test.rb +6 -6
  389. data/test/br_nfe/service/thema/v1/xsd/nfse.xsd +0 -0
  390. data/test/br_nfe/service/thema/v1/xsd/xmldsig-core-schema20020212.xsd +0 -0
  391. data/test/br_nfe/service/xsd/v1/nfse.xsd +0 -0
  392. data/test/br_nfe/service/xsd/v1/xmldsig-core-schema20020212.xsd +0 -0
  393. data/test/cert.pfx +0 -0
  394. data/test/factories/base.rb +0 -0
  395. data/test/factories/condicao_pagamento.rb +0 -0
  396. data/test/factories/endereco.rb +0 -0
  397. data/test/factories/person.rb +0 -0
  398. data/test/factories/product/destinatario.rb +0 -0
  399. data/test/factories/product/emitente.rb +0 -0
  400. data/test/factories/product/evento/base.rb +0 -0
  401. data/test/factories/product/evento/cancelamento.rb +0 -0
  402. data/test/factories/product/nfe/adicao_importacao.rb +0 -0
  403. data/test/factories/product/nfe/cobranca/duplicata.rb +0 -0
  404. data/test/factories/product/nfe/cobranca/fatura.rb +0 -0
  405. data/test/factories/product/nfe/cobranca/pagamento.rb +0 -0
  406. data/test/factories/product/nfe/declaracao_importacao.rb +0 -0
  407. data/test/factories/product/nfe/detalhe_exportacao.rb +0 -0
  408. data/test/factories/product/nfe/item.rb +0 -0
  409. data/test/factories/product/nfe/item_tax/cofins.rb +0 -0
  410. data/test/factories/product/nfe/item_tax/cofins_st.rb +0 -0
  411. data/test/factories/product/nfe/item_tax/icms.rb +0 -0
  412. data/test/factories/product/nfe/item_tax/icms_uf_destino.rb +0 -0
  413. data/test/factories/product/nfe/item_tax/importacao.rb +0 -0
  414. data/test/factories/product/nfe/item_tax/ipi.rb +0 -0
  415. data/test/factories/product/nfe/item_tax/issqn.rb +0 -0
  416. data/test/factories/product/nfe/item_tax/pis.rb +0 -0
  417. data/test/factories/product/nfe/item_tax/pis_st.rb +0 -0
  418. data/test/factories/product/nfe/processo_referencia.rb +0 -0
  419. data/test/factories/product/nfe/transporte/base.rb +0 -0
  420. data/test/factories/product/nfe/transporte/transportador.rb +0 -0
  421. data/test/factories/product/nfe/transporte/veiculo.rb +0 -0
  422. data/test/factories/product/nfe/transporte/volume.rb +0 -0
  423. data/test/factories/product/nota_fiscal.rb +0 -0
  424. data/test/factories/product/operation/base.rb +0 -0
  425. data/test/factories/product/operation/nfe_autorizacao.rb +0 -0
  426. data/test/factories/product/operation/nfe_consulta_protocolo.rb +0 -0
  427. data/test/factories/product/operation/nfe_download_nf.rb +0 -0
  428. data/test/factories/product/operation/nfe_inutilizacao.rb +0 -0
  429. data/test/factories/product/operation/nfe_recepcao_evento.rb +0 -0
  430. data/test/factories/product/operation/nfe_ret_autorizacao.rb +0 -0
  431. data/test/factories/product/operation/nfe_status_servico.rb +0 -0
  432. data/test/factories/product/response/base.rb +0 -0
  433. data/test/factories/product/response/build/base.rb +0 -0
  434. data/test/factories/product/response/nfe_ret_autorizacao.rb +0 -0
  435. data/test/factories/service/base.rb +0 -0
  436. data/test/factories/service/betha/base.rb +0 -0
  437. data/test/factories/service/betha/v1/cancela_nfse.rb +0 -0
  438. data/test/factories/service/betha/v1/consulta_lote_rps.rb +0 -0
  439. data/test/factories/service/betha/v1/consulta_nfs_por_rps.rb +0 -0
  440. data/test/factories/service/betha/v1/consulta_nfse.rb +0 -0
  441. data/test/factories/service/betha/v1/consulta_situacao_lote_rps.rb +0 -0
  442. data/test/factories/service/betha/v1/gateway.rb +0 -0
  443. data/test/factories/service/betha/v1/recepcao_lote_rps.rb +0 -0
  444. data/test/factories/service/destinatario.rb +0 -0
  445. data/test/factories/service/emitente.rb +0 -0
  446. data/test/factories/service/intermediario.rb +0 -0
  447. data/test/factories/service/item.rb +0 -0
  448. data/test/factories/service/response/build_response.rb +0 -0
  449. data/test/factories/service/response/default.rb +0 -0
  450. data/test/factories/service/response/nota_fiscal.rb +0 -0
  451. data/test/factories/service/rps.rb +0 -0
  452. data/test/factories/service/sc/florianopolis/base.rb +0 -0
  453. data/test/factories/service/sc/florianopolis/cancellation.rb +0 -0
  454. data/test/factories/service/sc/florianopolis/emission_rps.rb +0 -0
  455. data/test/factories/service/simpliss/v1/base.rb +0 -0
  456. data/test/factories/service/simpliss/v1/cancela_nfse.rb +0 -0
  457. data/test/factories/service/simpliss/v1/consulta_lote_rps.rb +0 -0
  458. data/test/factories/service/simpliss/v1/consulta_nfs_por_rps.rb +0 -0
  459. data/test/factories/service/simpliss/v1/consulta_nfse.rb +0 -0
  460. data/test/factories/service/simpliss/v1/consulta_situacao_lote_rps.rb +0 -0
  461. data/test/factories/service/simpliss/v1/recepcao_lote_rps.rb +0 -0
  462. data/test/factories/service/thema/v1/base.rb +0 -0
  463. data/test/factories/service/thema/v1/cancela_nfse.rb +0 -0
  464. data/test/factories/service/thema/v1/consulta_lote_rps.rb +0 -0
  465. data/test/factories/service/thema/v1/consulta_nfs_por_rps.rb +0 -0
  466. data/test/factories/service/thema/v1/consulta_nfse.rb +0 -0
  467. data/test/factories/service/thema/v1/consulta_situacao_lote_rps.rb +0 -0
  468. data/test/factories/service/thema/v1/recepcao_lote_rps.rb +0 -0
  469. data/test/factories/service/thema/v1/recepcao_lote_rps_limitado.rb +0 -0
  470. data/test/fixtures/product/nfe/v3_10/cancelada.xml +246 -0
  471. data/test/fixtures/product/nfe/v3_10/completa.xml +1650 -0
  472. data/test/fixtures/product/nfe/v3_10/without_proc.xml +264 -0
  473. data/test/fixtures/product/operation/nfe_autorizacao/nfe_signed.xml +0 -0
  474. data/test/fixtures/product/response/v3.10/nfe_autorizacao/async_fail.xml +0 -0
  475. data/test/fixtures/product/response/v3.10/nfe_autorizacao/async_success.xml +0 -0
  476. data/test/fixtures/product/response/v3.10/nfe_autorizacao/nfe/with_proc.xml +0 -0
  477. data/test/fixtures/product/response/v3.10/nfe_autorizacao/nfe/without_proc.xml +0 -0
  478. data/test/fixtures/product/response/v3.10/nfe_autorizacao/original_xml.xml +0 -0
  479. data/test/fixtures/product/response/v3.10/nfe_autorizacao/sync_fail.xml +0 -0
  480. data/test/fixtures/product/response/v3.10/nfe_autorizacao/sync_success.xml +0 -0
  481. data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/event_xml/event_1.xml +0 -0
  482. data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/event_xml/event_2.xml +0 -0
  483. data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/event_xml/event_3.xml +0 -0
  484. data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/event_xml/event_cancel.xml +0 -0
  485. data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/event_xml/one_event.xml +0 -0
  486. data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/fail.xml +0 -0
  487. data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/nfe_original/with_proc.xml +0 -0
  488. data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/nfe_original/without_proc.xml +0 -0
  489. data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/success_many_with_cancel.xml +0 -0
  490. data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/success_many_without_cancel.xml +0 -0
  491. data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/success_one.xml +0 -0
  492. data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/success_without.xml +0 -0
  493. data/test/fixtures/product/response/v3.10/nfe_inutilizacao/fail.xml +0 -0
  494. data/test/fixtures/product/response/v3.10/nfe_inutilizacao/success.xml +0 -0
  495. data/test/fixtures/product/response/v3.10/nfe_recepcao_evento/cancelamento/fail.xml +2 -2
  496. data/test/fixtures/product/response/v3.10/nfe_recepcao_evento/cancelamento/success.xml +0 -0
  497. data/test/fixtures/product/response/v3.10/nfe_recepcao_evento/cancelamento/xml_result_fail_formatted.xml +1 -0
  498. data/test/fixtures/product/response/v3.10/nfe_recepcao_evento/cancelamento/xml_result_success_formatted.xml +1 -0
  499. data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/lot_fail.xml +0 -0
  500. data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/lot_ok_one_invoice_fail.xml +0 -0
  501. data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/lot_ok_one_invoice_fail_and_one_ok.xml +0 -0
  502. data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/lot_ok_one_invoice_ok.xml +0 -0
  503. data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/lot_ok_two_invoice_fail.xml +0 -0
  504. data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/lot_ok_two_invoice_ok.xml +0 -0
  505. data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/nfe/nf_2_with_protocol.xml +0 -0
  506. data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/nfe/nf_2_without_protocol.xml +0 -0
  507. data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/nfe/nf_3_with_protocol.xml +0 -0
  508. data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/nfe/nf_3_without_protocol.xml +0 -0
  509. data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/original_xml/lot.xml +0 -0
  510. data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/original_xml/nfe.xml +0 -0
  511. data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/original_xml/nfeProc.xml +0 -0
  512. data/test/fixtures/product/response/v3.10/nfe_status_servico/fail.xml +0 -0
  513. data/test/fixtures/product/response/v3.10/nfe_status_servico/success.xml +0 -0
  514. data/test/fixtures/product/schemas/CCe_v1.00.xsd +0 -0
  515. data/test/fixtures/product/schemas/EPEC_v1.00.xsd +0 -0
  516. data/test/fixtures/product/schemas/LeiauteCadastroEmissorDFe_v1.01.xsd +0 -0
  517. data/test/fixtures/product/schemas/SuframaInternaliza_v1.00.xsd +0 -0
  518. data/test/fixtures/product/schemas/SuframaVistoria_v1.00.xsd +0 -0
  519. data/test/fixtures/product/schemas/atuCadEmiDFe_v1.01.xsd +0 -0
  520. data/test/fixtures/product/schemas/cabecMsg_v1.02.xsd +0 -0
  521. data/test/fixtures/product/schemas/cadEmiDFe_v1.01.xsd +0 -0
  522. data/test/fixtures/product/schemas/cancNFe_v2.00.xsd +0 -0
  523. data/test/fixtures/product/schemas/confRecebto_v1.00.xsd +0 -0
  524. data/test/fixtures/product/schemas/consCad_v2.00.xsd +0 -0
  525. data/test/fixtures/product/schemas/consDPEC_v1.01.xsd +0 -0
  526. data/test/fixtures/product/schemas/consNFeDest_v1.01.xsd +0 -0
  527. data/test/fixtures/product/schemas/consReciNFe_v2.00.xsd +0 -0
  528. data/test/fixtures/product/schemas/consReciNFe_v3.10.xsd +0 -0
  529. data/test/fixtures/product/schemas/consSitNFe_v2.01.xsd +0 -0
  530. data/test/fixtures/product/schemas/consSitNFe_v3.10.xsd +0 -0
  531. data/test/fixtures/product/schemas/consStatServ_v2.00.xsd +0 -0
  532. data/test/fixtures/product/schemas/consStatServ_v3.10.xsd +0 -0
  533. data/test/fixtures/product/schemas/distDFeInt_v1.00.xsd +0 -0
  534. data/test/fixtures/product/schemas/downloadNFe_v1.00.xsd +0 -0
  535. data/test/fixtures/product/schemas/e110110_v1.00.xsd +0 -0
  536. data/test/fixtures/product/schemas/e110111_v1.00.xsd +0 -0
  537. data/test/fixtures/product/schemas/e110140_v1.00.xsd +0 -0
  538. data/test/fixtures/product/schemas/e111500_v1.00.xsd +0 -0
  539. data/test/fixtures/product/schemas/e111501_v1.00.xsd +0 -0
  540. data/test/fixtures/product/schemas/e111502_v1.00.xsd +0 -0
  541. data/test/fixtures/product/schemas/e111503_v1.00.xsd +0 -0
  542. data/test/fixtures/product/schemas/e210200_v1.00.xsd +0 -0
  543. data/test/fixtures/product/schemas/e210210_v1.00.xsd +0 -0
  544. data/test/fixtures/product/schemas/e210220_v1.00.xsd +0 -0
  545. data/test/fixtures/product/schemas/e210240_v1.00.xsd +0 -0
  546. data/test/fixtures/product/schemas/e411500_v1.00.xsd +0 -0
  547. data/test/fixtures/product/schemas/e411501_v1.00.xsd +0 -0
  548. data/test/fixtures/product/schemas/e411502_v1.00.xsd +0 -0
  549. data/test/fixtures/product/schemas/e411503_v1.00.xsd +0 -0
  550. data/test/fixtures/product/schemas/e990900_v1.00.xsd +0 -0
  551. data/test/fixtures/product/schemas/e990910_v1.00.xsd +0 -0
  552. data/test/fixtures/product/schemas/envCCe_v1.00.xsd +0 -0
  553. data/test/fixtures/product/schemas/envCancelPProrrogNFe_v1.0.xsd +0 -0
  554. data/test/fixtures/product/schemas/envConfRecebto_v1.00.xsd +0 -0
  555. data/test/fixtures/product/schemas/envDPEC_v1.01.xsd +0 -0
  556. data/test/fixtures/product/schemas/envEPEC_v1.00.xsd +0 -0
  557. data/test/fixtures/product/schemas/envEventoCancNFe_v1.00.xsd +0 -0
  558. data/test/fixtures/product/schemas/envEvento_v1.00.xsd +0 -0
  559. data/test/fixtures/product/schemas/envFiscoNfe_v1.0.xsd +0 -0
  560. data/test/fixtures/product/schemas/envPProrrogNFe_v1.0.xsd +0 -0
  561. data/test/fixtures/product/schemas/envRemIndus_v1.00.xsd +0 -0
  562. data/test/fixtures/product/schemas/envSuframaInternaliza_v1.00.xsd +0 -0
  563. data/test/fixtures/product/schemas/envSuframaVistoria_v1.00.xsd +0 -0
  564. data/test/fixtures/product/schemas/enviNFe_v2.00.xsd +0 -0
  565. data/test/fixtures/product/schemas/enviNFe_v3.10.xsd +0 -0
  566. data/test/fixtures/product/schemas/eventoCancNFe_v1.00.xsd +0 -0
  567. data/test/fixtures/product/schemas/eventoEPEC_v0.01.xsd +0 -0
  568. data/test/fixtures/product/schemas/eventoEPEC_v1.00.xsd +0 -0
  569. data/test/fixtures/product/schemas/eventoRemIndus_v1.00.xsd +0 -0
  570. data/test/fixtures/product/schemas/inutNFe_v2.00.xsd +0 -0
  571. data/test/fixtures/product/schemas/inutNFe_v3.10.xsd +0 -0
  572. data/test/fixtures/product/schemas/leiauteCCe_v1.00.xsd +0 -0
  573. data/test/fixtures/product/schemas/leiauteCancNFe_v2.00.xsd +0 -0
  574. data/test/fixtures/product/schemas/leiauteConfRecebto_v1.00.xsd +0 -0
  575. data/test/fixtures/product/schemas/leiauteConsNFeDest_v1.01.xsd +0 -0
  576. data/test/fixtures/product/schemas/leiauteConsSitNFe_v2.01.xsd +0 -0
  577. data/test/fixtures/product/schemas/leiauteConsSitNFe_v3.10.xsd +0 -0
  578. data/test/fixtures/product/schemas/leiauteConsStatServ_v2.00.xsd +0 -0
  579. data/test/fixtures/product/schemas/leiauteConsStatServ_v3.10.xsd +0 -0
  580. data/test/fixtures/product/schemas/leiauteConsultaCadastro_v1.01.xsd +0 -0
  581. data/test/fixtures/product/schemas/leiauteConsultaCadastro_v2.00.xsd +0 -0
  582. data/test/fixtures/product/schemas/leiauteDPEC_v1.01.xsd +0 -0
  583. data/test/fixtures/product/schemas/leiauteDownloadNFe_v1.00.xsd +0 -0
  584. data/test/fixtures/product/schemas/leiauteEPEC_v1.00.xsd +0 -0
  585. data/test/fixtures/product/schemas/leiauteEventoCancNFe_v1.00.xsd +0 -0
  586. data/test/fixtures/product/schemas/leiauteEvento_v1.00.xsd +0 -0
  587. data/test/fixtures/product/schemas/leiauteInutNFe_v2.00.xsd +0 -0
  588. data/test/fixtures/product/schemas/leiauteInutNFe_v3.10.xsd +0 -0
  589. data/test/fixtures/product/schemas/leiauteNFe_v2.00.xsd +0 -0
  590. data/test/fixtures/product/schemas/leiauteNFe_v3.10.xsd +0 -0
  591. data/test/fixtures/product/schemas/leiauteRemIndus_v1.00.xsd +0 -0
  592. data/test/fixtures/product/schemas/leiauteSRE_v1.00.xsd +0 -0
  593. data/test/fixtures/product/schemas/leiauteSuframaInternaliza_v1.00.xsd +0 -0
  594. data/test/fixtures/product/schemas/leiauteSuframaVistoria_v1.00.xsd +0 -0
  595. data/test/fixtures/product/schemas/nfe_v2.00.xsd +0 -0
  596. data/test/fixtures/product/schemas/nfe_v3.10.xsd +0 -0
  597. data/test/fixtures/product/schemas/procCCeNFe_v1.00.xsd +0 -0
  598. data/test/fixtures/product/schemas/procCancNFe_v2.00.xsd +0 -0
  599. data/test/fixtures/product/schemas/procConfRecebtoNFe_v1.00.xsd +0 -0
  600. data/test/fixtures/product/schemas/procEPEC_v1.00.xsd +0 -0
  601. data/test/fixtures/product/schemas/procEventoCancNFe_v1.00.xsd +0 -0
  602. data/test/fixtures/product/schemas/procEventoNFe_v1.00.xsd +0 -0
  603. data/test/fixtures/product/schemas/procEventoNFe_v99.99.xsd +0 -0
  604. data/test/fixtures/product/schemas/procInutNFe_v2.00.xsd +0 -0
  605. data/test/fixtures/product/schemas/procInutNFe_v3.10.xsd +0 -0
  606. data/test/fixtures/product/schemas/procNFe_v2.00.xsd +0 -0
  607. data/test/fixtures/product/schemas/procNFe_v3.10.xsd +0 -0
  608. data/test/fixtures/product/schemas/procRemIndus_v1.00.xsd +0 -0
  609. data/test/fixtures/product/schemas/resEvento_v1.00.xsd +0 -0
  610. data/test/fixtures/product/schemas/resNFe_v1.00.xsd +0 -0
  611. data/test/fixtures/product/schemas/retAtuCadEmiDFe_v1.01.xsd +0 -0
  612. data/test/fixtures/product/schemas/retCancNFe_v2.00.xsd +0 -0
  613. data/test/fixtures/product/schemas/retConsCad_v2.00.xsd +0 -0
  614. data/test/fixtures/product/schemas/retConsDPEC_v1.01.xsd +0 -0
  615. data/test/fixtures/product/schemas/retConsReciNFe_v2.00.xsd +0 -0
  616. data/test/fixtures/product/schemas/retConsReciNFe_v3.10.xsd +0 -0
  617. data/test/fixtures/product/schemas/retConsSitNFe_v2.01.xsd +0 -0
  618. data/test/fixtures/product/schemas/retConsSitNFe_v3.10.xsd +0 -0
  619. data/test/fixtures/product/schemas/retConsStatServ_v2.00.xsd +0 -0
  620. data/test/fixtures/product/schemas/retConsStatServ_v3.10.xsd +0 -0
  621. data/test/fixtures/product/schemas/retDPEC_v1.01.xsd +0 -0
  622. data/test/fixtures/product/schemas/retDistDFeInt_v1.00.xsd +0 -0
  623. data/test/fixtures/product/schemas/retDownloadNFe_v1.00.xsd +0 -0
  624. data/test/fixtures/product/schemas/retEnvCCe_v1.00.xsd +0 -0
  625. data/test/fixtures/product/schemas/retEnvCancelPProrrogNFe_v1.0.xsd +0 -0
  626. data/test/fixtures/product/schemas/retEnvConfRecebto_v1.00.xsd +0 -0
  627. data/test/fixtures/product/schemas/retEnvEPEC_v1.00.xsd +0 -0
  628. data/test/fixtures/product/schemas/retEnvEventoCancNFe_v1.00.xsd +0 -0
  629. data/test/fixtures/product/schemas/retEnvEvento_v1.00.xsd +0 -0
  630. data/test/fixtures/product/schemas/retEnvFiscoNFe_v1.0.xsd +0 -0
  631. data/test/fixtures/product/schemas/retEnvRemIndus_v1.00.xsd +0 -0
  632. data/test/fixtures/product/schemas/retEnvSuframaInternaliza_v1.00.xsd +0 -0
  633. data/test/fixtures/product/schemas/retEnvSuframaVistoria_v1.00.xsd +0 -0
  634. data/test/fixtures/product/schemas/retEnviNFe_v2.00.xsd +0 -0
  635. data/test/fixtures/product/schemas/retEnviNFe_v3.10.xsd +0 -0
  636. data/test/fixtures/product/schemas/retEventoEPEC_v0.01.xsd +0 -0
  637. data/test/fixtures/product/schemas/retInutNFe_v2.00.xsd +0 -0
  638. data/test/fixtures/product/schemas/retInutNFe_v3.10.xsd +0 -0
  639. data/test/fixtures/product/schemas/retPProrrogNFe_v1.0.xsd +0 -0
  640. data/test/fixtures/product/schemas/retconsNFeDest_v1.01.xsd +0 -0
  641. data/test/fixtures/product/schemas/tiposBasico_v1.03.xsd +0 -0
  642. data/test/fixtures/product/schemas/tiposBasico_v1.03_OPENSSL.xsd +0 -0
  643. data/test/fixtures/product/schemas/tiposBasico_v3.10.xsd +0 -0
  644. data/test/fixtures/product/schemas/tiposBasico_v3.10_OPENSSL.xsd +0 -0
  645. data/test/fixtures/product/schemas/tiposDistDFe_v1.00.xsd +0 -0
  646. data/test/fixtures/product/schemas/xmldsig-core-schema_v1.01.xsd +0 -0
  647. data/test/fixtures/product/wsdl/NFeRetAutorizacao.xml +0 -0
  648. data/test/fixtures/product/wsdl/NfeAutorizacao.xml +0 -0
  649. data/test/fixtures/product/wsdl/NfeConsulta2.xml +0 -0
  650. data/test/fixtures/product/wsdl/NfeStatusServico2.xml +0 -0
  651. data/test/fixtures/product/wsdl/RecepcaoEvento.xml +78 -0
  652. data/test/fixtures/product/wsdl/nfeinutilizacao2.xml +0 -0
  653. data/test/fixtures/service/response/betha/v1/cancela_nfse/fault.xml +0 -0
  654. data/test/fixtures/service/response/betha/v1/cancela_nfse/success.xml +0 -0
  655. data/test/fixtures/service/response/betha/v1/consulta_lote_rps/fault.xml +0 -0
  656. data/test/fixtures/service/response/betha/v1/consulta_lote_rps/success.xml +0 -0
  657. data/test/fixtures/service/response/betha/v1/consulta_nfse/fault.xml +0 -0
  658. data/test/fixtures/service/response/betha/v1/consulta_nfse/nfs_empty.xml +0 -0
  659. data/test/fixtures/service/response/betha/v1/consulta_nfse/success.xml +0 -0
  660. data/test/fixtures/service/response/betha/v1/consulta_nfse_por_rps/fault.xml +0 -0
  661. data/test/fixtures/service/response/betha/v1/consulta_nfse_por_rps/success.xml +0 -0
  662. data/test/fixtures/service/response/betha/v1/consulta_situacao_lote_rps/error.xml +0 -0
  663. data/test/fixtures/service/response/betha/v1/consulta_situacao_lote_rps/fault.xml +0 -0
  664. data/test/fixtures/service/response/betha/v1/consulta_situacao_lote_rps/success.xml +0 -0
  665. data/test/fixtures/service/response/betha/v1/consulta_situacao_lote_rps/unprocessed.xml +0 -0
  666. data/test/fixtures/service/response/betha/v1/consulta_situacao_lote_rps/unprocessed_by_code_error.xml +0 -0
  667. data/test/fixtures/service/response/betha/v1/consulta_situacao_lote_rps/unreceived.xml +0 -0
  668. data/test/fixtures/service/response/betha/v1/consulta_situacao_lote_rps/unreceived_by_code_error.xml +0 -0
  669. data/test/fixtures/service/response/betha/v1/recepcao_lote_rps/error.xml +0 -0
  670. data/test/fixtures/service/response/betha/v1/recepcao_lote_rps/success.xml +0 -0
  671. data/test/fixtures/service/response/simpliss/v1/cancela_nfse/fault.xml +0 -0
  672. data/test/fixtures/service/response/simpliss/v1/cancela_nfse/success.xml +0 -0
  673. data/test/fixtures/service/response/simpliss/v1/consulta_lote_rps/fault.xml +0 -0
  674. data/test/fixtures/service/response/simpliss/v1/consulta_lote_rps/nfse_complete.xml +0 -0
  675. data/test/fixtures/service/response/simpliss/v1/consulta_lote_rps/nfse_simple.xml +0 -0
  676. data/test/fixtures/service/response/simpliss/v1/consulta_nfse/fault.xml +0 -0
  677. data/test/fixtures/service/response/simpliss/v1/consulta_nfse/nfs_empty.xml +0 -0
  678. data/test/fixtures/service/response/simpliss/v1/consulta_nfse/nfse_complete.xml +0 -0
  679. data/test/fixtures/service/response/simpliss/v1/consulta_nfse/nfse_simple.xml +0 -0
  680. data/test/fixtures/service/response/simpliss/v1/consulta_nfse_por_rps/fault.xml +0 -0
  681. data/test/fixtures/service/response/simpliss/v1/consulta_nfse_por_rps/nfse_complete.xml +0 -0
  682. data/test/fixtures/service/response/simpliss/v1/consulta_nfse_por_rps/nfse_simple.xml +0 -0
  683. data/test/fixtures/service/response/simpliss/v1/consulta_situacao_lote_rps/error.xml +0 -0
  684. data/test/fixtures/service/response/simpliss/v1/consulta_situacao_lote_rps/fault.xml +0 -0
  685. data/test/fixtures/service/response/simpliss/v1/consulta_situacao_lote_rps/success.xml +0 -0
  686. data/test/fixtures/service/response/simpliss/v1/consulta_situacao_lote_rps/unprocessed.xml +0 -0
  687. data/test/fixtures/service/response/simpliss/v1/consulta_situacao_lote_rps/unreceived.xml +0 -0
  688. data/test/fixtures/service/response/simpliss/v1/recepcao_lote_rps/error.xml +0 -0
  689. data/test/fixtures/service/response/simpliss/v1/recepcao_lote_rps/success.xml +0 -0
  690. data/test/fixtures/service/response/thema/v1/cancela_nfse/fault.xml +0 -0
  691. data/test/fixtures/service/response/thema/v1/cancela_nfse/success.xml +0 -0
  692. data/test/fixtures/service/response/thema/v1/consulta_lote_rps/fault.xml +0 -0
  693. data/test/fixtures/service/response/thema/v1/consulta_lote_rps/nfse_complete.xml +0 -0
  694. data/test/fixtures/service/response/thema/v1/consulta_nfse/fault.xml +0 -0
  695. data/test/fixtures/service/response/thema/v1/consulta_nfse/nfs_empty.xml +0 -0
  696. data/test/fixtures/service/response/thema/v1/consulta_nfse/nfse_complete.xml +0 -0
  697. data/test/fixtures/service/response/thema/v1/consulta_nfse/nfse_simple.xml +0 -0
  698. data/test/fixtures/service/response/thema/v1/consulta_nfse_por_rps/fault.xml +0 -0
  699. data/test/fixtures/service/response/thema/v1/consulta_nfse_por_rps/nfse_complete.xml +0 -0
  700. data/test/fixtures/service/response/thema/v1/consulta_situacao_lote_rps/error.xml +0 -0
  701. data/test/fixtures/service/response/thema/v1/consulta_situacao_lote_rps/fault.xml +0 -0
  702. data/test/fixtures/service/response/thema/v1/consulta_situacao_lote_rps/success.xml +0 -0
  703. data/test/fixtures/service/response/thema/v1/consulta_situacao_lote_rps/unprocessed.xml +0 -0
  704. data/test/fixtures/service/response/thema/v1/consulta_situacao_lote_rps/unreceived.xml +0 -0
  705. data/test/fixtures/service/response/thema/v1/recepcao_lote_rps/error.xml +0 -0
  706. data/test/fixtures/service/response/thema/v1/recepcao_lote_rps/success.xml +0 -0
  707. data/test/fixtures/service/response/thema/v1/recepcao_lote_rps_limitado/error.xml +0 -0
  708. data/test/fixtures/service/response/thema/v1/recepcao_lote_rps_limitado/success.xml +0 -0
  709. data/test/fixtures/service/thema/v1/cancelar_nfse_envio.xml +0 -0
  710. data/test/fixtures/service/thema/v1/cancelar_nfse_envio_signed.xml +0 -0
  711. data/test/fixtures/service/thema/v1/enviar_lote_rps.xml +0 -0
  712. data/test/fixtures/service/thema/v1/enviar_lote_rps_signed.xml +0 -0
  713. data/test/fixtures/service/wsdl/betha/v1/cancelar_nfse.xml +0 -0
  714. data/test/fixtures/service/wsdl/betha/v1/consultar_lote_rps.xml +0 -0
  715. data/test/fixtures/service/wsdl/betha/v1/consultar_nfse.xml +0 -0
  716. data/test/fixtures/service/wsdl/betha/v1/consultar_nfse_por_rps.xml +0 -0
  717. data/test/fixtures/service/wsdl/betha/v1/consultar_situacao_lote_rps.xml +0 -0
  718. data/test/fixtures/service/wsdl/betha/v1/recepcionar_lote_rps.xml +0 -0
  719. data/test/fixtures/service/wsdl/simpliss/v1/nfseservice.xml +0 -0
  720. data/test/fixtures/service/wsdl/thema/v1/nfse_cancelamento.xml +0 -0
  721. data/test/fixtures/service/wsdl/thema/v1/nfse_consulta.xml +0 -0
  722. data/test/fixtures/service/wsdl/thema/v1/nfse_remessa.xml +0 -0
  723. data/test/test_helper.rb +0 -0
  724. metadata +35 -63
  725. data/lib/br_nfe/product/gateway/base.rb +0 -35
  726. data/lib/br_nfe/product/gateway/web_service_am.rb +0 -140
  727. data/lib/br_nfe/product/gateway/web_service_ba.rb +0 -140
  728. data/lib/br_nfe/product/gateway/web_service_ce.rb +0 -162
  729. data/lib/br_nfe/product/gateway/web_service_go.rb +0 -140
  730. data/lib/br_nfe/product/gateway/web_service_mg.rb +0 -140
  731. data/lib/br_nfe/product/gateway/web_service_ms.rb +0 -140
  732. data/lib/br_nfe/product/gateway/web_service_mt.rb +0 -140
  733. data/lib/br_nfe/product/gateway/web_service_pe.rb +0 -140
  734. data/lib/br_nfe/product/gateway/web_service_pr.rb +0 -140
  735. data/lib/br_nfe/product/gateway/web_service_rs.rb +0 -140
  736. data/lib/br_nfe/product/gateway/web_service_sp.rb +0 -140
  737. data/lib/br_nfe/product/gateway/web_service_svan.rb +0 -162
  738. data/lib/br_nfe/product/gateway/web_service_svc_an.rb +0 -131
  739. data/lib/br_nfe/product/gateway/web_service_svc_rs.rb +0 -20
  740. data/lib/br_nfe/product/gateway/web_service_svrs.rb +0 -140
  741. data/test/br_nfe/product/gateway/base_test.rb +0 -16
  742. data/test/br_nfe/product/gateway/web_service_am_test.rb +0 -242
  743. data/test/br_nfe/product/gateway/web_service_ba_test.rb +0 -242
  744. data/test/br_nfe/product/gateway/web_service_ce_test.rb +0 -242
  745. data/test/br_nfe/product/gateway/web_service_go_test.rb +0 -242
  746. data/test/br_nfe/product/gateway/web_service_mg_test.rb +0 -242
  747. data/test/br_nfe/product/gateway/web_service_ms_test.rb +0 -242
  748. data/test/br_nfe/product/gateway/web_service_mt_test.rb +0 -408
  749. data/test/br_nfe/product/gateway/web_service_pe_test.rb +0 -408
  750. data/test/br_nfe/product/gateway/web_service_pr_test.rb +0 -408
  751. data/test/br_nfe/product/gateway/web_service_rs_test.rb +0 -407
  752. data/test/br_nfe/product/gateway/web_service_sp_test.rb +0 -408
  753. data/test/br_nfe/product/gateway/web_service_svan_test.rb +0 -242
  754. data/test/br_nfe/product/gateway/web_service_svc_an_test.rb +0 -185
  755. data/test/br_nfe/product/gateway/web_service_svc_rs_test.rb +0 -185
  756. data/test/br_nfe/product/gateway/web_service_svrs_test.rb +0 -242
  757. data/test/factories/product/gateway/base.rb +0 -5
  758. data/test/factories/product/gateway/web_service_am.rb +0 -5
  759. data/test/factories/product/gateway/web_service_ba.rb +0 -5
  760. data/test/factories/product/gateway/web_service_svrs.rb +0 -5
@@ -3,12 +3,6 @@ require 'test_helper'
3
3
  describe BrNfe::Product::Operation::NfeConsultaProtocolo do
4
4
  subject { FactoryGirl.build(:product_operation_nfe_consulta_protocolo) }
5
5
 
6
- let(:gateway) { FactoryGirl.build(:product_gateway_web_service_svrs) }
7
-
8
- before do
9
- subject.stubs(:gateway).returns(gateway)
10
- end
11
-
12
6
  describe '#aliases' do
13
7
  it { must_have_alias_attribute :chNFe, :chave_nfe }
14
8
  end
@@ -18,31 +12,6 @@ describe BrNfe::Product::Operation::NfeConsultaProtocolo do
18
12
  it { must validate_length_of(:chave_nfe).is_equal_to(44) }
19
13
  end
20
14
 
21
- it 'o método #wsdl deve pegar o valor do método wsdl_consulta_protocolo do gateway ' do
22
- gateway.expects(:wsdl_consulta_protocolo).returns('http://teste.wsdl_consulta_protocolo.com')
23
- subject.wsdl.must_equal 'http://teste.wsdl_consulta_protocolo.com'
24
- end
25
-
26
- it 'o método #method_wsdl deve pegar o valor do método operation_consulta_protocolo do gateway ' do
27
- gateway.expects(:operation_consulta_protocolo).returns(:operation_consulta_protocolo)
28
- subject.method_wsdl.must_equal :operation_consulta_protocolo
29
- end
30
-
31
- it 'o método #gateway_xml_version deve pegar o valor do método version_xml_consulta_protocolo do gateway ' do
32
- gateway.expects(:version_xml_consulta_protocolo).returns(:v3_20)
33
- subject.gateway_xml_version.must_equal :v3_20
34
- end
35
-
36
- it 'o método #url_xmlns deve pegar o valor do método url_xmlns_consulta_protocolo do gateway ' do
37
- gateway.expects(:url_xmlns_consulta_protocolo).returns('http://teste.url_xmlns_consulta_protocolo.com')
38
- subject.url_xmlns.must_equal 'http://teste.url_xmlns_consulta_protocolo.com'
39
- end
40
-
41
- it 'o método #ssl_version deve pegar o valor do método ssl_version_consulta_protocolo do gateway ' do
42
- gateway.expects(:ssl_version_consulta_protocolo).returns(:SSLv1)
43
- subject.ssl_version.must_equal :SSLv1
44
- end
45
-
46
15
  describe '#xml_builder' do
47
16
  it "Deve renderizar o XML e setar o valor na variavel @xml_builder" do
48
17
  subject.expects(:render_xml).returns('<xml>OK</xml>')
@@ -57,293 +26,764 @@ describe BrNfe::Product::Operation::NfeConsultaProtocolo do
57
26
  end
58
27
  end
59
28
 
60
- describe "Validação do XML através do XSD" do
61
- context "for XML Version 2.01" do
62
- before { subject.stubs(:gateway_xml_version).returns(:v2_01) }
63
- it "Deve ser válido em ambiente de produção" do
64
- subject.env = :production
65
- nfe_must_be_valid_by_schema 'consSitNFe_v2.01.xsd'
66
- end
67
- it "Deve ser válido em ambiente de homologação" do
68
- subject.env = :test
69
- nfe_must_be_valid_by_schema 'consSitNFe_v2.01.xsd'
70
- end
29
+ context "Validações para NF-e versão 2.01" do
30
+ before do
31
+ subject.assign_attributes(nfe_version: :v2_01, ibge_code_of_issuer_uf: '42', env: :test)
71
32
  end
72
- context "for XML Version 3.10" do
73
- before { subject.stubs(:gateway_xml_version).returns(:v3_10) }
74
-
75
- it "Deve ser válido em ambiente de produção" do
76
- subject.env = :production
77
- nfe_must_be_valid_by_schema 'consSitNFe_v3.10.xsd'
78
- end
79
- it "Deve ser válido em ambiente de homologação" do
80
- subject.env = :test
81
- nfe_must_be_valid_by_schema 'consSitNFe_v3.10.xsd'
33
+ describe "Validação do XML através do XSD" do
34
+ context "for XML Version 2.01" do
35
+ before { subject.stubs(:gateway_xml_version).returns(:v2_01) }
36
+ it "Deve ser válido em ambiente de produção" do
37
+ subject.env = :production
38
+ nfe_must_be_valid_by_schema 'consSitNFe_v2.01.xsd'
39
+ end
40
+ it "Deve ser válido em ambiente de homologação" do
41
+ subject.env = :test
42
+ nfe_must_be_valid_by_schema 'consSitNFe_v2.01.xsd'
43
+ end
82
44
  end
83
45
  end
84
46
  end
85
-
86
- describe 'REQUEST MUST BE SET RESPONSE CORRECTLY' do
87
- let(:response_fail) { read_fixture('product/response/v3.10/nfe_consulta_protocolo/fail.xml') }
88
- let(:response_success_without_event){ read_fixture('product/response/v3.10/nfe_consulta_protocolo/success_without.xml') }
89
- let(:response_success_one_event) { read_fixture('product/response/v3.10/nfe_consulta_protocolo/success_one.xml') }
90
- let(:response_success_many_events_without_cancel) { read_fixture('product/response/v3.10/nfe_consulta_protocolo/success_many_without_cancel.xml') }
91
- let(:response_success_many_events_with_cancel) { read_fixture('product/response/v3.10/nfe_consulta_protocolo/success_many_with_cancel.xml') }
92
- let(:xml_nfe_without_proc) { read_fixture('product/response/v3.10/nfe_consulta_protocolo/nfe_original/without_proc.xml') }
93
- let(:xml_nfe_with_proc) { read_fixture('product/response/v3.10/nfe_consulta_protocolo/nfe_original/with_proc.xml') }
94
-
47
+ context "Validações para NF-e versão 3.10" do
95
48
  before do
96
- savon.mock!
97
- stub_request(:get, subject.wsdl).to_return(status: 200, body: read_fixture('product/wsdl/NfeConsulta2.xml') )
49
+ subject.assign_attributes(nfe_version: :v3_10, ibge_code_of_issuer_uf: '42', env: :test)
50
+ end
51
+ describe "Validação do XML através do XSD" do
52
+ context "for XML Version 3.10" do
53
+ before { subject.stubs(:gateway_xml_version).returns(:v3_10) }
54
+
55
+ it "Deve ser válido em ambiente de produção" do
56
+ subject.env = :production
57
+ nfe_must_be_valid_by_schema 'consSitNFe_v3.10.xsd'
58
+ end
59
+ it "Deve ser válido em ambiente de homologação" do
60
+ subject.env = :test
61
+ nfe_must_be_valid_by_schema 'consSitNFe_v3.10.xsd'
62
+ end
63
+ end
98
64
  end
99
- after { savon.unmock! }
65
+ describe 'REQUEST MUST BE SET RESPONSE CORRECTLY' do
66
+ let(:response_fail) { read_fixture('product/response/v3.10/nfe_consulta_protocolo/fail.xml') }
67
+ let(:response_success_without_event){ read_fixture('product/response/v3.10/nfe_consulta_protocolo/success_without.xml') }
68
+ let(:response_success_one_event) { read_fixture('product/response/v3.10/nfe_consulta_protocolo/success_one.xml') }
69
+ let(:response_success_many_events_without_cancel) { read_fixture('product/response/v3.10/nfe_consulta_protocolo/success_many_without_cancel.xml') }
70
+ let(:response_success_many_events_with_cancel) { read_fixture('product/response/v3.10/nfe_consulta_protocolo/success_many_with_cancel.xml') }
71
+ let(:xml_nfe_without_proc) { read_fixture('product/response/v3.10/nfe_consulta_protocolo/nfe_original/without_proc.xml') }
72
+ let(:xml_nfe_with_proc) { read_fixture('product/response/v3.10/nfe_consulta_protocolo/nfe_original/with_proc.xml') }
73
+
74
+ before do
75
+ savon.mock!
76
+ stub_request(:get, subject.client_wsdl.globals[:wsdl]).to_return(status: 200, body: read_fixture('product/wsdl/NfeConsulta2.xml') )
77
+ end
78
+ after { savon.unmock! }
79
+
80
+ it "Quando a resposta reotrnar com algum erro não deve instanciar os eventos" do
81
+ subject.original_xml = xml_nfe_with_proc
82
+ savon.expects(subject.method_wsdl).returns( response_fail )
83
+ subject.request
84
+ response = subject.response
85
+
86
+ response.must_be_kind_of BrNfe::Product::Response::NfeConsultaProtocolo
87
+
88
+ response.environment.must_equal :test
89
+ response.app_version.must_equal 'SVRS201610061504'
90
+ response.processed_at.must_equal Time.parse('2017-01-04T15:45:02-02:00')
91
+ response.protocol.must_be_nil
92
+ response.request_status.must_equal :success
93
+ response.processing_status_code.must_equal '226'
94
+ response.processing_status_motive.must_equal 'Rejeicao: Codigo da UF do Emitente diverge da UF autorizadora'
95
+ response.processing_status.must_equal :error
96
+ response.nota_fiscal.must_be_nil
97
+ response.main_event.must_be_nil
98
+ response.events.must_be_empty
99
+ end
100
100
 
101
- it "Quando a resposta reotrnar com algum erro não deve instanciar os eventos" do
102
- subject.original_xml = xml_nfe_with_proc
103
- savon.expects(subject.method_wsdl).returns( response_fail )
104
- subject.request
105
- response = subject.response
101
+ it "Quando retornar apenas o protocolo da NF-e e não tiver nenhum evento deve apenas setar o protocolo no XML da NF-e" do
102
+ subject.original_xml = xml_nfe_without_proc
103
+ savon.expects(subject.method_wsdl).returns( response_success_without_event )
104
+ subject.request
105
+ response = subject.response
106
+
107
+ response.must_be_kind_of BrNfe::Product::Response::NfeConsultaProtocolo
108
+
109
+ response.environment.must_equal :test
110
+ response.app_version.must_equal 'SVRS201610061504'
111
+ response.processed_at.must_equal Time.parse('2017-01-03T08:56:39-02:00')
112
+ response.protocol.must_be_nil
113
+ response.request_status.must_equal :success
114
+ response.processing_status_code.must_equal '100'
115
+ response.processing_status_motive.must_equal 'Autorizado o uso da NF-e'
116
+ response.processing_status.must_equal :success
117
+ response.main_event.must_be_nil
118
+ response.events.must_be_empty
119
+
120
+ nf = response.nota_fiscal
121
+ nf.wont_be_nil
122
+ nf.processed_at.must_equal Time.parse('2017-01-03T08:53:13-02:00')
123
+ nf.protocol.must_equal '342170000000903'
124
+ nf.digest_value.must_equal '2N5tbfnT9V4oRxiesTyBLP9tAVE='
125
+ nf.status_code.must_equal '100'
126
+ nf.status_motive.must_equal 'Autorizado o uso da NF-e'
127
+ nf.chave_de_acesso.must_equal '42170108897094000155550010000000051201601010'
128
+ nf.situation.must_equal :authorized
129
+ nf.xml.must_equal xml_nfe_with_proc, "Deveria adicionar o protocolo da NF-e e a NF dentro da tag nfeProc"
130
+ end
106
131
 
107
- response.must_be_kind_of BrNfe::Product::Response::NfeConsultaProtocolo
108
-
109
- response.environment.must_equal :test
110
- response.app_version.must_equal 'SVRS201610061504'
111
- response.processed_at.must_equal Time.parse('2017-01-04T15:45:02-02:00')
112
- response.protocol.must_be_nil
113
- response.request_status.must_equal :success
114
- response.processing_status_code.must_equal '226'
115
- response.processing_status_motive.must_equal 'Rejeicao: Codigo da UF do Emitente diverge da UF autorizadora'
116
- response.processing_status.must_equal :error
117
- response.nota_fiscal.must_be_nil
118
- response.main_event.must_be_nil
119
- response.events.must_be_empty
120
- end
132
+ it "Quando retornar apenas 1 evento deve seta-lo como o evento principal e também adicionar na lista de eventos" do
133
+ subject.original_xml = xml_nfe_with_proc
134
+ savon.expects(subject.method_wsdl).returns( response_success_one_event )
135
+ subject.request
136
+ response = subject.response
137
+
138
+ response.environment.must_equal :test
139
+ response.app_version.must_equal 'SVRS201610061504'
140
+ response.processed_at.must_equal Time.parse('2017-01-03T08:56:39-02:00')
141
+ response.protocol.must_be_nil
142
+ response.request_status.must_equal :success
143
+ response.processing_status_code.must_equal '135'
144
+ response.processing_status_motive.must_equal 'Evento registrado e vinculado a NF-e'
145
+ response.processing_status.must_equal :success
146
+ response.main_event.wont_be_nil
147
+ response.events.size.must_equal 1
148
+
149
+ response.main_event.must_equal response.events[0]
150
+
151
+ event = response.main_event
152
+ event.codigo_orgao.must_equal '35'
153
+ event.status_code.must_equal '135'
154
+ event.status_motive.must_equal 'Evento registrado e vinculado a NF-e'
155
+ event.code.must_equal '110110'
156
+ event.sequence.must_equal 1
157
+ event.cpf_cnpj_destino.must_equal '04962355000112'
158
+ event.sent_at.must_equal Time.parse('2014-02-05T16:06:30-02:00')
159
+ event.registred_at.must_equal Time.parse('2014-02-05T16:06:32-02:00')
160
+ event.event_protocol.must_equal ''
161
+ event.authorization_protocol.must_equal '135140000457555'
162
+ event.xml.must_equal read_fixture('product/response/v3.10/nfe_consulta_protocolo/event_xml/one_event.xml')
163
+
164
+ nf = response.nota_fiscal
165
+ nf.processed_at.must_equal Time.parse('2017-01-03T08:53:13-02:00')
166
+ nf.protocol.must_equal '342170000000903'
167
+ nf.digest_value.must_equal '2N5tbfnT9V4oRxiesTyBLP9tAVE='
168
+ nf.status_code.must_equal '100'
169
+ nf.status_motive.must_equal 'Autorizado o uso da NF-e'
170
+ nf.chave_de_acesso.must_equal '42170108897094000155550010000000051201601010'
171
+ nf.situation.must_equal :adjusted
172
+ nf.xml.must_equal xml_nfe_with_proc, "Não deve duplicar os protocolos se já houver algum protocolo em nfeProc"
173
+ end
121
174
 
122
- it "Quando retornar apenas o protocolo da NF-e e não tiver nenhum evento deve apenas setar o protocolo no XML da NF-e" do
123
- subject.original_xml = xml_nfe_without_proc
124
- savon.expects(subject.method_wsdl).returns( response_success_without_event )
125
- subject.request
126
- response = subject.response
175
+ it "Quando tem mais de um evento e não tiver Cancelamneto deve setar todos os eventos na lista e setar o de maior sequencia no evento principal" do
176
+ subject.original_xml = xml_nfe_with_proc
177
+ savon.expects(subject.method_wsdl).returns( response_success_many_events_without_cancel )
178
+ subject.request
179
+ response = subject.response
180
+
181
+ response.environment.must_equal :production
182
+ response.app_version.must_equal 'SVRS201610061505'
183
+ response.processed_at.must_equal Time.parse('2017-01-03T08:56:39-02:00')
184
+ response.protocol.must_be_nil
185
+ response.request_status.must_equal :success
186
+ response.processing_status_code.must_equal '101'
187
+ response.processing_status_motive.must_equal 'Cancelamento de NF-e homologado'
188
+ response.processing_status.must_equal :success
189
+ response.main_event.wont_be_nil
190
+ response.events.size.must_equal 3
191
+
192
+ events = response.events.sort_by{|e| [e.sequence.to_i, (e.registred_at||Time.current)] }
193
+ response.main_event.must_equal events[2]
194
+
195
+ events[0].codigo_orgao.must_equal '35'
196
+ events[0].status_code.must_equal '135'
197
+ events[0].status_motive.must_equal 'Evento registrado e vinculado a NF-e'
198
+ events[0].code.must_equal '110110'
199
+ events[0].sequence.must_equal 1
200
+ events[0].cpf_cnpj_destino.must_equal '04962355000112'
201
+ events[0].sent_at.must_equal Time.parse('2014-02-05T16:06:30-02:00')
202
+ events[0].registred_at.must_equal Time.parse('2014-02-05T16:06:32-02:00')
203
+ events[0].event_protocol.must_equal ''
204
+ events[0].authorization_protocol.must_equal '135140000457555'
205
+ events[0].description.must_equal 'Carta de Correcao'
206
+ events[0].justification.must_equal ''
207
+ events[0].correction_text.must_equal 'teste de consulta de nfe corrigida primeira coorecao para consulta de nota'
208
+ events[0].xml.must_equal read_fixture('product/response/v3.10/nfe_consulta_protocolo/event_xml/event_1.xml')
209
+
210
+ events[1].codigo_orgao.must_equal '35'
211
+ events[1].status_code.must_equal '135'
212
+ events[1].status_motive.must_equal 'Evento registrado e vinculado a NF-e'
213
+ events[1].code.must_equal '110110'
214
+ events[1].sequence.must_equal 2
215
+ events[1].cpf_cnpj_destino.must_equal '04962355000112'
216
+ events[1].sent_at.must_equal Time.parse('2014-02-05T16:06:30-02:00')
217
+ events[1].registred_at.must_equal Time.parse('2014-02-05T16:06:32-02:00')
218
+ events[1].event_protocol.must_equal ''
219
+ events[1].authorization_protocol.must_equal '135140000457416'
220
+ events[1].description.must_equal 'Carta de Correcao'
221
+ events[1].justification.must_equal ''
222
+ events[1].correction_text.must_equal 'teste de consulta de nfe corrigida segunda coorecao para consulta de nota'
223
+ events[1].xml.must_equal read_fixture('product/response/v3.10/nfe_consulta_protocolo/event_xml/event_2.xml')
224
+
225
+ events[2].codigo_orgao.must_equal '35'
226
+ events[2].status_code.must_equal '135'
227
+ events[2].status_motive.must_equal 'Evento registrado e vinculado a NF-e'
228
+ events[2].code.must_equal '110110'
229
+ events[2].sequence.must_equal 3
230
+ events[2].cpf_cnpj_destino.must_equal '04962355000112'
231
+ events[2].sent_at.must_equal Time.parse('2014-02-05T16:06:30-02:00')
232
+ events[2].registred_at.must_equal Time.parse('2014-02-05T16:06:32-02:00')
233
+ events[2].event_protocol.must_equal ''
234
+ events[2].authorization_protocol.must_equal '135140000457417'
235
+ events[2].description.must_equal 'Carta de Correcao'
236
+ events[2].justification.must_equal ''
237
+ events[2].correction_text.must_equal 'teste de consulta de nfe corrigida terceiro coorecao para consulta de nota'
238
+ events[2].xml.must_equal read_fixture('product/response/v3.10/nfe_consulta_protocolo/event_xml/event_3.xml')
239
+
240
+ nf = response.nota_fiscal
241
+ nf.processed_at.must_equal Time.parse('2017-01-03T08:53:13-02:00')
242
+ nf.protocol.must_equal '342170000000903'
243
+ nf.digest_value.must_equal '2N5tbfnT9V4oRxiesTyBLP9tAVE='
244
+ nf.status_code.must_equal '100'
245
+ nf.status_motive.must_equal 'Autorizado o uso da NF-e'
246
+ nf.chave_de_acesso.must_equal '42170108897094000155550010000000051201601010'
247
+ nf.situation.must_equal :adjusted
248
+ nf.xml.must_equal xml_nfe_with_proc, "Não deve duplicar os protocolos se já houver algum protocolo em nfeProc"
249
+ end
127
250
 
128
- response.must_be_kind_of BrNfe::Product::Response::NfeConsultaProtocolo
129
-
130
- response.environment.must_equal :test
131
- response.app_version.must_equal 'SVRS201610061504'
132
- response.processed_at.must_equal Time.parse('2017-01-03T08:56:39-02:00')
133
- response.protocol.must_be_nil
134
- response.request_status.must_equal :success
135
- response.processing_status_code.must_equal '100'
136
- response.processing_status_motive.must_equal 'Autorizado o uso da NF-e'
137
- response.processing_status.must_equal :success
138
- response.main_event.must_be_nil
139
- response.events.must_be_empty
140
-
141
- nf = response.nota_fiscal
142
- nf.wont_be_nil
143
- nf.processed_at.must_equal Time.parse('2017-01-03T08:53:13-02:00')
144
- nf.protocol.must_equal '342170000000903'
145
- nf.digest_value.must_equal '2N5tbfnT9V4oRxiesTyBLP9tAVE='
146
- nf.status_code.must_equal '100'
147
- nf.status_motive.must_equal 'Autorizado o uso da NF-e'
148
- nf.chave_de_acesso.must_equal '42170108897094000155550010000000051201601010'
149
- nf.situation.must_equal :authorized
150
- nf.xml.must_equal xml_nfe_with_proc, "Deveria adicionar o protocolo da NF-e e a NF dentro da tag nfeProc"
251
+ it "Quando tem mais de um evento e tem um evento de Cancelamento, sempre deve ser o principal" do
252
+ subject.original_xml = xml_nfe_with_proc
253
+ savon.expects(subject.method_wsdl).returns( response_success_many_events_with_cancel )
254
+ subject.request
255
+ response = subject.response
256
+
257
+ response.environment.must_equal :production
258
+ response.app_version.must_equal 'SVRS201610061505'
259
+ response.processed_at.must_equal Time.parse('2017-01-03T08:56:39-02:00')
260
+ response.protocol.must_be_nil
261
+ response.request_status.must_equal :success
262
+ response.processing_status_code.must_equal '101'
263
+ response.processing_status_motive.must_equal 'Cancelamento de NF-e homologado'
264
+ response.processing_status.must_equal :success
265
+ response.main_event.wont_be_nil
266
+ response.events.size.must_equal 3
267
+
268
+ events = response.events.sort_by{|e| [e.sequence.to_i, (e.registred_at||Time.current)] }
269
+ response.main_event.must_equal events[1]
270
+
271
+ events[0].codigo_orgao.must_equal '35'
272
+ events[0].status_code.must_equal '135'
273
+ events[0].status_motive.must_equal 'Evento registrado e vinculado a NF-e'
274
+ events[0].code.must_equal '110110'
275
+ events[0].sequence.must_equal 1
276
+ events[0].cpf_cnpj_destino.must_equal '04962355000112'
277
+ events[0].sent_at.must_equal Time.parse('2014-02-05T16:06:30-02:00')
278
+ events[0].registred_at.must_equal Time.parse('2014-02-05T16:06:32-02:00')
279
+ events[0].event_protocol.must_equal ''
280
+ events[0].authorization_protocol.must_equal '135140000457555'
281
+ events[0].description.must_equal 'Carta de Correcao'
282
+ events[0].justification.must_equal ''
283
+ events[0].correction_text.must_equal 'teste de consulta de nfe corrigida primeira coorecao para consulta de nota'
284
+ events[0].xml.must_equal read_fixture('product/response/v3.10/nfe_consulta_protocolo/event_xml/event_1.xml')
285
+
286
+ events[2].codigo_orgao.must_equal '35'
287
+ events[2].status_code.must_equal '135'
288
+ events[2].status_motive.must_equal 'Evento registrado e vinculado a NF-e'
289
+ events[2].code.must_equal '110110'
290
+ events[2].sequence.must_equal 2
291
+ events[2].cpf_cnpj_destino.must_equal '04962355000112'
292
+ events[2].sent_at.must_equal Time.parse('2014-02-05T16:06:30-02:00')
293
+ events[2].registred_at.must_equal Time.parse('2014-02-05T16:06:32-02:00')
294
+ events[2].event_protocol.must_equal ''
295
+ events[2].authorization_protocol.must_equal '135140000457416'
296
+ events[2].description.must_equal 'Carta de Correcao'
297
+ events[2].justification.must_equal ''
298
+ events[2].correction_text.must_equal 'teste de consulta de nfe corrigida segunda coorecao para consulta de nota'
299
+ events[2].xml.must_equal read_fixture('product/response/v3.10/nfe_consulta_protocolo/event_xml/event_2.xml')
300
+
301
+ events[1] = response.main_event
302
+ events[1].codigo_orgao.must_equal '42'
303
+ events[1].status_code.must_equal '135'
304
+ events[1].status_motive.must_equal 'Evento registrado e vinculado a NF-e'
305
+ events[1].code.must_equal '110111'
306
+ events[1].sequence.must_equal 1
307
+ events[1].cpf_cnpj_destino.must_equal '00090742403050'
308
+ events[1].sent_at.must_equal Time.parse('2017-01-03T08:54:58-02:00')
309
+ events[1].registred_at.must_equal Time.parse('2017-01-03T08:55:05-02:00')
310
+ events[1].event_protocol.must_equal '342170000000903'
311
+ events[1].authorization_protocol.must_equal '342170000000906'
312
+ events[1].description.must_equal 'Cancelamento'
313
+ events[1].justification.must_equal 'Cancelamento para teste'
314
+ events[1].correction_text.must_equal ''
315
+ events[1].xml.must_equal read_fixture('product/response/v3.10/nfe_consulta_protocolo/event_xml/event_cancel.xml')
316
+
317
+ nf = response.nota_fiscal
318
+ nf.processed_at.must_equal Time.parse('2017-01-03T08:53:13-02:00')
319
+ nf.protocol.must_equal '342170000000903'
320
+ nf.digest_value.must_equal '2N5tbfnT9V4oRxiesTyBLP9tAVE='
321
+ nf.status_code.must_equal '100'
322
+ nf.status_motive.must_equal 'Autorizado o uso da NF-e'
323
+ nf.chave_de_acesso.must_equal '42170108897094000155550010000000051201601010'
324
+ nf.situation.must_equal :canceled
325
+ nf.xml.must_equal xml_nfe_with_proc, "Não deve duplicar os protocolos se já houver algum protocolo em nfeProc"
326
+ end
151
327
  end
152
-
153
- it "Quando retornar apenas 1 evento deve seta-lo como o evento principal e também adicionar na lista de eventos" do
154
- subject.original_xml = xml_nfe_with_proc
155
- savon.expects(subject.method_wsdl).returns( response_success_one_event )
156
- subject.request
157
- response = subject.response
158
-
159
- response.environment.must_equal :test
160
- response.app_version.must_equal 'SVRS201610061504'
161
- response.processed_at.must_equal Time.parse('2017-01-03T08:56:39-02:00')
162
- response.protocol.must_be_nil
163
- response.request_status.must_equal :success
164
- response.processing_status_code.must_equal '135'
165
- response.processing_status_motive.must_equal 'Evento registrado e vinculado a NF-e'
166
- response.processing_status.must_equal :success
167
- response.main_event.wont_be_nil
168
- response.events.size.must_equal 1
169
-
170
- response.main_event.must_equal response.events[0]
171
-
172
- event = response.main_event
173
- event.codigo_orgao.must_equal '35'
174
- event.status_code.must_equal '135'
175
- event.status_motive.must_equal 'Evento registrado e vinculado a NF-e'
176
- event.code.must_equal '110110'
177
- event.sequence.must_equal 1
178
- event.cpf_cnpj_destino.must_equal '04962355000112'
179
- event.sent_at.must_equal Time.parse('2014-02-05T16:06:30-02:00')
180
- event.registred_at.must_equal Time.parse('2014-02-05T16:06:32-02:00')
181
- event.event_protocol.must_equal ''
182
- event.ret_event_protocol.must_equal '135140000457555'
183
- event.xml.must_equal read_fixture('product/response/v3.10/nfe_consulta_protocolo/event_xml/one_event.xml')
184
-
185
- nf = response.nota_fiscal
186
- nf.processed_at.must_equal Time.parse('2017-01-03T08:53:13-02:00')
187
- nf.protocol.must_equal '342170000000903'
188
- nf.digest_value.must_equal '2N5tbfnT9V4oRxiesTyBLP9tAVE='
189
- nf.status_code.must_equal '100'
190
- nf.status_motive.must_equal 'Autorizado o uso da NF-e'
191
- nf.chave_de_acesso.must_equal '42170108897094000155550010000000051201601010'
192
- nf.situation.must_equal :adjusted
193
- nf.xml.must_equal xml_nfe_with_proc, "Não deve duplicar os protocolos se já houver algum protocolo em nfeProc"
328
+ describe 'Configurações por UF dos parametros para instanciar o client Soap' do
329
+ let(:client_wsdl) { subject.client_wsdl }
330
+ describe 'UF 12 - Acre' do
331
+ before { subject.ibge_code_of_issuer_uf = '12' }
332
+ it "Deve utilizar o servidor SVRS para emissão normal" do
333
+ must_use_SVRS
334
+ end
335
+ it "Deve usar o servidor SVCAN para emissão em Contingência" do
336
+ must_use_SVCAN_for_SVC_mode
337
+ end
338
+ end
339
+ describe 'UF 27 - Alagoas' do
340
+ before { subject.ibge_code_of_issuer_uf = '27' }
341
+ it "Deve utilizar o servidor SVRS para emissão normal" do
342
+ must_use_SVRS
343
+ end
344
+ it "Deve usar o servidor SVCAN para emissão em Contingência" do
345
+ must_use_SVCAN_for_SVC_mode
346
+ end
347
+ end
348
+ describe 'UF 16 - Amapá' do
349
+ before { subject.ibge_code_of_issuer_uf = '16' }
350
+ it "Deve utilizar o servidor SVRS para emissão normal" do
351
+ must_use_SVRS
352
+ end
353
+ it "Deve usar o servidor SVCAN para emissão em Contingência" do
354
+ must_use_SVCAN_for_SVC_mode
355
+ end
356
+ end
357
+ describe 'UF 13 - Amazonas' do
358
+ before { subject.ibge_code_of_issuer_uf = '13' }
359
+ it "configurações para e emissão normal no ambiente de produção" do
360
+ subject.env = :production
361
+ client_wsdl.globals[:wsdl].must_equal 'https://nfe.sefaz.am.gov.br/services2/services/NfeConsulta2?wsdl'
362
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
363
+ client_wsdl.globals[:ssl_version].must_equal :TLSv1
364
+ client_wsdl.globals[:follow_redirects].must_equal false
365
+ client_wsdl.globals[:headers].must_be_nil
366
+ end
367
+ it "configurações para e emissão normal no ambiente de teste" do
368
+ subject.env = :test
369
+ client_wsdl.globals[:wsdl].must_equal 'https://homnfe.sefaz.am.gov.br/services2/services/NfeConsulta2?wsdl'
370
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
371
+ client_wsdl.globals[:ssl_version].must_equal :TLSv1
372
+ client_wsdl.globals[:follow_redirects].must_equal false
373
+ client_wsdl.globals[:headers].must_be_nil
374
+ end
375
+ it "Deve usar o servidor SVCAN para emissão em Contingência" do
376
+ must_use_SVCRS_for_SVC_mode
377
+ end
378
+ end
379
+ describe 'UF 29 - Bahia' do
380
+ before { subject.ibge_code_of_issuer_uf = '29' }
381
+ it "configurações para e emissão normal no ambiente de produção" do
382
+ subject.env = :production
383
+ client_wsdl.globals[:wsdl].must_equal 'https://nfe.sefaz.ba.gov.br/webservices/NfeConsulta/NfeConsulta.asmx?wsdl'
384
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
385
+ client_wsdl.globals[:ssl_version].must_equal :TLSv1
386
+ client_wsdl.globals[:follow_redirects].must_equal false
387
+ client_wsdl.globals[:headers].must_be_nil
388
+ end
389
+ it "configurações para e emissão normal no ambiente de teste" do
390
+ subject.env = :test
391
+ client_wsdl.globals[:wsdl].must_equal 'https://hnfe.sefaz.ba.gov.br/webservices/NfeConsulta/NfeConsulta.asmx?wsdl'
392
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
393
+ client_wsdl.globals[:ssl_version].must_equal :TLSv1
394
+ client_wsdl.globals[:follow_redirects].must_equal false
395
+ client_wsdl.globals[:headers].must_be_nil
396
+ end
397
+ it "Deve usar o servidor SVCAN para emissão em Contingência" do
398
+ must_use_SVCRS_for_SVC_mode
399
+ end
400
+ end
401
+ describe 'UF 23 - Ceará' do
402
+ before { subject.ibge_code_of_issuer_uf = '23' }
403
+ it "configurações para e emissão normal no ambiente de produção" do
404
+ subject.env = :production
405
+ client_wsdl.globals[:wsdl].must_equal 'https://nfe.sefaz.ce.gov.br/nfe2/services/NfeConsulta2?wsdl'
406
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
407
+ client_wsdl.globals[:ssl_version].must_equal :SSLv3
408
+ client_wsdl.globals[:follow_redirects].must_equal false
409
+ client_wsdl.globals[:headers].must_be_nil
410
+ end
411
+ it "configurações para e emissão normal no ambiente de teste" do
412
+ subject.env = :test
413
+ client_wsdl.globals[:wsdl].must_equal 'https://nfeh.sefaz.ce.gov.br/nfe2/services/NfeConsulta2?wsdl'
414
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
415
+ client_wsdl.globals[:ssl_version].must_equal :SSLv3
416
+ client_wsdl.globals[:follow_redirects].must_equal false
417
+ client_wsdl.globals[:headers].must_be_nil
418
+ end
419
+ it "Deve usar o servidor SVCAN para emissão em Contingência" do
420
+ must_use_SVCRS_for_SVC_mode
421
+ end
422
+ end
423
+ describe 'UF 53 - Distrito Federal' do
424
+ before { subject.ibge_code_of_issuer_uf = '53' }
425
+ it "Deve utilizar o servidor SVRS para emissão normal" do
426
+ must_use_SVRS
427
+ end
428
+ it "Deve usar o servidor SVCAN para emissão em Contingência" do
429
+ must_use_SVCAN_for_SVC_mode
430
+ end
431
+ end
432
+ describe 'UF 32 - Espírito Santo' do
433
+ before { subject.ibge_code_of_issuer_uf = '32' }
434
+ it "Deve utilizar o servidor SVRS para emissão normal" do
435
+ must_use_SVRS
436
+ end
437
+ it "Deve usar o servidor SVCAN para emissão em Contingência" do
438
+ must_use_SVCAN_for_SVC_mode
439
+ end
440
+ end
441
+ describe 'UF 52 - Goiás' do
442
+ before { subject.ibge_code_of_issuer_uf = '52' }
443
+ it "configurações para e emissão normal no ambiente de produção" do
444
+ subject.env = :production
445
+ client_wsdl.globals[:wsdl].must_equal 'https://nfe.sefaz.go.gov.br/nfe/services/v2/NfeConsulta2?wsdl'
446
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
447
+ client_wsdl.globals[:ssl_version].must_equal :SSLv3
448
+ client_wsdl.globals[:follow_redirects].must_equal true
449
+ client_wsdl.globals[:headers].must_equal( {:'Content-Type' => 'application/soap+xml; charset=utf-8'} )
450
+ end
451
+ it "configurações para e emissão normal no ambiente de teste" do
452
+ subject.env = :test
453
+ client_wsdl.globals[:wsdl].must_equal 'https://homolog.sefaz.go.gov.br/nfe/services/v2/NfeConsulta2?wsdl'
454
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
455
+ client_wsdl.globals[:ssl_version].must_equal :SSLv3
456
+ client_wsdl.globals[:follow_redirects].must_equal true
457
+ client_wsdl.globals[:headers].must_equal( {:'Content-Type' => 'application/soap+xml; charset=utf-8'} )
458
+ end
459
+ it "Deve usar o servidor SVCAN para emissão em Contingência" do
460
+ must_use_SVCRS_for_SVC_mode
461
+ end
462
+ end
463
+ describe 'UF 21 - Maranhão' do
464
+ before { subject.ibge_code_of_issuer_uf = '21' }
465
+ it "Deve utilizar o servidor SVRS para emissão normal" do
466
+ must_use_SVAN
467
+ end
468
+ it "Deve usar o servidor SVCAN para emissão em Contingência" do
469
+ must_use_SVCRS_for_SVC_mode
470
+ end
471
+ end
472
+ describe 'UF 51 - Mato Grosso' do
473
+ before { subject.ibge_code_of_issuer_uf = '51' }
474
+ it "configurações para e emissão normal no ambiente de produção" do
475
+ subject.env = :production
476
+ client_wsdl.globals[:wsdl].must_equal 'https://nfe.sefaz.mt.gov.br/nfews/v2/services/NfeConsulta2?wsdl'
477
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
478
+ client_wsdl.globals[:ssl_version].must_equal :SSLv3
479
+ client_wsdl.globals[:follow_redirects].must_equal false
480
+ client_wsdl.globals[:headers].must_be_nil
481
+ end
482
+ it "configurações para e emissão normal no ambiente de teste" do
483
+ subject.env = :test
484
+ client_wsdl.globals[:wsdl].must_equal 'https://homologacao.sefaz.mt.gov.br/nfews/v2/services/NfeConsulta2?wsdl'
485
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
486
+ client_wsdl.globals[:ssl_version].must_equal :TLSv1
487
+ client_wsdl.globals[:follow_redirects].must_equal false
488
+ client_wsdl.globals[:headers].must_be_nil
489
+ end
490
+ it "Deve usar o servidor SVCAN para emissão em Contingência" do
491
+ must_use_SVCRS_for_SVC_mode
492
+ end
493
+ end
494
+ describe 'UF 50 - Mato Grosso do Sul' do
495
+ before { subject.ibge_code_of_issuer_uf = '50' }
496
+ it "configurações para e emissão normal no ambiente de produção" do
497
+ subject.env = :production
498
+ client_wsdl.globals[:wsdl].must_equal 'https://nfe.fazenda.ms.gov.br/producao/services2/NfeConsulta2?wsdl'
499
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
500
+ client_wsdl.globals[:ssl_version].must_equal :SSLv3
501
+ client_wsdl.globals[:follow_redirects].must_equal false
502
+ client_wsdl.globals[:headers].must_be_nil
503
+ end
504
+ it "configurações para e emissão normal no ambiente de teste" do
505
+ subject.env = :test
506
+ client_wsdl.globals[:wsdl].must_equal 'https://homologacao.nfe.ms.gov.br/homologacao/services2/NfeConsulta2?wsdl'
507
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
508
+ client_wsdl.globals[:ssl_version].must_equal :SSLv3
509
+ client_wsdl.globals[:follow_redirects].must_equal false
510
+ client_wsdl.globals[:headers].must_be_nil
511
+ end
512
+ it "Deve usar o servidor SVCAN para emissão em Contingência" do
513
+ must_use_SVCRS_for_SVC_mode
514
+ end
515
+ end
516
+ describe 'UF 31 - Minas Gerais' do
517
+ before { subject.ibge_code_of_issuer_uf = '31' }
518
+ it "configurações para e emissão normal no ambiente de produção" do
519
+ subject.env = :production
520
+ client_wsdl.globals[:wsdl].must_equal 'https://nfe.fazenda.mg.gov.br/nfe2/services/NfeConsulta2?wsdl'
521
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
522
+ client_wsdl.globals[:ssl_version].must_equal :TLSv1
523
+ client_wsdl.globals[:follow_redirects].must_equal false
524
+ client_wsdl.globals[:headers].must_be_nil
525
+ end
526
+ it "configurações para e emissão normal no ambiente de teste" do
527
+ subject.env = :test
528
+ client_wsdl.globals[:wsdl].must_equal 'https://hnfe.fazenda.mg.gov.br/nfe2/services/NfeConsulta2?wsdl'
529
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
530
+ client_wsdl.globals[:ssl_version].must_equal :TLSv1
531
+ client_wsdl.globals[:follow_redirects].must_equal false
532
+ client_wsdl.globals[:headers].must_be_nil
533
+ end
534
+ it "Deve usar o servidor SVCAN para emissão em Contingência" do
535
+ must_use_SVCAN_for_SVC_mode
536
+ end
537
+ end
538
+ describe 'UF 15 - Pará' do
539
+ before { subject.ibge_code_of_issuer_uf = '15' }
540
+ it "Deve utilizar o servidor SVRS para emissão normal" do
541
+ must_use_SVAN
542
+ end
543
+ it "Deve usar o servidor SVCAN para emissão em Contingência" do
544
+ must_use_SVCRS_for_SVC_mode
545
+ end
546
+ end
547
+ describe 'UF 25 - Paraíba' do
548
+ before { subject.ibge_code_of_issuer_uf = '25' }
549
+ it "Deve utilizar o servidor SVRS para emissão normal" do
550
+ must_use_SVRS
551
+ end
552
+ it "Deve usar o servidor SVCAN para emissão em Contingência" do
553
+ must_use_SVCAN_for_SVC_mode
554
+ end
555
+ end
556
+ describe 'UF 41 - Paraná' do
557
+ before { subject.ibge_code_of_issuer_uf = '41' }
558
+ it "configurações para e emissão normal no ambiente de produção" do
559
+ subject.env = :production
560
+ client_wsdl.globals[:wsdl].must_equal 'https://nfe.fazenda.pr.gov.br/nfe/NFeConsulta3?wsdl'
561
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
562
+ client_wsdl.globals[:ssl_version].must_equal :SSLv3
563
+ client_wsdl.globals[:follow_redirects].must_equal false
564
+ client_wsdl.globals[:headers].must_be_nil
565
+ end
566
+ it "configurações para e emissão normal no ambiente de teste" do
567
+ subject.env = :test
568
+ client_wsdl.globals[:wsdl].must_equal 'https://homologacao.nfe.fazenda.pr.gov.br/nfe/NFeConsulta3?wsdl'
569
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
570
+ client_wsdl.globals[:ssl_version].must_equal :SSLv3
571
+ client_wsdl.globals[:follow_redirects].must_equal false
572
+ client_wsdl.globals[:headers].must_be_nil
573
+ end
574
+ it "Deve usar o servidor SVCAN para emissão em Contingência" do
575
+ must_use_SVCRS_for_SVC_mode
576
+ end
577
+ end
578
+ describe 'UF 26 - Pernambuco' do
579
+ before { subject.ibge_code_of_issuer_uf = '26' }
580
+ it "configurações para e emissão normal no ambiente de produção" do
581
+ subject.env = :production
582
+ client_wsdl.globals[:wsdl].must_equal 'https://nfe.sefaz.pe.gov.br/nfe-service/services/NfeConsulta2?wsdl'
583
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
584
+ client_wsdl.globals[:ssl_version].must_equal :SSLv3
585
+ client_wsdl.globals[:follow_redirects].must_equal false
586
+ client_wsdl.globals[:headers].must_be_nil
587
+ end
588
+ it "configurações para e emissão normal no ambiente de teste" do
589
+ subject.env = :test
590
+ client_wsdl.globals[:wsdl].must_equal 'https://nfehomolog.sefaz.pe.gov.br/nfe-service/services/NfeConsulta2?wsdl'
591
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
592
+ client_wsdl.globals[:ssl_version].must_equal :SSLv3
593
+ client_wsdl.globals[:follow_redirects].must_equal false
594
+ client_wsdl.globals[:headers].must_be_nil
595
+ end
596
+ it "Deve usar o servidor SVCAN para emissão em Contingência" do
597
+ must_use_SVCRS_for_SVC_mode
598
+ end
599
+ end
600
+ describe 'UF 22 - Piauí' do
601
+ before { subject.ibge_code_of_issuer_uf = '22' }
602
+ it "Deve utilizar o servidor SVRS para emissão normal" do
603
+ must_use_SVRS
604
+ end
605
+ it "Deve usar o servidor SVCAN para emissão em Contingência" do
606
+ must_use_SVCRS_for_SVC_mode
607
+ end
608
+ end
609
+ describe 'UF 33 - Rio de Janeiro' do
610
+ before { subject.ibge_code_of_issuer_uf = '33' }
611
+ it "Deve utilizar o servidor SVRS para emissão normal" do
612
+ must_use_SVRS
613
+ end
614
+ it "Deve usar o servidor SVCAN para emissão em Contingência" do
615
+ must_use_SVCAN_for_SVC_mode
616
+ end
617
+ end
618
+ describe 'UF 24 - Rio Grande do Norte' do
619
+ before { subject.ibge_code_of_issuer_uf = '24' }
620
+ it "Deve utilizar o servidor SVRS para emissão normal" do
621
+ must_use_SVRS
622
+ end
623
+ it "Deve usar o servidor SVCAN para emissão em Contingência" do
624
+ must_use_SVCAN_for_SVC_mode
625
+ end
626
+ end
627
+ describe 'UF 43 - Rio Grande do Sul' do
628
+ before { subject.ibge_code_of_issuer_uf = '43' }
629
+ it "configurações para e emissão normal no ambiente de produção" do
630
+ subject.env = :production
631
+ client_wsdl.globals[:wsdl].must_equal 'https://nfe.sefazrs.rs.gov.br/ws/NfeConsulta/NfeConsulta2.asmx?wsdl'
632
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
633
+ client_wsdl.globals[:ssl_version].must_equal :SSLv3
634
+ client_wsdl.globals[:follow_redirects].must_equal false
635
+ client_wsdl.globals[:headers].must_be_nil
636
+ end
637
+ it "configurações para e emissão normal no ambiente de teste" do
638
+ subject.env = :test
639
+ client_wsdl.globals[:wsdl].must_equal 'https://nfe-homologacao.sefazrs.rs.gov.br/ws/NfeConsulta/NfeConsulta2.asmx?wsdl'
640
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
641
+ client_wsdl.globals[:ssl_version].must_equal :SSLv3
642
+ client_wsdl.globals[:follow_redirects].must_equal false
643
+ client_wsdl.globals[:headers].must_be_nil
644
+ end
645
+ it "Deve usar o servidor SVCAN para emissão em Contingência" do
646
+ must_use_SVCAN_for_SVC_mode
647
+ end
648
+ end
649
+ describe 'UF 11 - Rondônia' do
650
+ before { subject.ibge_code_of_issuer_uf = '11' }
651
+ it "Deve utilizar o servidor SVRS para emissão normal" do
652
+ must_use_SVRS
653
+ end
654
+ it "Deve usar o servidor SVCAN para emissão em Contingência" do
655
+ must_use_SVCAN_for_SVC_mode
656
+ end
657
+ end
658
+ describe 'UF 14 - Roraima' do
659
+ before { subject.ibge_code_of_issuer_uf = '14' }
660
+ it "Deve utilizar o servidor SVRS para emissão normal" do
661
+ must_use_SVRS
662
+ end
663
+ it "Deve usar o servidor SVCAN para emissão em Contingência" do
664
+ must_use_SVCAN_for_SVC_mode
665
+ end
666
+ end
667
+ describe 'UF 42 - Santa Catarina' do
668
+ before { subject.ibge_code_of_issuer_uf = '42' }
669
+ it "Deve utilizar o servidor SVRS para emissão normal" do
670
+ must_use_SVRS
671
+ end
672
+ it "Deve usar o servidor SVCAN para emissão em Contingência" do
673
+ must_use_SVCAN_for_SVC_mode
674
+ end
675
+ end
676
+ describe 'UF 35 - São Paulo' do
677
+ before { subject.ibge_code_of_issuer_uf = '35' }
678
+ it "configurações para e emissão normal no ambiente de produção" do
679
+ subject.env = :production
680
+ client_wsdl.globals[:wsdl].must_equal 'https://nfe.fazenda.sp.gov.br/ws/nfeconsulta2.asmx?wsdl'
681
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
682
+ client_wsdl.globals[:ssl_version].must_equal :SSLv3
683
+ client_wsdl.globals[:follow_redirects].must_equal false
684
+ client_wsdl.globals[:headers].must_be_nil
685
+ end
686
+ it "configurações para e emissão normal no ambiente de teste" do
687
+ subject.env = :test
688
+ client_wsdl.globals[:wsdl].must_equal 'https://homologacao.nfe.fazenda.sp.gov.br/ws/nfeconsulta2.asmx?wsdl'
689
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
690
+ client_wsdl.globals[:ssl_version].must_equal :TLSv1
691
+ client_wsdl.globals[:follow_redirects].must_equal false
692
+ client_wsdl.globals[:headers].must_be_nil
693
+ end
694
+ it "Deve usar o servidor SVCAN para emissão em Contingência" do
695
+ must_use_SVCAN_for_SVC_mode
696
+ end
697
+ end
698
+ describe 'UF 28 - Sergipe' do
699
+ before { subject.ibge_code_of_issuer_uf = '28' }
700
+ it "Deve utilizar o servidor SVRS para emissão normal" do
701
+ must_use_SVRS
702
+ end
703
+ it "Deve usar o servidor SVCAN para emissão em Contingência" do
704
+ must_use_SVCAN_for_SVC_mode
705
+ end
706
+ end
707
+ describe 'UF 17 - Tocantins' do
708
+ before { subject.ibge_code_of_issuer_uf = '17' }
709
+ it "Deve utilizar o servidor SVRS para emissão normal" do
710
+ must_use_SVRS
711
+ end
712
+ it "Deve usar o servidor SVCAN para emissão em Contingência" do
713
+ must_use_SVCAN_for_SVC_mode
714
+ end
715
+ end
194
716
  end
717
+ end
718
+ private
719
+ def must_use_SVRS
720
+ subject.env = :production
721
+ client_wsdl.globals[:wsdl].must_equal 'https://nfe.svrs.rs.gov.br/ws/NfeConsulta/NfeConsulta2.asmx?wsdl'
722
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
723
+ client_wsdl.globals[:ssl_version].must_equal :SSLv3
724
+ client_wsdl.globals[:follow_redirects].must_equal false
725
+ client_wsdl.globals[:headers].must_be_nil
726
+
727
+ subject.instance_variable_set(:@client_wsdl, nil)
728
+ subject.env = :test
729
+ client_wsdl = subject.client_wsdl
730
+ client_wsdl.globals[:wsdl].must_equal 'https://nfe-homologacao.svrs.rs.gov.br/ws/NfeConsulta/NfeConsulta2.asmx?wsdl'
731
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
732
+ client_wsdl.globals[:ssl_version].must_equal :SSLv3
733
+ client_wsdl.globals[:follow_redirects].must_equal false
734
+ client_wsdl.globals[:headers].must_be_nil
735
+ end
736
+ def must_use_SVAN
737
+ subject.env = :production
738
+ client_wsdl.globals[:wsdl].must_equal 'https://www.sefazvirtual.fazenda.gov.br/NfeConsulta2/NfeConsulta2.asmx?wsdl'
739
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
740
+ client_wsdl.globals[:ssl_version].must_equal :TLSv1
741
+ client_wsdl.globals[:follow_redirects].must_equal false
742
+ client_wsdl.globals[:headers].must_be_nil
743
+
744
+ subject.instance_variable_set(:@client_wsdl, nil)
745
+ subject.env = :test
746
+ client_wsdl = subject.client_wsdl
747
+ client_wsdl.globals[:wsdl].must_equal 'https://hom.sefazvirtual.fazenda.gov.br/NfeConsulta2/NfeConsulta2.asmx?wsdl'
748
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
749
+ client_wsdl.globals[:ssl_version].must_equal :TLSv1
750
+ client_wsdl.globals[:follow_redirects].must_equal false
751
+ client_wsdl.globals[:headers].must_be_nil
752
+ end
195
753
 
196
- it "Quando tem mais de um evento e não tiver Cancelamneto deve setar todos os eventos na lista e setar o de maior sequencia no evento principal" do
197
- subject.original_xml = xml_nfe_with_proc
198
- savon.expects(subject.method_wsdl).returns( response_success_many_events_without_cancel )
199
- subject.request
200
- response = subject.response
201
-
202
- response.environment.must_equal :production
203
- response.app_version.must_equal 'SVRS201610061505'
204
- response.processed_at.must_equal Time.parse('2017-01-03T08:56:39-02:00')
205
- response.protocol.must_be_nil
206
- response.request_status.must_equal :success
207
- response.processing_status_code.must_equal '101'
208
- response.processing_status_motive.must_equal 'Cancelamento de NF-e homologado'
209
- response.processing_status.must_equal :success
210
- response.main_event.wont_be_nil
211
- response.events.size.must_equal 3
212
-
213
- events = response.events.sort_by{|e| [e.sequence.to_i, (e.registred_at||Time.current)] }
214
- response.main_event.must_equal events[2]
215
-
216
- events[0].codigo_orgao.must_equal '35'
217
- events[0].status_code.must_equal '135'
218
- events[0].status_motive.must_equal 'Evento registrado e vinculado a NF-e'
219
- events[0].code.must_equal '110110'
220
- events[0].sequence.must_equal 1
221
- events[0].cpf_cnpj_destino.must_equal '04962355000112'
222
- events[0].sent_at.must_equal Time.parse('2014-02-05T16:06:30-02:00')
223
- events[0].registred_at.must_equal Time.parse('2014-02-05T16:06:32-02:00')
224
- events[0].event_protocol.must_equal ''
225
- events[0].ret_event_protocol.must_equal '135140000457555'
226
- events[0].description.must_equal 'Carta de Correcao'
227
- events[0].justification.must_equal ''
228
- events[0].correction_text.must_equal 'teste de consulta de nfe corrigida primeira coorecao para consulta de nota'
229
- events[0].xml.must_equal read_fixture('product/response/v3.10/nfe_consulta_protocolo/event_xml/event_1.xml')
230
-
231
- events[1].codigo_orgao.must_equal '35'
232
- events[1].status_code.must_equal '135'
233
- events[1].status_motive.must_equal 'Evento registrado e vinculado a NF-e'
234
- events[1].code.must_equal '110110'
235
- events[1].sequence.must_equal 2
236
- events[1].cpf_cnpj_destino.must_equal '04962355000112'
237
- events[1].sent_at.must_equal Time.parse('2014-02-05T16:06:30-02:00')
238
- events[1].registred_at.must_equal Time.parse('2014-02-05T16:06:32-02:00')
239
- events[1].event_protocol.must_equal ''
240
- events[1].ret_event_protocol.must_equal '135140000457416'
241
- events[1].description.must_equal 'Carta de Correcao'
242
- events[1].justification.must_equal ''
243
- events[1].correction_text.must_equal 'teste de consulta de nfe corrigida segunda coorecao para consulta de nota'
244
- events[1].xml.must_equal read_fixture('product/response/v3.10/nfe_consulta_protocolo/event_xml/event_2.xml')
245
-
246
- events[2].codigo_orgao.must_equal '35'
247
- events[2].status_code.must_equal '135'
248
- events[2].status_motive.must_equal 'Evento registrado e vinculado a NF-e'
249
- events[2].code.must_equal '110110'
250
- events[2].sequence.must_equal 3
251
- events[2].cpf_cnpj_destino.must_equal '04962355000112'
252
- events[2].sent_at.must_equal Time.parse('2014-02-05T16:06:30-02:00')
253
- events[2].registred_at.must_equal Time.parse('2014-02-05T16:06:32-02:00')
254
- events[2].event_protocol.must_equal ''
255
- events[2].ret_event_protocol.must_equal '135140000457417'
256
- events[2].description.must_equal 'Carta de Correcao'
257
- events[2].justification.must_equal ''
258
- events[2].correction_text.must_equal 'teste de consulta de nfe corrigida terceiro coorecao para consulta de nota'
259
- events[2].xml.must_equal read_fixture('product/response/v3.10/nfe_consulta_protocolo/event_xml/event_3.xml')
260
-
261
- nf = response.nota_fiscal
262
- nf.processed_at.must_equal Time.parse('2017-01-03T08:53:13-02:00')
263
- nf.protocol.must_equal '342170000000903'
264
- nf.digest_value.must_equal '2N5tbfnT9V4oRxiesTyBLP9tAVE='
265
- nf.status_code.must_equal '100'
266
- nf.status_motive.must_equal 'Autorizado o uso da NF-e'
267
- nf.chave_de_acesso.must_equal '42170108897094000155550010000000051201601010'
268
- nf.situation.must_equal :adjusted
269
- nf.xml.must_equal xml_nfe_with_proc, "Não deve duplicar os protocolos se já houver algum protocolo em nfeProc"
270
- end
754
+ def must_use_SVCAN_for_SVC_mode
755
+ subject.assign_attributes(env: :production, tipo_emissao: :svc)
756
+ client_wsdl.globals[:wsdl].must_equal 'https://www.svc.fazenda.gov.br/NfeConsulta2/NfeConsulta2.asmx?wsdl'
757
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
758
+ client_wsdl.globals[:ssl_version].must_equal :TLSv1
759
+ client_wsdl.globals[:follow_redirects].must_equal false
760
+ client_wsdl.globals[:headers].must_be_nil
761
+
762
+ subject.instance_variable_set(:@client_wsdl, nil)
763
+ subject.assign_attributes(env: :test, tipo_emissao: :svc)
764
+ client_wsdl = subject.client_wsdl
765
+ client_wsdl.globals[:wsdl].must_equal 'https://hom.svc.fazenda.gov.br/NfeConsulta2/NfeConsulta2.asmx?wsdl'
766
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
767
+ client_wsdl.globals[:ssl_version].must_equal :TLSv1
768
+ client_wsdl.globals[:follow_redirects].must_equal false
769
+ client_wsdl.globals[:headers].must_be_nil
770
+ end
271
771
 
272
- it "Quando tem mais de um evento e tem um evento de Cancelamento, sempre deve ser o principal" do
273
- subject.original_xml = xml_nfe_with_proc
274
- savon.expects(subject.method_wsdl).returns( response_success_many_events_with_cancel )
275
- subject.request
276
- response = subject.response
277
-
278
- response.environment.must_equal :production
279
- response.app_version.must_equal 'SVRS201610061505'
280
- response.processed_at.must_equal Time.parse('2017-01-03T08:56:39-02:00')
281
- response.protocol.must_be_nil
282
- response.request_status.must_equal :success
283
- response.processing_status_code.must_equal '101'
284
- response.processing_status_motive.must_equal 'Cancelamento de NF-e homologado'
285
- response.processing_status.must_equal :success
286
- response.main_event.wont_be_nil
287
- response.events.size.must_equal 3
288
-
289
- events = response.events.sort_by{|e| [e.sequence.to_i, (e.registred_at||Time.current)] }
290
- response.main_event.must_equal events[1]
291
-
292
- events[0].codigo_orgao.must_equal '35'
293
- events[0].status_code.must_equal '135'
294
- events[0].status_motive.must_equal 'Evento registrado e vinculado a NF-e'
295
- events[0].code.must_equal '110110'
296
- events[0].sequence.must_equal 1
297
- events[0].cpf_cnpj_destino.must_equal '04962355000112'
298
- events[0].sent_at.must_equal Time.parse('2014-02-05T16:06:30-02:00')
299
- events[0].registred_at.must_equal Time.parse('2014-02-05T16:06:32-02:00')
300
- events[0].event_protocol.must_equal ''
301
- events[0].ret_event_protocol.must_equal '135140000457555'
302
- events[0].description.must_equal 'Carta de Correcao'
303
- events[0].justification.must_equal ''
304
- events[0].correction_text.must_equal 'teste de consulta de nfe corrigida primeira coorecao para consulta de nota'
305
- events[0].xml.must_equal read_fixture('product/response/v3.10/nfe_consulta_protocolo/event_xml/event_1.xml')
306
-
307
- events[2].codigo_orgao.must_equal '35'
308
- events[2].status_code.must_equal '135'
309
- events[2].status_motive.must_equal 'Evento registrado e vinculado a NF-e'
310
- events[2].code.must_equal '110110'
311
- events[2].sequence.must_equal 2
312
- events[2].cpf_cnpj_destino.must_equal '04962355000112'
313
- events[2].sent_at.must_equal Time.parse('2014-02-05T16:06:30-02:00')
314
- events[2].registred_at.must_equal Time.parse('2014-02-05T16:06:32-02:00')
315
- events[2].event_protocol.must_equal ''
316
- events[2].ret_event_protocol.must_equal '135140000457416'
317
- events[2].description.must_equal 'Carta de Correcao'
318
- events[2].justification.must_equal ''
319
- events[2].correction_text.must_equal 'teste de consulta de nfe corrigida segunda coorecao para consulta de nota'
320
- events[2].xml.must_equal read_fixture('product/response/v3.10/nfe_consulta_protocolo/event_xml/event_2.xml')
321
-
322
- events[1] = response.main_event
323
- events[1].codigo_orgao.must_equal '42'
324
- events[1].status_code.must_equal '135'
325
- events[1].status_motive.must_equal 'Evento registrado e vinculado a NF-e'
326
- events[1].code.must_equal '110111'
327
- events[1].sequence.must_equal 1
328
- events[1].cpf_cnpj_destino.must_equal '00090742403050'
329
- events[1].sent_at.must_equal Time.parse('2017-01-03T08:54:58-02:00')
330
- events[1].registred_at.must_equal Time.parse('2017-01-03T08:55:05-02:00')
331
- events[1].event_protocol.must_equal '342170000000903'
332
- events[1].ret_event_protocol.must_equal '342170000000906'
333
- events[1].description.must_equal 'Cancelamento'
334
- events[1].justification.must_equal 'Cancelamento para teste'
335
- events[1].correction_text.must_equal ''
336
- events[1].xml.must_equal read_fixture('product/response/v3.10/nfe_consulta_protocolo/event_xml/event_cancel.xml')
337
-
338
- nf = response.nota_fiscal
339
- nf.processed_at.must_equal Time.parse('2017-01-03T08:53:13-02:00')
340
- nf.protocol.must_equal '342170000000903'
341
- nf.digest_value.must_equal '2N5tbfnT9V4oRxiesTyBLP9tAVE='
342
- nf.status_code.must_equal '100'
343
- nf.status_motive.must_equal 'Autorizado o uso da NF-e'
344
- nf.chave_de_acesso.must_equal '42170108897094000155550010000000051201601010'
345
- nf.situation.must_equal :canceled
346
- nf.xml.must_equal xml_nfe_with_proc, "Não deve duplicar os protocolos se já houver algum protocolo em nfeProc"
347
- end
772
+ def must_use_SVCRS_for_SVC_mode
773
+ subject.assign_attributes(env: :production, tipo_emissao: :svc)
774
+ client_wsdl.globals[:wsdl].must_equal 'https://nfe.svrs.rs.gov.br/ws/NfeConsulta/NfeConsulta2.asmx?wsdl'
775
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
776
+ client_wsdl.globals[:ssl_version].must_equal :SSLv3
777
+ client_wsdl.globals[:follow_redirects].must_equal false
778
+ client_wsdl.globals[:headers].must_be_nil
779
+
780
+ subject.instance_variable_set(:@client_wsdl, nil)
781
+ subject.assign_attributes(env: :test, tipo_emissao: :svc)
782
+ client_wsdl = subject.client_wsdl
783
+ client_wsdl.globals[:wsdl].must_equal 'https://nfe-homologacao.svrs.rs.gov.br/ws/NfeConsulta/NfeConsulta2.asmx?wsdl'
784
+ client_wsdl.globals[:ssl_verify_mode].must_equal :none
785
+ client_wsdl.globals[:ssl_version].must_equal :SSLv3
786
+ client_wsdl.globals[:follow_redirects].must_equal false
787
+ client_wsdl.globals[:headers].must_be_nil
348
788
  end
349
789
  end