From ae8b27fa98cb2c2190bebcd613fe779623e61d59 Mon Sep 17 00:00:00 2001 From: Luis Felipe Mileo Date: Thu, 31 May 2018 14:23:01 -0300 Subject: [PATCH] =?UTF-8?q?[NEW][MDF-E]=20Autoriza=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pynfe/processamento/mdfe.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pynfe/processamento/mdfe.py b/pynfe/processamento/mdfe.py index 7c2bf26..db9aa6e 100644 --- a/pynfe/processamento/mdfe.py +++ b/pynfe/processamento/mdfe.py @@ -95,3 +95,24 @@ class ComunicacaoMDFE(ComunicacaoSefaz): self._construir_etree_ds(raiz) ) return self._post(url, xml) + + def autorizacao(self, documento, id_lote=1): + + url, metodo = self._get_url_metodo(WS_MDFE_RECEPCAO) + + raiz = TEnviMDFe( + versao=self._versao, + idLote=id_lote, + MDFe=documento, + ) + raiz.original_tagname_ = 'enviMDFe' + + xml = self._construir_xml_soap( + metodo, + self._construir_etree_ds(raiz) + ) + # Faz request no Servidor da Sefaz + retorno = self._post(url, xml) + + # TODO: Processar o retorno + return retorno