From 4fc6b9dc89ac64fbbea22a51dcddd9d9f85e0e99 Mon Sep 17 00:00:00 2001 From: Felipe Date: Thu, 21 Dec 2017 17:14:45 -0200 Subject: [PATCH] adicionados urls de cidades do dsf --- pytrustnfe/nfse/campinas/__init__.py | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/pytrustnfe/nfse/campinas/__init__.py b/pytrustnfe/nfse/campinas/__init__.py index e5536af..80d839d 100644 --- a/pytrustnfe/nfse/campinas/__init__.py +++ b/pytrustnfe/nfse/campinas/__init__.py @@ -24,8 +24,35 @@ def _render(certificado, method, **kwargs): return xml_send +def _get_url(**kwargs): + + try: + cod_cidade = kwargs['CodCidade'] + except (KeyError, TypeError): + return '' + + urls = { + # Belém - PA + '2715': 'http://www.issdigitalbel.com.br/WsNFe2/LoteRps.jws', + # Sorocaba - SP + '5363': 'http://issdigital.sorocaba.sp.gov.br/WsNFe2/LoteRps.jws', + # Teresina - PI + '3182': 'http://www.issdigitalthe.com.br/WsNFe2/LoteRps.jws', + # Campinas - SP + '4888': 'http://issdigital.campinas.sp.gov.br/WsNFe2/LoteRps.jws?wsdl', + # Uberlandia - MG + '2170': 'http://udigital.uberlandia.mg.gov.br/WsNFe2/LoteRps.jws', + # São Luis - MA + '1314': 'https://stm.semfaz.saoluis.ma.gov.br/WsNFe2/LoteRps?wsdl', + # Campo Grande - MS + '2218': 'http://issdigital.pmcg.ms.gov.br/WsNFe2/LoteRps.jws', + } + + return urls[str(cod_cidade)] + + def _send(certificado, method, **kwargs): - url = 'http://issdigital.campinas.sp.gov.br/WsNFe2/LoteRps.jws?wsdl' # noqa + url = _get_url(**kwargs) path = os.path.join(os.path.dirname(__file__), 'templates')