Browse Source

Merge branch 'master3' into master3

pull/214/head
maiconkkl 7 years ago
committed by GitHub
parent
commit
b794821739
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      pytrustnfe/nfe/__init__.py
  2. 7
      pytrustnfe/nfe/patch.py
  3. 2
      requirements.txt
  4. 2
      setup.py

2
pytrustnfe/nfe/__init__.py

@ -92,7 +92,7 @@ def _send(certificado, method, **kwargs):
session = _get_session(certificado) session = _get_session(certificado)
patch = has_patch(kwargs['estado'], method) patch = has_patch(kwargs['estado'], method)
if patch: if patch:
return patch(session, xml_send)
return patch(session, xml_send, kwargs['ambiente'])
transport = Transport(session=session) transport = Transport(session=session)
first_op, client = _get_client(base_url, transport) first_op, client = _get_client(base_url, transport)
return _send_zeep(first_op, client, xml_send) return _send_zeep(first_op, client, xml_send)

7
pytrustnfe/nfe/patch.py

@ -2,7 +2,7 @@ from ..Servidores import SIGLA_ESTADO
from pytrustnfe.xml import sanitize_response 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>\ soap = '<Envelope xmlns="http://www.w3.org/2003/05/soap-envelope"><Body>\
<nfeDadosMsg xmlns="http://www.portalfiscal.inf.br/nfe/wsdl/NFeInutilizacao4"\ <nfeDadosMsg xmlns="http://www.portalfiscal.inf.br/nfe/wsdl/NFeInutilizacao4"\
>' + xml_send + '</nfeDadosMsg></Body></Envelope>' >' + xml_send + '</nfeDadosMsg></Body></Envelope>'
@ -10,6 +10,11 @@ def nfeInutilizacaoCE(session, xml_send):
'SOAPAction': "", 'SOAPAction': "",
'Content-Type': 'application/soap+xml; charset="utf-8"' 'Content-Type': 'application/soap+xml; charset="utf-8"'
} }
if ambiente == 1:
response = session.post(
'https://nfe.sefaz.ce.gov.br/nfe4/services/NFeInutilizacao4',
data=soap, headers=headers)
else:
response = session.post( response = session.post(
'https://nfeh.sefaz.ce.gov.br/nfe4/services/NFeInutilizacao4', 'https://nfeh.sefaz.ce.gov.br/nfe4/services/NFeInutilizacao4',
data=soap, headers=headers) data=soap, headers=headers)

2
requirements.txt

@ -12,7 +12,7 @@ pyOpenSSL >= 16.0.0, < 18
certifi >= 2015.11.20.1 certifi >= 2015.11.20.1
xmlsec >= 1.3.3 xmlsec >= 1.3.3
reportlab reportlab
pytest
pytest>=4.1.1
pytest-cov pytest-cov
pytz pytz
zeep zeep

2
setup.py

@ -2,7 +2,7 @@
from setuptools import setup, find_packages from setuptools import setup, find_packages
VERSION = "1.0.30"
VERSION = "1.0.31"
setup( setup(

Loading…
Cancel
Save