maiconkkl
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
12 additions and
7 deletions
-
pytrustnfe/nfe/__init__.py
-
pytrustnfe/nfe/patch.py
-
requirements.txt
-
setup.py
|
|
|
@ -92,7 +92,7 @@ def _send(certificado, method, **kwargs): |
|
|
|
session = _get_session(certificado) |
|
|
|
patch = has_patch(kwargs['estado'], method) |
|
|
|
if patch: |
|
|
|
return patch(session, xml_send) |
|
|
|
return patch(session, xml_send, kwargs['ambiente']) |
|
|
|
transport = Transport(session=session) |
|
|
|
first_op, client = _get_client(base_url, transport) |
|
|
|
return _send_zeep(first_op, client, xml_send) |
|
|
|
|
|
|
|
@ -2,7 +2,7 @@ from ..Servidores import SIGLA_ESTADO |
|
|
|
from pytrustnfe.xml import sanitize_response |
|
|
|
|
|
|
|
|
|
|
|
def nfeInutilizacaoCE(session, xml_send): |
|
|
|
def nfeInutilizacaoCE(session, xml_send, ambiente): |
|
|
|
soap = '<Envelope xmlns="http://www.w3.org/2003/05/soap-envelope"><Body>\ |
|
|
|
<nfeDadosMsg xmlns="http://www.portalfiscal.inf.br/nfe/wsdl/NFeInutilizacao4"\ |
|
|
|
>' + xml_send + '</nfeDadosMsg></Body></Envelope>' |
|
|
|
@ -10,9 +10,14 @@ def nfeInutilizacaoCE(session, xml_send): |
|
|
|
'SOAPAction': "", |
|
|
|
'Content-Type': 'application/soap+xml; charset="utf-8"' |
|
|
|
} |
|
|
|
response = session.post( |
|
|
|
'https://nfeh.sefaz.ce.gov.br/nfe4/services/NFeInutilizacao4', |
|
|
|
data=soap, headers=headers) |
|
|
|
if ambiente == 1: |
|
|
|
response = session.post( |
|
|
|
'https://nfe.sefaz.ce.gov.br/nfe4/services/NFeInutilizacao4', |
|
|
|
data=soap, headers=headers) |
|
|
|
else: |
|
|
|
response = session.post( |
|
|
|
'https://nfeh.sefaz.ce.gov.br/nfe4/services/NFeInutilizacao4', |
|
|
|
data=soap, headers=headers) |
|
|
|
response, obj = sanitize_response(response.text) |
|
|
|
return { |
|
|
|
'sent_xml': xml_send, |
|
|
|
|
|
|
|
@ -12,7 +12,7 @@ pyOpenSSL >= 16.0.0, < 18 |
|
|
|
certifi >= 2015.11.20.1 |
|
|
|
xmlsec >= 1.3.3 |
|
|
|
reportlab |
|
|
|
pytest |
|
|
|
pytest>=4.1.1 |
|
|
|
pytest-cov |
|
|
|
pytz |
|
|
|
zeep |
|
|
|
@ -2,7 +2,7 @@ |
|
|
|
from setuptools import setup, find_packages |
|
|
|
|
|
|
|
|
|
|
|
VERSION = "1.0.30" |
|
|
|
VERSION = "1.0.31" |
|
|
|
|
|
|
|
|
|
|
|
setup( |
|
|
|
|