From 0e7db2b711450356d5d28a84cce55d51395d312d Mon Sep 17 00:00:00 2001 From: El Mau Date: Sat, 22 Jan 2022 22:16:52 -0600 Subject: [PATCH] =?UTF-8?q?Verificar=20cancelaci=C3=B3n=20con=20certificad?= =?UTF-8?q?os=20en=20CD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/app/controllers/pacs/cfdi_cert.py | 3 ++- source/app/controllers/utils.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/source/app/controllers/pacs/cfdi_cert.py b/source/app/controllers/pacs/cfdi_cert.py index 9319da8..eb5ef5f 100644 --- a/source/app/controllers/pacs/cfdi_cert.py +++ b/source/app/controllers/pacs/cfdi_cert.py @@ -28,7 +28,8 @@ class SATCertificate(object): self._init_values() self._get_data_cer(cer) self._get_data_key(key, password) - self._test() + if not password: + self._test() def _test(self): key = self._get_key('') diff --git a/source/app/controllers/utils.py b/source/app/controllers/utils.py index 8259af0..ef45282 100644 --- a/source/app/controllers/utils.py +++ b/source/app/controllers/utils.py @@ -781,8 +781,8 @@ def _cancel_with_cert(invoice, args, auth, certificado): def cancel_xml_sign(invoice, args, auth, certificado): - # ~ if auth['pac'] == 'finkok': - return _cancel_with_cert(invoice, args, auth, certificado) + if auth['pac'] == 'finkok': + return _cancel_with_cert(invoice, args, auth, certificado) cert = SATCertificate(certificado.cer, certificado.key_enc.encode()) pac = PACS[auth['pac']]() @@ -799,7 +799,7 @@ def cancel_xml_sign(invoice, args, auth, certificado): template = TEMPLATE_CANCEL.format(**data) tree = ET.fromstring(template.encode()) sign_xml = cert.sign_xml(tree) - print(sign_xml) + # ~ print(sign_xml) result = pac.cancel_xml(sign_xml, auth, invoice.xml)