Verificar cancelación con certificados en CD

This commit is contained in:
El Mau 2022-01-22 19:47:41 -06:00
parent 5b997f7858
commit d237b33020
2 changed files with 3 additions and 1 deletions

View File

@ -28,6 +28,7 @@ class SATCertificate(object):
self._init_values()
self._get_data_cer(cer)
self._get_data_key(key, password)
self._p = self._get_hash()
def _init_values(self):
self._rfc = ''

View File

@ -765,7 +765,8 @@ def get_pac_by_rfc(cfdi):
def _cancel_with_cert(invoice, args, auth, certificado):
cert = SATCertificate(certificado.cer, certificado.key_enc.encode())
pac = PACS[auth['pac']]()
info = {'cer': cert.cer_pem, 'key': cert.key_pem, 'pass': 'p', 'args': args}
info = {'cer': cert.cer_pem, 'key': cert.key_pem, 'pass': cert._p, 'args': args}
# ~ print(info['pass'])
result = pac.cancel(invoice.xml, info, auth)
if pac.error: