forked from elmau/empresa-libre
Quitar KeyInfo del XML de cancelación
This commit is contained in:
parent
825e23e369
commit
a0a8e0ce62
|
@ -175,12 +175,12 @@ class SATCertificate(object):
|
||||||
|
|
||||||
node = xmlsec.tree.find_node(tree, 'X509Certificate')
|
node = xmlsec.tree.find_node(tree, 'X509Certificate')
|
||||||
node.text = self.cer_txt
|
node.text = self.cer_txt
|
||||||
# ~ node = xmlsec.tree.find_node(tree, 'X509IssuerName')
|
node = xmlsec.tree.find_node(tree, 'X509IssuerName')
|
||||||
# ~ node.text = self.issuer
|
node.text = self.issuer
|
||||||
node = xmlsec.tree.find_node(tree, 'X509SerialNumber')
|
node = xmlsec.tree.find_node(tree, 'X509SerialNumber')
|
||||||
node.text = self.serial_number
|
node.text = self.serial_number
|
||||||
# ~ node = xmlsec.tree.find_node(tree, 'SignatureValue')
|
node = xmlsec.tree.find_node(tree, 'SignatureValue')
|
||||||
# ~ node.text = node.text.replace('\n', '')
|
node.text = node.text.replace('\n', '')
|
||||||
# ~ node = xmlsec.tree.find_node(tree, 'Modulus')
|
# ~ node = xmlsec.tree.find_node(tree, 'Modulus')
|
||||||
# ~ node.text = node.text.replace('\n', '')
|
# ~ node.text = node.text.replace('\n', '')
|
||||||
|
|
||||||
|
|
|
@ -110,6 +110,10 @@ class PACComercioDigital(object):
|
||||||
headers['Connection'] = 'Keep-Alive'
|
headers['Connection'] = 'Keep-Alive'
|
||||||
headers['Expect'] = '100-continue'
|
headers['Expect'] = '100-continue'
|
||||||
|
|
||||||
|
req = requests.Request('POST', url, headers=headers, data=data)
|
||||||
|
prepared = req.prepare()
|
||||||
|
pretty_print_POST(prepared)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
result = requests.post(url, data=data, headers=headers, timeout=TIMEOUT)
|
result = requests.post(url, data=data, headers=headers, timeout=TIMEOUT)
|
||||||
except ConnectionError as e:
|
except ConnectionError as e:
|
||||||
|
@ -269,11 +273,6 @@ class PACComercioDigital(object):
|
||||||
|
|
||||||
url = self.URL['cancelxml']
|
url = self.URL['cancelxml']
|
||||||
headers = self._get_headers_cancel_xml(cfdi, info, auth)
|
headers = self._get_headers_cancel_xml(cfdi, info, auth)
|
||||||
|
|
||||||
req = requests.Request('POST', url, headers=headers, data=xml)
|
|
||||||
prepared = req.prepare()
|
|
||||||
pretty_print_POST(prepared)
|
|
||||||
|
|
||||||
result = self._post(url, xml, headers)
|
result = self._post(url, xml, headers)
|
||||||
|
|
||||||
if result is None:
|
if result is None:
|
||||||
|
|
|
@ -293,4 +293,5 @@ DEFAULT_GLOBAL = {
|
||||||
# ~ </Cancelacion>
|
# ~ </Cancelacion>
|
||||||
# ~ </CancelaCFD>"""
|
# ~ </CancelaCFD>"""
|
||||||
|
|
||||||
TEMPLATE_CANCEL = """<CancelaCFD xmlns="http://cancelacfd.sat.gob.mx"><Cancelacion xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" RfcEmisor="{rfc}" Fecha="{fecha}"><Folios><Folio UUID="{uuid}" Motivo="{motivo}"{folio}/></Folios><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue/></Reference></SignedInfo><SignatureValue/><KeyInfo><X509Data><X509IssuerSerial><X509IssuerName/><X509SerialNumber/></X509IssuerSerial><X509Certificate/></X509Data><KeyValue><RSAKeyValue><Modulus/><Exponent/></RSAKeyValue></KeyValue></KeyInfo></Signature></Cancelacion></CancelaCFD>"""
|
# ~ TEMPLATE_CANCEL = """<CancelaCFD xmlns="http://cancelacfd.sat.gob.mx"><Cancelacion xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" RfcEmisor="{rfc}" Fecha="{fecha}"><Folios><Folio UUID="{uuid}" Motivo="{motivo}"{folio}/></Folios><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue/></Reference></SignedInfo><SignatureValue/><KeyInfo><X509Data><X509IssuerSerial><X509IssuerName/><X509SerialNumber/></X509IssuerSerial><X509Certificate/></X509Data><KeyValue><RSAKeyValue><Modulus/><Exponent/></RSAKeyValue></KeyValue></KeyInfo></Signature></Cancelacion></CancelaCFD>"""
|
||||||
|
TEMPLATE_CANCEL = """<CancelaCFD xmlns="http://cancelacfd.sat.gob.mx"><Cancelacion xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" RfcEmisor="{rfc}" Fecha="{fecha}"><Folios><Folio UUID="{uuid}" Motivo="{motivo}"{folio}/></Folios><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue/></Reference></SignedInfo><SignatureValue/><KeyInfo><X509Data><X509IssuerSerial><X509IssuerName/><X509SerialNumber/></X509IssuerSerial><X509Certificate/></X509Data></KeyInfo></Signature></Cancelacion></CancelaCFD>"""
|
||||||
|
|
Loading…
Reference in New Issue