spei-python 0.52.0__py3-none-any.whl → 0.53.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- spei/mappings.py +1 -0
- spei/resources/acuse.py +1 -1
- spei/resources/cda.py +1 -1
- spei/resources/ensesion.py +1 -1
- spei/resources/mensaje.py +1 -1
- spei/resources/orden.py +1 -1
- spei/resources/respuesta.py +1 -1
- spei/responses/respuesta.py +35 -0
- spei/sice.py +19 -12
- spei/validators.py +1 -1
- {spei_python-0.52.0.dist-info → spei_python-0.53.0.dist-info}/METADATA +3 -3
- {spei_python-0.52.0.dist-info → spei_python-0.53.0.dist-info}/RECORD +13 -13
- {spei_python-0.52.0.dist-info → spei_python-0.53.0.dist-info}/WHEEL +0 -0
spei/mappings.py
CHANGED
|
@@ -11,6 +11,7 @@ ORDEN_RESPONSES = MappingProxyType(
|
|
|
11
11
|
CategoriaOrdenPago.odps_liquidadas_cargos: CategoriaOrdenPago.odps_liquidadas_cargos_respuesta, # noqa: E501
|
|
12
12
|
CategoriaOrdenPago.odps_canceladas_local: CategoriaOrdenPago.odps_canceladas_local_respuesta, # noqa: E501
|
|
13
13
|
CategoriaOrdenPago.odps_canceladas_x_banxico: CategoriaOrdenPago.odps_canceladas_x_banxico_respuesta, # noqa: E501
|
|
14
|
+
CategoriaOrdenPago.cargar_odp: CategoriaOrdenPago.cargar_odp_respuesta,
|
|
14
15
|
},
|
|
15
16
|
)
|
|
16
17
|
|
spei/resources/acuse.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from typing import Any, Optional, Union
|
|
2
2
|
|
|
3
3
|
from lxml import etree
|
|
4
|
-
from pydantic import BaseModel
|
|
4
|
+
from pydantic.v1 import BaseModel
|
|
5
5
|
|
|
6
6
|
from spei.errors.sice import CodigoErrorAcuseBanxico, CodigoErrorAcuseServidor
|
|
7
7
|
from spei.types.sice import CodigoRespuestaAcuse, TipoRespuestaAcuse
|
spei/resources/cda.py
CHANGED
spei/resources/ensesion.py
CHANGED
spei/resources/mensaje.py
CHANGED
spei/resources/orden.py
CHANGED
spei/resources/respuesta.py
CHANGED
spei/responses/respuesta.py
CHANGED
|
@@ -2,7 +2,12 @@ from typing import Type
|
|
|
2
2
|
|
|
3
3
|
from lxml import etree
|
|
4
4
|
|
|
5
|
+
from spei.requests.respuesta import XML_SCHEMA_NS
|
|
6
|
+
from spei.requests.respuesta import BodyElement as BodyElementP2P
|
|
7
|
+
from spei.requests.respuesta import EnvelopeElement as EnvelopeElementP2P
|
|
8
|
+
from spei.requests.respuesta import RespuestaElement as RespuestaElementP2P
|
|
5
9
|
from spei.resources import Respuesta
|
|
10
|
+
from spei.types import CategoriaOrdenPago
|
|
6
11
|
|
|
7
12
|
|
|
8
13
|
class RespuestaElement(object):
|
|
@@ -19,6 +24,19 @@ class MensajeElement(object):
|
|
|
19
24
|
)
|
|
20
25
|
|
|
21
26
|
|
|
27
|
+
class MensajeElementP2P(object):
|
|
28
|
+
def __new__(cls, respuesta: str, categoria: CategoriaOrdenPago):
|
|
29
|
+
qname = etree.QName(XML_SCHEMA_NS, 'type')
|
|
30
|
+
|
|
31
|
+
mensaje = etree.Element(
|
|
32
|
+
'mensaje',
|
|
33
|
+
{qname: 'mensaje'},
|
|
34
|
+
categoria=categoria,
|
|
35
|
+
)
|
|
36
|
+
mensaje.append(respuesta)
|
|
37
|
+
return mensaje
|
|
38
|
+
|
|
39
|
+
|
|
22
40
|
class RootElement(object):
|
|
23
41
|
def __new__(cls, body):
|
|
24
42
|
return body.find('{http://www.praxis.com.mx/}respuesta')
|
|
@@ -35,3 +53,20 @@ class RespuestaResponse(object):
|
|
|
35
53
|
def __new__(cls, respuesta):
|
|
36
54
|
mensaje = etree.fromstring(respuesta) # noqa: S320
|
|
37
55
|
return RespuestaElement(MensajeElement(RootElement(BodyElement((mensaje)))))
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
class RespuestaResponseP2P(object):
|
|
59
|
+
def __init__(self, respuesta, categoria):
|
|
60
|
+
self.tree = EnvelopeElementP2P(
|
|
61
|
+
BodyElementP2P(
|
|
62
|
+
RespuestaElementP2P(
|
|
63
|
+
MensajeElementP2P(respuesta, categoria),
|
|
64
|
+
),
|
|
65
|
+
),
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
def __bytes__(self):
|
|
69
|
+
return etree.tostring(self.tree, encoding='utf-8')
|
|
70
|
+
|
|
71
|
+
def __str__(self):
|
|
72
|
+
return etree.tostring(self.tree, encoding='unicode')
|
spei/sice.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import logging
|
|
2
|
+
from typing import Optional, Tuple, Type
|
|
2
3
|
from urllib.parse import urljoin
|
|
3
4
|
|
|
4
5
|
import requests
|
|
@@ -14,27 +15,33 @@ logger.setLevel(logging.DEBUG)
|
|
|
14
15
|
class BaseClient(object):
|
|
15
16
|
def __init__(
|
|
16
17
|
self,
|
|
17
|
-
host,
|
|
18
|
-
verify=False,
|
|
19
|
-
http_client=requests,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
self.
|
|
18
|
+
host: str,
|
|
19
|
+
verify: bool = False,
|
|
20
|
+
http_client: Type[requests.Session] = requests.Session,
|
|
21
|
+
auth: Optional[Tuple[str, str]] = None,
|
|
22
|
+
) -> None:
|
|
23
|
+
self.host: str = host
|
|
24
|
+
self.session: requests.Session = http_client()
|
|
23
25
|
self.session.headers.update({'Content-Type': 'application/xml'})
|
|
24
26
|
self.session.verify = verify
|
|
27
|
+
if auth:
|
|
28
|
+
self.session.auth = auth
|
|
25
29
|
|
|
26
30
|
def registra_cda(
|
|
27
31
|
self,
|
|
28
|
-
cda_data,
|
|
29
|
-
cda_cls=CDA,
|
|
30
|
-
acuse_response_cls=AcuseResponse,
|
|
31
|
-
endpoint='/enlace-cep/EnvioCdaPortTypeImpl?wsdl',
|
|
32
|
-
):
|
|
32
|
+
cda_data: dict,
|
|
33
|
+
cda_cls: Type[CDA] = CDA,
|
|
34
|
+
acuse_response_cls: Type[AcuseResponse] = AcuseResponse,
|
|
35
|
+
endpoint: str = '/enlace-cep/EnvioCdaPortTypeImpl?wsdl',
|
|
36
|
+
) -> AcuseResponse:
|
|
33
37
|
orden = cda_cls(**cda_data)
|
|
34
38
|
soap_request = CDARequest(orden)
|
|
35
39
|
logger.info(soap_request)
|
|
36
40
|
cda_url = urljoin(self.host, endpoint)
|
|
37
|
-
response = self.session.post(
|
|
41
|
+
response: requests.Response = self.session.post(
|
|
42
|
+
data=soap_request, # type: ignore
|
|
43
|
+
url=cda_url,
|
|
44
|
+
)
|
|
38
45
|
logger.info(response.text)
|
|
39
46
|
response.raise_for_status()
|
|
40
47
|
return acuse_response_cls(response.text)
|
spei/validators.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: spei-python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.53.0
|
|
4
4
|
Summary:
|
|
5
5
|
Author: tech
|
|
6
6
|
Author-email: tech@fondeadora.com
|
|
@@ -11,9 +11,9 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.11
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.12
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
-
Requires-Dist: cryptography (>=3.0,<
|
|
14
|
+
Requires-Dist: cryptography (>=3.0,<44.1)
|
|
15
15
|
Requires-Dist: lxml (>=5.0.0,<6.0.0)
|
|
16
|
-
Requires-Dist: pydantic (>=1.
|
|
16
|
+
Requires-Dist: pydantic (>=1.10.17,<3)
|
|
17
17
|
Requires-Dist: requests (>=2.32.2,<3.0.0)
|
|
18
18
|
Requires-Dist: unidecode (>=1.3.8,<2.0.0)
|
|
19
19
|
Description-Content-Type: text/markdown
|
|
@@ -10,30 +10,30 @@ spei/errors/__init__.py,sha256=vEL39E44fDD2nkmhVi3lqC1P5nXUNQDX1_GtzR6d4jk,100
|
|
|
10
10
|
spei/errors/sice.py,sha256=SZqA2DnkFxE7ux4obXXzED7AyQwOmOvxjTXB_etenI0,4363
|
|
11
11
|
spei/errors/spei.py,sha256=ne3Qg5ciRo_4TkiR4xJOSK7WQ-teeG6I9-dxqykUH-0,16065
|
|
12
12
|
spei/exceptions.py,sha256=1T0FJydzgXwvctCxw9qlqqxhil74CaEfmPlVkmmFbvU,382
|
|
13
|
-
spei/mappings.py,sha256=
|
|
13
|
+
spei/mappings.py,sha256=YB7iAXIIXsQsKod05ENnT2UOYkMT3ij0K5HC6DR2_Pc,2966
|
|
14
14
|
spei/requests/__init__.py,sha256=dD68SgnGmIjxuDibAGyBf7_tJnetUxU4QPa2ujr9OpY,240
|
|
15
15
|
spei/requests/acuse.py,sha256=d4_7XKTsiGNnPHrFWTB_jStFUM3lMWOruqW87ZR0CrI,2311
|
|
16
16
|
spei/requests/cda.py,sha256=RyVMnU19639BZyoccZeU39Rw8JmBLKmTkn8Zro9L7Ys,1156
|
|
17
17
|
spei/requests/orden.py,sha256=iec7McxjUpJCB94_raStSSKMD1Od4AzrqoKj7uatGJk,1444
|
|
18
18
|
spei/requests/respuesta.py,sha256=oH0EU4qJ7cPmYjMg5v_UBbZMf6ZdrXA7sZY7fOMtzs8,1724
|
|
19
19
|
spei/resources/__init__.py,sha256=cJL9KI0ZBKHcDN5me8yuvschQMW1HH_bpLS7TnLXZw4,487
|
|
20
|
-
spei/resources/acuse.py,sha256=
|
|
21
|
-
spei/resources/cda.py,sha256=
|
|
22
|
-
spei/resources/ensesion.py,sha256=
|
|
23
|
-
spei/resources/mensaje.py,sha256=
|
|
24
|
-
spei/resources/orden.py,sha256=
|
|
20
|
+
spei/resources/acuse.py,sha256=eU8XA0qn4XUF9awhzWCIJhwNto3JKEdFQaXzmUyuCKM,5599
|
|
21
|
+
spei/resources/cda.py,sha256=TWA0JsWLMeg-Tx6QICqsKag9hmwa0K-ejiJv_AUJ0P4,2700
|
|
22
|
+
spei/resources/ensesion.py,sha256=F6hTuphIZUv8rND6aSMkb7zk-061HND4RwCZBYYEuLQ,1588
|
|
23
|
+
spei/resources/mensaje.py,sha256=1gEbwDX_eSRDfry5Rh5bkBfxJSy5UaHzOEy-Y4pka90,1807
|
|
24
|
+
spei/resources/orden.py,sha256=E7JKCittJmVHqkg_DaU7wJyFsk-p22TlVspAJYHlQKM,7070
|
|
25
25
|
spei/resources/payments.py,sha256=l32vrXuXP0VH0iY3adR0_C8_S8_3vOiaaSgLdd22tp4,8880
|
|
26
|
-
spei/resources/respuesta.py,sha256=
|
|
26
|
+
spei/resources/respuesta.py,sha256=OoesLYZsxluZHjnwhSVBRYKKJSEWPxFVOH1pJIyu2Vk,1500
|
|
27
27
|
spei/responses/__init__.py,sha256=WxHb0KJ1sI5m6iLfxtf3h8MnqubQlxdtiaarXJvZdkM,247
|
|
28
28
|
spei/responses/acuse.py,sha256=ZGfP45XYvDSDbgfSKWeraDpFApDc0oks05_tQH-bwzM,650
|
|
29
29
|
spei/responses/orden.py,sha256=a-GE62-OBWVNpW2RuVKgNqWnY2cNy88shUDLQAL21dU,1068
|
|
30
|
-
spei/responses/respuesta.py,sha256=
|
|
31
|
-
spei/sice.py,sha256=
|
|
30
|
+
spei/responses/respuesta.py,sha256=cKK-46AimKEdqmMLOO1syGUWuBldnWFdAVNcsubpn6I,2162
|
|
31
|
+
spei/sice.py,sha256=p0Y34sUZ2a8jECsutfbJupDus4n8CSPNsajGCl8_SKc,1434
|
|
32
32
|
spei/types/__init__.py,sha256=FKFSe-eTgKjf0qFSMqYZDkgYYIT3-5Je4Wc5QRNAp7U,643
|
|
33
33
|
spei/types/sice.py,sha256=xFSoiLklRNWXoWwZXpSN8-SdkliNK23_MZbhcOc7a9s,222
|
|
34
34
|
spei/types/spei.py,sha256=rgdbWEMqIHNuSBaCwWmpziK35JcQ-q3nDHZR7-rDpMU,4765
|
|
35
35
|
spei/utils.py,sha256=Lje_sg6hLKQxsPmqf7ovVKKVcGZi7LlgNNg1MRtWnRo,247
|
|
36
|
-
spei/validators.py,sha256=
|
|
37
|
-
spei_python-0.
|
|
38
|
-
spei_python-0.
|
|
39
|
-
spei_python-0.
|
|
36
|
+
spei/validators.py,sha256=wACDKfpyyuREvrNuUR20xcMyPSwDygWQX9oOQLiMwiE,745
|
|
37
|
+
spei_python-0.53.0.dist-info/METADATA,sha256=7GjBI6hb7iI3Xbwf0i853j-Z8CdqOmzTkrgwTzlMuaI,3954
|
|
38
|
+
spei_python-0.53.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
39
|
+
spei_python-0.53.0.dist-info/RECORD,,
|
|
File without changes
|