forked from elmau/empresa-libre
Cambio de método de cancelación
This commit is contained in:
parent
ea8f88ef1d
commit
ce53a65c66
|
@ -1313,6 +1313,15 @@ def upload_file(rfc, opt, file_obj):
|
|||
return {'status': 'error', 'ok': False}
|
||||
|
||||
|
||||
def _get_pem_from_pfx(cert):
|
||||
tmp_p12 = save_temp(cert.p12)
|
||||
args = "openssl pkcs12 -in '{}' -clcerts -nodes -nocerts " \
|
||||
"-passin pass:'{}' | openssl rsa".format(tmp_p12, _get_md5(cert.rfc))
|
||||
result = _call(args)
|
||||
_kill(tmp_p12)
|
||||
return result.encode()
|
||||
|
||||
|
||||
def cancel_xml(auth, uuid, certificado):
|
||||
from .pac import Finkok as PAC
|
||||
|
||||
|
@ -1328,7 +1337,7 @@ def cancel_xml(auth, uuid, certificado):
|
|||
data = {'ok': True, 'msg': msg, 'row': {'estatus': 'Cancelada'}}
|
||||
pac = PAC(auth)
|
||||
result = pac.cancel_xml(certificado.rfc, str(uuid).upper(),
|
||||
certificado.cer_pem.encode(), certificado.key_enc.encode())
|
||||
certificado.cer_pem.encode(), _get_pem_from_pfx(certificado))
|
||||
if result:
|
||||
codes = {None: '',
|
||||
'Could not get UUID Text': 'UUID no encontrado',
|
||||
|
|
|
@ -117,4 +117,4 @@ IMPUESTOS = {
|
|||
DEFAULT_SAT_PRODUCTO = '01010101'
|
||||
DIR_FACTURAS = 'facturas'
|
||||
USAR_TOKEN = False
|
||||
CANCEL_SIGNATURE = True
|
||||
CANCEL_SIGNATURE = False
|
Loading…
Reference in New Issue