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