Skip to content

Commit a82bccd

Browse files
committed
Fixed Descarga Masiva
1 parent 5f7ae70 commit a82bccd

File tree

6 files changed

+24
-154
lines changed

6 files changed

+24
-154
lines changed

satcfdi/pacs/sat.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -247,17 +247,17 @@ def todatetime(name):
247247
}
248248

249249

250-
# class _CFDISolicitaDescarga(_SATRequest):
251-
# xml_name = 'solicita.xml'
252-
# soap_url = 'https://cfdidescargamasivasolicitud.clouda.sat.gob.mx/SolicitaDescargaService.svc'
253-
# soap_action = 'http://DescargaMasivaTerceros.sat.gob.mx/ISolicitaDescargaService/SolicitaDescarga'
254-
# solicitud_xpath = '{*}Body/{*}SolicitaDescarga/{*}solicitud'
255-
#
256-
# def process_response(self, response: etree.Element):
257-
# res = response.find('{*}Body/{*}SolicitaDescargaResponse/{*}SolicitaDescargaResult')
258-
# return {
259-
# **res.attrib
260-
# }
250+
class _CFDISolicitaDescarga(_SATRequest):
251+
xml_name = 'solicita.xml'
252+
soap_url = 'https://cfdidescargamasivasolicitud.clouda.sat.gob.mx/SolicitaDescargaService.svc'
253+
soap_action = 'http://DescargaMasivaTerceros.sat.gob.mx/ISolicitaDescargaService/SolicitaDescarga'
254+
solicitud_xpath = '{*}Body/{*}SolicitaDescarga/{*}solicitud'
255+
256+
def process_response(self, response: etree.Element):
257+
res = response.find('{*}Body/{*}SolicitaDescargaResponse/{*}SolicitaDescargaResult')
258+
return {
259+
**res.attrib
260+
}
261261

262262
class _CFDISolicitaDescargaEmitidos(_SATRequest):
263263
xml_name = 'solicitaEmitidos.xml'
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0"?>
2+
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
3+
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
4+
<SolicitaDescargaFolioResponse xmlns="http://DescargaMasivaTerceros.sat.gob.mx">
5+
<SolicitaDescargaFolioResult IdSolicitud="d49af78d-1c80-4221-a48d-345ace91626b" CodEstatus="5000" Mensaje="Solicitud Aceptada" />
6+
</SolicitaDescargaFolioResponse>
7+
</s:Body>
8+
</s:Envelope>

tests/pac_sat_responses/response-with-id.xml

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/test_pac_sat.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,16 +174,15 @@ def test_pac_sat_uuid():
174174
"AutenticaResult": "token_comprobante"
175175
}
176176

177-
with open(os.path.join(current_dir, 'pac_sat_responses', 'response-with-id.xml'), 'rb') as f:
177+
with open(os.path.join(current_dir, 'pac_sat_responses', 'response-folio-with-id.xml'), 'rb') as f:
178178
content = f.read()
179179

180180
with mock.patch(f'requests.post') as mk:
181181
mk.return_value.ok = True
182182
mk.return_value.content = content
183183

184-
res = sat_service.recover_comprobante_request(
185-
tipo_solicitud=TipoDescargaMasivaTerceros.CFDI,
186-
uuid="6114cfd0-87d2-45b8-99b1-7c19475c9cda",
184+
res = sat_service.recover_comprobante_uuid_request(
185+
folio="6114cfd0-87d2-45b8-99b1-7c19475c9cda",
187186
)
188187

189188
mk.assert_called_once()
@@ -202,14 +201,14 @@ def test_pac_sat_rfc():
202201
"AutenticaResult": "token_comprobante"
203202
}
204203

205-
with open(os.path.join(current_dir, 'pac_sat_responses', 'response-with-id.xml'), 'rb') as f:
204+
with open(os.path.join(current_dir, 'pac_sat_responses', 'response-emited-with-id.xml'), 'rb') as f:
206205
content = f.read()
207206

208207
with mock.patch(f'requests.post') as mk:
209208
mk.return_value.ok = True
210209
mk.return_value.content = content
211210

212-
res = sat_service.recover_comprobante_request(
211+
res = sat_service.recover_comprobante_emited_request(
213212
tipo_solicitud=TipoDescargaMasivaTerceros.CFDI,
214213
rfc_emisor="ABC123456ABC",
215214
rfc_receptor="ABC123456ABC",

tests/test_pac_sat/pac_sat_rfc.pretty.py

Lines changed: 0 additions & 66 deletions
This file was deleted.

tests/test_pac_sat/pac_sat_uuid.pretty.py

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)