diff --git a/source/comerciodigital/comercio.py b/source/comerciodigital/comercio.py index 16d725e..bcca148 100644 --- a/source/comerciodigital/comercio.py +++ b/source/comerciodigital/comercio.py @@ -78,8 +78,8 @@ class PACComercioDigital(object): def __init__(self): self.error = '' - self.cfdi_uuid = '' - self.date_stamped = '' + # ~ self.cfdi_uuid = '' + # ~ self.date_stamped = '' def _error(self, msg): self.error = str(msg) @@ -133,14 +133,19 @@ class PACComercioDigital(object): xml = result.content tree = ET.fromstring(xml) - self.cfdi_uuid = tree.xpath( + cfdi_uuid = tree.xpath( 'string(//cfdi:Complemento/tdf:TimbreFiscalDigital/@UUID)', namespaces=self.NS_CFDI) - self.date_stamped = tree.xpath( + date_stamped = tree.xpath( 'string(//cfdi:Complemento/tdf:TimbreFiscalDigital/@FechaTimbrado)', namespaces=self.NS_CFDI) - return xml.decode() + data = { + 'xml': xml.decode(), + 'uuid': cfdi_uuid, + 'date': date_stamped, + } + return data def _get_data_cancel(self, cfdi, info, auth): NS_CFDI = {