spei-python 0.49.0__tar.gz → 0.50.0__tar.gz
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_python-0.49.0 → spei_python-0.50.0}/PKG-INFO +1 -1
- {spei_python-0.49.0 → spei_python-0.50.0}/pyproject.toml +3 -3
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/__init__.py +2 -2
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/checksum/generator.py +23 -14
- spei_python-0.50.0/spei/errors/__init__.py +3 -0
- spei_python-0.50.0/spei/mappings.py +43 -0
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/requests/acuse.py +10 -3
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/resources/acuse.py +15 -7
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/resources/cda.py +18 -13
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/resources/mensaje.py +3 -3
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/resources/orden.py +59 -58
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/resources/payments.py +74 -72
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/resources/respuesta.py +15 -5
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/responses/__init__.py +3 -3
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/responses/orden.py +3 -1
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/responses/respuesta.py +3 -1
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/types/spei.py +1 -0
- spei_python-0.49.0/spei/errors/__init__.py +0 -5
- spei_python-0.49.0/spei/mappings.py +0 -37
- {spei_python-0.49.0 → spei_python-0.50.0}/README.md +0 -0
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/README.md +0 -0
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/cep_generator.py +0 -0
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/checksum/__init__.py +0 -0
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/checksum/factory.py +0 -0
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/checksum/types.py +0 -0
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/client.py +0 -0
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/errors/sice.py +0 -0
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/errors/spei.py +0 -0
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/exceptions.py +0 -0
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/requests/__init__.py +0 -0
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/requests/cda.py +0 -0
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/requests/orden.py +0 -0
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/requests/respuesta.py +0 -0
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/resources/__init__.py +0 -0
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/resources/ensesion.py +0 -0
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/responses/acuse.py +0 -0
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/sice.py +0 -0
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/types/__init__.py +0 -0
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/types/sice.py +0 -0
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/utils.py +0 -0
- {spei_python-0.49.0 → spei_python-0.50.0}/spei/validators.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "spei-python"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.50.0"
|
|
4
4
|
description = ""
|
|
5
5
|
authors = ["tech <tech@fondeadora.com>"]
|
|
6
6
|
readme = "README.md"
|
|
@@ -23,7 +23,7 @@ isort = "^5.10.1"
|
|
|
23
23
|
mamba = "^0.11.2"
|
|
24
24
|
wemake-python-styleguide = "^0.18.0"
|
|
25
25
|
pyformat = "^0.7"
|
|
26
|
-
mypy = "^
|
|
26
|
+
mypy = "^1.10"
|
|
27
27
|
|
|
28
28
|
[build-system]
|
|
29
29
|
requires = ["poetry-core>=1.0.0"]
|
|
@@ -32,7 +32,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
32
32
|
|
|
33
33
|
[tool.commitizen]
|
|
34
34
|
name = "cz_conventional_commits"
|
|
35
|
-
version = "0.
|
|
35
|
+
version = "0.50.0"
|
|
36
36
|
tag_format = "v$version"
|
|
37
37
|
bump_message = "bump: Semantic Release Bot: Release Version: $new_version 🤖🚀 [skip ci]"
|
|
38
38
|
version_files = [
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
2
|
from decimal import Decimal
|
|
3
|
-
from typing import
|
|
3
|
+
from typing import Optional
|
|
4
4
|
|
|
5
5
|
from spei.resources import Orden
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class ChecksumGenerator(object):
|
|
9
|
-
def format_data(self):
|
|
9
|
+
def format_data(self, orden: Orden) -> bytes:
|
|
10
10
|
raise NotImplementedError
|
|
11
11
|
|
|
12
|
-
def split_amount(self, amount):
|
|
12
|
+
def split_amount(self, amount: str):
|
|
13
13
|
amount_as_cents = int(Decimal(str(amount)) * 100)
|
|
14
14
|
high = 0
|
|
15
15
|
low = amount_as_cents
|
|
@@ -20,40 +20,49 @@ class ChecksumGenerator(object):
|
|
|
20
20
|
return high, low
|
|
21
21
|
|
|
22
22
|
def _fecha_to_bytearray(self, fecha_operacion: int) -> bytearray:
|
|
23
|
-
|
|
23
|
+
fecha_operacion_dt = datetime.strptime(str(fecha_operacion), '%Y%m%d')
|
|
24
24
|
|
|
25
|
-
day = int.to_bytes(int(
|
|
26
|
-
month = int.to_bytes(int(
|
|
27
|
-
year = int.to_bytes(int(
|
|
28
|
-
return day + month + year
|
|
25
|
+
day = int.to_bytes(int(fecha_operacion_dt.day), 1, 'big')
|
|
26
|
+
month = int.to_bytes(int(fecha_operacion_dt.month), 1, 'big')
|
|
27
|
+
year = int.to_bytes(int(fecha_operacion_dt.year), 2, 'big')
|
|
29
28
|
|
|
30
|
-
|
|
29
|
+
return bytearray(day + month + year)
|
|
30
|
+
|
|
31
|
+
def _clave_to_bytearray(self, clave: Optional[str]) -> bytearray:
|
|
31
32
|
if not clave:
|
|
32
33
|
clave = ''
|
|
33
|
-
return int.to_bytes(int(clave), 4, 'big')
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
return bytearray(int.to_bytes(int(clave), 4, 'big'))
|
|
36
|
+
|
|
37
|
+
def _monto_to_bytearray(self, amount: str) -> bytearray:
|
|
36
38
|
high, low = self.split_amount(amount)
|
|
37
39
|
high = int.to_bytes(int(high), 4, 'big')
|
|
38
40
|
low = int.to_bytes(int(low), 4, 'big')
|
|
39
|
-
|
|
41
|
+
|
|
42
|
+
return bytearray(high + low)
|
|
40
43
|
|
|
41
44
|
def _to_byte_array(
|
|
42
45
|
self,
|
|
43
|
-
value: str, # noqa: WPS110
|
|
46
|
+
value: Optional[str], # noqa: WPS110
|
|
44
47
|
add_zero_byte: bool = False,
|
|
45
48
|
) -> bytearray:
|
|
49
|
+
value = value or '' # noqa: WPS110
|
|
46
50
|
encoded = value.encode('utf-8')
|
|
47
51
|
bytes_ = bytearray(encoded)
|
|
48
52
|
if add_zero_byte:
|
|
49
53
|
bytes_.append(0)
|
|
54
|
+
|
|
50
55
|
return bytes_
|
|
51
56
|
|
|
52
|
-
def _list_to_bytes(
|
|
57
|
+
def _list_to_bytes(
|
|
58
|
+
self,
|
|
59
|
+
message_data: tuple[bytearray, ...],
|
|
60
|
+
) -> bytes:
|
|
53
61
|
res = bytearray()
|
|
54
62
|
for field in message_data:
|
|
55
63
|
for element in field:
|
|
56
64
|
res.append(element)
|
|
65
|
+
|
|
57
66
|
return bytes(res)
|
|
58
67
|
|
|
59
68
|
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from types import MappingProxyType
|
|
2
|
+
from typing import Mapping, Type
|
|
3
|
+
|
|
4
|
+
from spei.resources import payments
|
|
5
|
+
from spei.resources.orden import Orden
|
|
6
|
+
from spei.types import CategoriaOrdenPago, TipoPagoOrdenPago
|
|
7
|
+
|
|
8
|
+
ORDEN_RESPONSES = MappingProxyType(
|
|
9
|
+
{
|
|
10
|
+
CategoriaOrdenPago.odps_liquidadas_abonos: CategoriaOrdenPago.odps_liquidadas_abonos_respuesta, # noqa: E501
|
|
11
|
+
CategoriaOrdenPago.odps_liquidadas_cargos: CategoriaOrdenPago.odps_liquidadas_cargos_respuesta, # noqa: E501
|
|
12
|
+
CategoriaOrdenPago.odps_canceladas_local: CategoriaOrdenPago.odps_canceladas_local_respuesta, # noqa: E501
|
|
13
|
+
CategoriaOrdenPago.odps_canceladas_x_banxico: CategoriaOrdenPago.odps_canceladas_x_banxico_respuesta, # noqa: E501
|
|
14
|
+
},
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
ORDEN_PAYMENT_TYPES: Mapping[TipoPagoOrdenPago, Type[Orden]] = MappingProxyType(
|
|
18
|
+
{
|
|
19
|
+
TipoPagoOrdenPago.devolucion_no_acreditada: payments.DevolucionNoAcreditada,
|
|
20
|
+
TipoPagoOrdenPago.tercero_a_tercero: payments.TerceroATercero,
|
|
21
|
+
TipoPagoOrdenPago.tercero_a_ventanilla: payments.TerceroAVentilla,
|
|
22
|
+
TipoPagoOrdenPago.tercero_a_tercero_vostro: payments.TerceroATerceroVostro,
|
|
23
|
+
TipoPagoOrdenPago.tercero_a_participante: payments.TerceroAParticipante,
|
|
24
|
+
TipoPagoOrdenPago.participante_a_tercero: payments.ParticipanteATercero,
|
|
25
|
+
TipoPagoOrdenPago.participante_a_tercero_vostro: payments.ParticipanteATerceroVostro,
|
|
26
|
+
TipoPagoOrdenPago.participante_a_participante: payments.ParticipanteAParticipante,
|
|
27
|
+
TipoPagoOrdenPago.tercero_a_tercero_fsw: payments.TerceroATerceroFSW,
|
|
28
|
+
TipoPagoOrdenPago.tercero_a_tercero_vostro_fsw: payments.TerceroATerceroVostroFSW,
|
|
29
|
+
TipoPagoOrdenPago.participante_a_tercero_fsw: payments.ParticipanteATerceroFSW,
|
|
30
|
+
TipoPagoOrdenPago.participante_a_tercero_vostro_fsw: payments.TerceroATerceroFSW,
|
|
31
|
+
TipoPagoOrdenPago.nomina: payments.Nomina,
|
|
32
|
+
TipoPagoOrdenPago.pago_factura: payments.PagoFactura,
|
|
33
|
+
TipoPagoOrdenPago.devolucion_extemporanea_no_acreditada: payments.DevolucionExtemporaneaNoAcreditada,
|
|
34
|
+
TipoPagoOrdenPago.devolucion_acreditada: payments.DevolucionAcreditada,
|
|
35
|
+
TipoPagoOrdenPago.devolucion_extemporanea_acreditada: payments.DevolucionExtemporaneaAcreditada,
|
|
36
|
+
TipoPagoOrdenPago.cobros_presenciales_de_una_ocasion: payments.CobrosPresencialesUnaOcasion,
|
|
37
|
+
TipoPagoOrdenPago.cobros_no_presenciales_de_una_ocasion: payments.CobrosNoPresencialesUnaOcasion,
|
|
38
|
+
TipoPagoOrdenPago.cobros_no_presenciales_recurrentes: payments.CobrosNoPresencialesRecurrentes,
|
|
39
|
+
TipoPagoOrdenPago.cobros_no_presenciales_a_nombre_de_tercero: payments.CobrosNoPresencialesNoRecurrentesTercero,
|
|
40
|
+
TipoPagoOrdenPago.devolucion_especial_acreditada: payments.DevolucionEspecialAcreditada,
|
|
41
|
+
TipoPagoOrdenPago.devolucion_extemporanea_especial_acreditada: payments.DevolucionEspecialAcreditada,
|
|
42
|
+
},
|
|
43
|
+
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import List
|
|
1
|
+
from typing import List, Optional
|
|
2
2
|
|
|
3
3
|
from lxml import etree
|
|
4
4
|
|
|
@@ -61,8 +61,15 @@ class EnvelopeElement(object):
|
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
class AcuseRequest(object):
|
|
64
|
-
def __new__(
|
|
65
|
-
|
|
64
|
+
def __new__(
|
|
65
|
+
cls,
|
|
66
|
+
tipo_respuesta: TipoRespuestaAcuse,
|
|
67
|
+
acuses: Optional[List[Acuse]] = None,
|
|
68
|
+
as_string=True,
|
|
69
|
+
):
|
|
70
|
+
respuesta_element = RespuestaElement(
|
|
71
|
+
ReturnElement(MensajeElement(acuses or [], tipo_respuesta)),
|
|
72
|
+
)
|
|
66
73
|
envelope = EnvelopeElement(BodyElement(respuesta_element))
|
|
67
74
|
if not as_string:
|
|
68
75
|
return envelope
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Any, Union
|
|
1
|
+
from typing import Any, Optional, Union
|
|
2
2
|
|
|
3
3
|
from lxml import etree
|
|
4
4
|
from pydantic import BaseModel
|
|
@@ -9,7 +9,7 @@ from spei.utils import to_snake_case # noqa: WPS347
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class ResultadoBanxico(BaseModel):
|
|
12
|
-
codigo: CodigoErrorAcuseBanxico = None
|
|
12
|
+
codigo: Optional[CodigoErrorAcuseBanxico] = None
|
|
13
13
|
descripcion: str = 'ND'
|
|
14
14
|
|
|
15
15
|
class Config: # noqa: WPS306, WPS431
|
|
@@ -45,7 +45,9 @@ class MensajeRespuesta(BaseModel):
|
|
|
45
45
|
respuesta = etree.fromstring( # noqa: S320
|
|
46
46
|
bytes(xml_element.text, encoding='utf-8'),
|
|
47
47
|
)
|
|
48
|
-
respuesta_element = respuesta.xpath('//*[local-name()="mensajeRespuestaCDA"]')[
|
|
48
|
+
respuesta_element = respuesta.xpath('//*[local-name()="mensajeRespuestaCDA"]')[
|
|
49
|
+
0
|
|
50
|
+
] # noqa: E501
|
|
49
51
|
tipo_respuesta = respuesta_element.attrib['tipoRespuesta']
|
|
50
52
|
|
|
51
53
|
return cls(
|
|
@@ -59,7 +61,7 @@ class Acuse(BaseModel):
|
|
|
59
61
|
mensaje_id: Any = None
|
|
60
62
|
tipo_respuesta: TipoRespuestaAcuse
|
|
61
63
|
resultado_enlace_cep: ResultadoServidor
|
|
62
|
-
resultado_banxico: ResultadoBanxico = None
|
|
64
|
+
resultado_banxico: Optional[ResultadoBanxico] = None
|
|
63
65
|
|
|
64
66
|
class Config: # noqa: WPS306, WPS431
|
|
65
67
|
use_enum_values = True
|
|
@@ -67,11 +69,17 @@ class Acuse(BaseModel):
|
|
|
67
69
|
@classmethod
|
|
68
70
|
def parse_synchronous_xml(cls, mensaje_element):
|
|
69
71
|
tipo_respuesta = mensaje_element.attrib['tipoRespuesta']
|
|
70
|
-
acuse_element = mensaje_element.find(
|
|
72
|
+
acuse_element = mensaje_element.find(
|
|
73
|
+
'{http://www.praxis.com.mx/EnvioCda/}acuseCda',
|
|
74
|
+
) # noqa: E501
|
|
71
75
|
cda_data = cls._find_mensaje_attributes(acuse_element, tipo_respuesta)
|
|
72
|
-
resultado_element = acuse_element.find(
|
|
76
|
+
resultado_element = acuse_element.find(
|
|
77
|
+
'{http://www.praxis.com.mx/EnvioCda/}resultadoEnlaceCep',
|
|
78
|
+
) # noqa: E501
|
|
73
79
|
codigo = resultado_element.find('{http://www.praxis.com.mx/EnvioCda/}codigo')
|
|
74
|
-
descripcion = resultado_element.find(
|
|
80
|
+
descripcion = resultado_element.find(
|
|
81
|
+
'{http://www.praxis.com.mx/EnvioCda/}descripcion',
|
|
82
|
+
) # noqa: E501
|
|
75
83
|
enlace_cep_data = {
|
|
76
84
|
'codigo': codigo.text,
|
|
77
85
|
'descripcion': descripcion.text,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from lxml import etree
|
|
2
4
|
from pydantic import BaseModel
|
|
3
5
|
|
|
@@ -30,21 +32,21 @@ class CDA(BaseModel):
|
|
|
30
32
|
|
|
31
33
|
op_nombre_receptor: str
|
|
32
34
|
|
|
33
|
-
op_concepto_pag: str = None
|
|
34
|
-
op_concepto_pag_2: str = None
|
|
35
|
+
op_concepto_pag: Optional[str] = None
|
|
36
|
+
op_concepto_pag_2: Optional[str] = None
|
|
35
37
|
|
|
36
|
-
op_nom_ord: str = None
|
|
37
|
-
op_tp_cta_ord: types.TipoCuentaOrdenPago = None
|
|
38
|
-
op_cuenta_ord: str = None
|
|
39
|
-
op_rfc_curp_ord: str = None
|
|
38
|
+
op_nom_ord: Optional[str] = None
|
|
39
|
+
op_tp_cta_ord: Optional[types.TipoCuentaOrdenPago] = None
|
|
40
|
+
op_cuenta_ord: Optional[str] = None
|
|
41
|
+
op_rfc_curp_ord: Optional[str] = None
|
|
40
42
|
|
|
41
|
-
op_nom_ben: str = None
|
|
42
|
-
op_tp_cta_ben: types.TipoCuentaOrdenPago = None
|
|
43
|
-
op_cuenta_ben: str = None
|
|
44
|
-
op_rfc_curp_ben: str = None
|
|
43
|
+
op_nom_ben: Optional[str] = None
|
|
44
|
+
op_tp_cta_ben: Optional[types.TipoCuentaOrdenPago] = None
|
|
45
|
+
op_cuenta_ben: Optional[str] = None
|
|
46
|
+
op_rfc_curp_ben: Optional[str] = None
|
|
45
47
|
|
|
46
|
-
op_iva: str = None
|
|
47
|
-
op_hora_00: str = None
|
|
48
|
+
op_iva: Optional[str] = None
|
|
49
|
+
op_hora_00: Optional[str] = None
|
|
48
50
|
|
|
49
51
|
class Config: # noqa: WPS306, WPS431
|
|
50
52
|
use_enum_values = True
|
|
@@ -62,7 +64,10 @@ class CDA(BaseModel):
|
|
|
62
64
|
for element, value in elements.items(): # noqa: WPS110
|
|
63
65
|
if element in self.__fields__:
|
|
64
66
|
upper_camel_case_element = to_upper_camel_case(element)
|
|
65
|
-
subelement = etree.SubElement(
|
|
67
|
+
subelement = etree.SubElement(
|
|
68
|
+
mensaje,
|
|
69
|
+
etree.QName(ENVIO_PRAXIS_NS, upper_camel_case_element),
|
|
70
|
+
) # noqa: E501
|
|
66
71
|
subelement.text = str(value)
|
|
67
72
|
|
|
68
73
|
return mensaje
|
|
@@ -16,15 +16,15 @@ class Mensaje(BaseModel):
|
|
|
16
16
|
extra = Extra.allow
|
|
17
17
|
|
|
18
18
|
@classmethod
|
|
19
|
-
def parse_xml(cls, mensaje: bytes):
|
|
19
|
+
def parse_xml(cls, mensaje: bytes): # noqa: WPS210
|
|
20
20
|
encoding = 'cp850'
|
|
21
21
|
if b'ENSESION' in mensaje:
|
|
22
22
|
encoding = 'utf-8'
|
|
23
23
|
mensaje = (
|
|
24
24
|
mensaje.decode('latin1').replace('&', '&amp;').encode(encoding)
|
|
25
25
|
)
|
|
26
|
-
|
|
27
|
-
body =
|
|
26
|
+
mensaje_parsed: etree.Element = etree.fromstring(mensaje) # noqa: S320
|
|
27
|
+
body = mensaje_parsed.find(
|
|
28
28
|
'{http://schemas.xmlsoap.org/soap/envelope/}Body',
|
|
29
29
|
)
|
|
30
30
|
ordenpago = body.find('{http://www.praxis.com.mx/}ordenpago')
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import re
|
|
2
|
+
from typing import Optional
|
|
2
3
|
|
|
3
4
|
from lxml import etree
|
|
4
5
|
from pydantic import BaseModel, validator
|
|
@@ -30,78 +31,78 @@ class Orden(BaseModel):
|
|
|
30
31
|
# checksum
|
|
31
32
|
op_firma_dig: str
|
|
32
33
|
# origin info
|
|
33
|
-
op_nom_ord: str = None
|
|
34
|
-
op_tc_clave_ord: types.TipoCuentaOrdenPago = None
|
|
35
|
-
op_cuenta_ord: str = None
|
|
36
|
-
op_rfc_curp_ord: str = None
|
|
37
|
-
op_ins_clave_ord: digits(3, 5) = None
|
|
34
|
+
op_nom_ord: Optional[str] = None
|
|
35
|
+
op_tc_clave_ord: Optional[types.TipoCuentaOrdenPago] = None
|
|
36
|
+
op_cuenta_ord: Optional[str] = None
|
|
37
|
+
op_rfc_curp_ord: Optional[str] = None
|
|
38
|
+
op_ins_clave_ord: Optional[digits(3, 5)] = None # type: ignore
|
|
38
39
|
# destination info
|
|
39
|
-
op_nom_ben: str = None
|
|
40
|
-
op_tc_clave_ben: types.TipoCuentaOrdenPago = None
|
|
41
|
-
op_cuenta_ben: str = None
|
|
42
|
-
op_rfc_curp_ben: str = None
|
|
43
|
-
op_ins_clave_ben: digits(3, 5) = None
|
|
40
|
+
op_nom_ben: Optional[str] = None
|
|
41
|
+
op_tc_clave_ben: Optional[types.TipoCuentaOrdenPago] = None
|
|
42
|
+
op_cuenta_ben: Optional[str] = None
|
|
43
|
+
op_rfc_curp_ben: Optional[str] = None
|
|
44
|
+
op_ins_clave_ben: Optional[digits(3, 5)] = None # type: ignore
|
|
44
45
|
# participant info
|
|
45
|
-
op_cuenta_participante_ord: str = None
|
|
46
|
-
op_nom_participante_ord: str = None
|
|
47
|
-
op_rfc_participante_ord: str = None
|
|
46
|
+
op_cuenta_participante_ord: Optional[str] = None
|
|
47
|
+
op_nom_participante_ord: Optional[str] = None
|
|
48
|
+
op_rfc_participante_ord: Optional[str] = None
|
|
48
49
|
# additional destination info
|
|
49
|
-
op_nom_ben_2: str = None
|
|
50
|
-
op_tc_clave_ben_2: types.TipoCuentaOrdenPago = None
|
|
51
|
-
op_cuenta_ben_2: str = None
|
|
52
|
-
op_rfc_curp_ben_2: str = None
|
|
50
|
+
op_nom_ben_2: Optional[str] = None
|
|
51
|
+
op_tc_clave_ben_2: Optional[types.TipoCuentaOrdenPago] = None
|
|
52
|
+
op_cuenta_ben_2: Optional[str] = None
|
|
53
|
+
op_rfc_curp_ben_2: Optional[str] = None
|
|
53
54
|
# concept info
|
|
54
|
-
op_concepto_pago: str = None
|
|
55
|
-
op_concepto_pag_2: str = None
|
|
55
|
+
op_concepto_pago: Optional[str] = None
|
|
56
|
+
op_concepto_pag_2: Optional[str] = None
|
|
56
57
|
# additional general info
|
|
57
|
-
op_iva: float = None
|
|
58
|
-
op_ref_numerica: str = None
|
|
59
|
-
op_ref_cobranza: str = None
|
|
60
|
-
op_clave_pago: str = None
|
|
58
|
+
op_iva: Optional[float] = None
|
|
59
|
+
op_ref_numerica: Optional[str] = None
|
|
60
|
+
op_ref_cobranza: Optional[str] = None
|
|
61
|
+
op_clave_pago: Optional[str] = None
|
|
61
62
|
# refunds info
|
|
62
|
-
op_to_clave: int = None
|
|
63
|
-
op_cd_clave: types.TipoDevolucionOrdenPago = None
|
|
63
|
+
op_to_clave: Optional[int] = None
|
|
64
|
+
op_cd_clave: Optional[types.TipoDevolucionOrdenPago] = None
|
|
64
65
|
# invoice info
|
|
65
|
-
op_info_factura: str = None
|
|
66
|
+
op_info_factura: Optional[str] = None
|
|
66
67
|
# original info
|
|
67
|
-
op_folio_ori: int = None
|
|
68
|
-
paq_folio_ori: int = None
|
|
69
|
-
op_fecha_oper_ori: int = None
|
|
70
|
-
op_rastreo_ori: str = None
|
|
71
|
-
op_monto_intereses: float = None
|
|
72
|
-
op_monto_ori: float = None
|
|
68
|
+
op_folio_ori: Optional[int] = None
|
|
69
|
+
paq_folio_ori: Optional[int] = None
|
|
70
|
+
op_fecha_oper_ori: Optional[int] = None
|
|
71
|
+
op_rastreo_ori: Optional[str] = None
|
|
72
|
+
op_monto_intereses: Optional[float] = None
|
|
73
|
+
op_monto_ori: Optional[float] = None
|
|
73
74
|
# beneficiary
|
|
74
|
-
op_indica_ben_rec: int = None
|
|
75
|
+
op_indica_ben_rec: Optional[int] = None
|
|
75
76
|
# codi origin info
|
|
76
|
-
op_num_cel_ord: int = None
|
|
77
|
-
op_digito_ver_ord: int = None
|
|
77
|
+
op_num_cel_ord: Optional[int] = None
|
|
78
|
+
op_digito_ver_ord: Optional[int] = None
|
|
78
79
|
# codi destination info
|
|
79
|
-
op_num_cel_ben: int = None
|
|
80
|
-
op_digito_ver_ben: int = None
|
|
80
|
+
op_num_cel_ben: Optional[int] = None
|
|
81
|
+
op_digito_ver_ben: Optional[int] = None
|
|
81
82
|
# codi info
|
|
82
|
-
op_folio_codi: str = None
|
|
83
|
-
op_comision_trans: int = None
|
|
84
|
-
op_monto_comision: float = None
|
|
83
|
+
op_folio_codi: Optional[str] = None
|
|
84
|
+
op_comision_trans: Optional[int] = None
|
|
85
|
+
op_monto_comision: Optional[float] = None
|
|
85
86
|
# codi merchant info
|
|
86
|
-
op_cert_comer_env: int = None
|
|
87
|
-
op_digito_ver_comer: int = None
|
|
87
|
+
op_cert_comer_env: Optional[int] = None
|
|
88
|
+
op_digito_ver_comer: Optional[int] = None
|
|
88
89
|
# karpay system info
|
|
89
|
-
op_fecha_cap: int = None
|
|
90
|
-
op_folio_servidor: int = None
|
|
91
|
-
op_usu_autoriza: str = None
|
|
92
|
-
op_err_clave: types.CodigoError = None
|
|
93
|
-
op_razon_rechazo: str = None
|
|
94
|
-
op_hora_cap: int = None
|
|
95
|
-
op_hora_liq_bm: int = None
|
|
96
|
-
op_hora_liq_sist: int = None
|
|
97
|
-
op_cde: str = None
|
|
98
|
-
op_cuenta_dev: str = None
|
|
99
|
-
op_hora_lectura_host: int = None #
|
|
100
|
-
op_hora_insercion: int = None
|
|
101
|
-
hr_deposito_acuse_banxico: int = None
|
|
102
|
-
paq_folio: int = None
|
|
103
|
-
ah_ar_clave: int = None
|
|
104
|
-
emp_clave: int = None
|
|
90
|
+
op_fecha_cap: Optional[int] = None
|
|
91
|
+
op_folio_servidor: Optional[int] = None
|
|
92
|
+
op_usu_autoriza: Optional[str] = None
|
|
93
|
+
op_err_clave: Optional[types.CodigoError] = None
|
|
94
|
+
op_razon_rechazo: Optional[str] = None
|
|
95
|
+
op_hora_cap: Optional[int] = None
|
|
96
|
+
op_hora_liq_bm: Optional[int] = None
|
|
97
|
+
op_hora_liq_sist: Optional[int] = None
|
|
98
|
+
op_cde: Optional[str] = None
|
|
99
|
+
op_cuenta_dev: Optional[str] = None
|
|
100
|
+
op_hora_lectura_host: Optional[int] = None # noq]a: N815
|
|
101
|
+
op_hora_insercion: Optional[int] = None
|
|
102
|
+
hr_deposito_acuse_banxico: Optional[int] = None
|
|
103
|
+
paq_folio: Optional[int] = None
|
|
104
|
+
ah_ar_clave: Optional[int] = None
|
|
105
|
+
emp_clave: Optional[int] = None
|
|
105
106
|
|
|
106
107
|
class Config: # noqa: WPS306, WPS431
|
|
107
108
|
use_enum_values = True
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from spei import types
|
|
2
4
|
from spei.resources.orden import Orden
|
|
3
5
|
|
|
@@ -11,12 +13,12 @@ class TerceroATercero(Orden):
|
|
|
11
13
|
op_nom_ben: str
|
|
12
14
|
op_tc_clave_ben: types.TipoCuentaOrdenPago
|
|
13
15
|
op_cuenta_ben: str
|
|
14
|
-
op_rfc_curp_ben: str = None
|
|
16
|
+
op_rfc_curp_ben: Optional[str] = None
|
|
15
17
|
|
|
16
18
|
op_concepto_pag_2: str
|
|
17
|
-
op_iva: float = None
|
|
19
|
+
op_iva: Optional[float] = None
|
|
18
20
|
op_ref_numerica: str
|
|
19
|
-
op_ref_cobranza: str = None
|
|
21
|
+
op_ref_cobranza: Optional[str] = None
|
|
20
22
|
|
|
21
23
|
|
|
22
24
|
class TerceroAVentilla(Orden):
|
|
@@ -28,7 +30,7 @@ class TerceroAVentilla(Orden):
|
|
|
28
30
|
op_nom_ben: str
|
|
29
31
|
|
|
30
32
|
op_concepto_pago: str
|
|
31
|
-
op_iva: float = None
|
|
33
|
+
op_iva: Optional[float] = None
|
|
32
34
|
op_clave_pago: str
|
|
33
35
|
|
|
34
36
|
|
|
@@ -42,14 +44,14 @@ class TerceroATerceroVostro(Orden):
|
|
|
42
44
|
op_tc_clave_ben: types.TipoCuentaOrdenPago
|
|
43
45
|
op_cuenta_ben: str
|
|
44
46
|
|
|
45
|
-
op_nom_ben_2: str = None
|
|
46
|
-
op_tc_clave_ben_2: types.TipoCuentaOrdenPago = None
|
|
47
|
-
op_cuenta_ben_2: str = None
|
|
48
|
-
op_rfc_curp_ben_2: str = None
|
|
47
|
+
op_nom_ben_2: Optional[str] = None
|
|
48
|
+
op_tc_clave_ben_2: Optional[types.TipoCuentaOrdenPago] = None
|
|
49
|
+
op_cuenta_ben_2: Optional[str] = None
|
|
50
|
+
op_rfc_curp_ben_2: Optional[str] = None
|
|
49
51
|
|
|
50
52
|
op_concepto_pago: str
|
|
51
|
-
op_concepto_pag_2: str = None
|
|
52
|
-
op_iva: float = None
|
|
53
|
+
op_concepto_pag_2: Optional[str] = None
|
|
54
|
+
op_iva: Optional[float] = None
|
|
53
55
|
op_ref_numerica: str
|
|
54
56
|
|
|
55
57
|
|
|
@@ -57,10 +59,10 @@ class TerceroAParticipante(Orden):
|
|
|
57
59
|
op_nom_ord: str
|
|
58
60
|
op_tc_clave_ord: types.TipoCuentaOrdenPago
|
|
59
61
|
op_cuenta_ord: str
|
|
60
|
-
op_rfc_curp_ord: str = None
|
|
62
|
+
op_rfc_curp_ord: Optional[str] = None
|
|
61
63
|
|
|
62
64
|
op_concepto_pago: str
|
|
63
|
-
op_iva: float = None
|
|
65
|
+
op_iva: Optional[float] = None
|
|
64
66
|
op_ref_numerica: str
|
|
65
67
|
|
|
66
68
|
op_to_clave: int
|
|
@@ -70,10 +72,10 @@ class ParticipanteATercero(Orden):
|
|
|
70
72
|
op_nom_ben: str
|
|
71
73
|
op_tc_clave_ben: types.TipoCuentaOrdenPago
|
|
72
74
|
op_cuenta_ben: str
|
|
73
|
-
op_rfc_curp_ben: str = None
|
|
75
|
+
op_rfc_curp_ben: Optional[str] = None
|
|
74
76
|
|
|
75
77
|
op_concepto_pag_2: str
|
|
76
|
-
op_iva: float = None
|
|
78
|
+
op_iva: Optional[float] = None
|
|
77
79
|
op_ref_numerica: str
|
|
78
80
|
|
|
79
81
|
|
|
@@ -82,20 +84,20 @@ class ParticipanteATerceroVostro(Orden):
|
|
|
82
84
|
op_tc_clave_ben: types.TipoCuentaOrdenPago
|
|
83
85
|
op_cuenta_ben: str
|
|
84
86
|
|
|
85
|
-
op_nom_ben_2: str = None
|
|
86
|
-
op_tc_clave_ben_2: types.TipoCuentaOrdenPago = None
|
|
87
|
-
op_cuenta_ben_2: str = None
|
|
88
|
-
op_rfc_curp_ben_2: str = None
|
|
87
|
+
op_nom_ben_2: Optional[str] = None
|
|
88
|
+
op_tc_clave_ben_2: Optional[types.TipoCuentaOrdenPago] = None
|
|
89
|
+
op_cuenta_ben_2: Optional[str] = None
|
|
90
|
+
op_rfc_curp_ben_2: Optional[str] = None
|
|
89
91
|
|
|
90
92
|
op_concepto_pago: str
|
|
91
|
-
op_concepto_pag_2: str = None
|
|
92
|
-
op_iva: float = None
|
|
93
|
+
op_concepto_pag_2: Optional[str] = None
|
|
94
|
+
op_iva: Optional[float] = None
|
|
93
95
|
op_ref_numerica: str
|
|
94
96
|
|
|
95
97
|
|
|
96
98
|
class ParticipanteAParticipante(Orden):
|
|
97
99
|
op_concepto_pago: str
|
|
98
|
-
op_iva: float = None
|
|
100
|
+
op_iva: Optional[float] = None
|
|
99
101
|
op_ref_numerica: str
|
|
100
102
|
|
|
101
103
|
op_to_clave: int
|
|
@@ -103,67 +105,67 @@ class ParticipanteAParticipante(Orden):
|
|
|
103
105
|
|
|
104
106
|
class TerceroATerceroFSW(Orden):
|
|
105
107
|
op_nom_ord: str
|
|
106
|
-
op_tc_clave_ord: types.TipoCuentaOrdenPago = None
|
|
107
|
-
op_cuenta_ord: str = None
|
|
108
|
-
op_rfc_curp_ord: str = None
|
|
108
|
+
op_tc_clave_ord: Optional[types.TipoCuentaOrdenPago] = None
|
|
109
|
+
op_cuenta_ord: Optional[str] = None
|
|
110
|
+
op_rfc_curp_ord: Optional[str] = None
|
|
109
111
|
|
|
110
112
|
op_nom_ben: str
|
|
111
|
-
op_tc_clave_ben: types.TipoCuentaOrdenPago = None
|
|
112
|
-
op_cuenta_ben: str = None
|
|
113
|
-
op_rfc_curp_ben: str = None
|
|
113
|
+
op_tc_clave_ben: Optional[types.TipoCuentaOrdenPago] = None
|
|
114
|
+
op_cuenta_ben: Optional[str] = None
|
|
115
|
+
op_rfc_curp_ben: Optional[str] = None
|
|
114
116
|
|
|
115
117
|
op_concepto_pag_2: str
|
|
116
|
-
op_iva: float = None
|
|
118
|
+
op_iva: Optional[float] = None
|
|
117
119
|
op_ref_numerica: str
|
|
118
|
-
op_ref_cobranza: str = None
|
|
120
|
+
op_ref_cobranza: Optional[str] = None
|
|
119
121
|
|
|
120
122
|
|
|
121
123
|
class TerceroATerceroVostroFSW(Orden):
|
|
122
124
|
op_nom_ord: str
|
|
123
|
-
op_tc_clave_ord: types.TipoCuentaOrdenPago = None
|
|
124
|
-
op_cuenta_ord: str = None
|
|
125
|
-
op_rfc_curp_ord: str = None
|
|
125
|
+
op_tc_clave_ord: Optional[types.TipoCuentaOrdenPago] = None
|
|
126
|
+
op_cuenta_ord: Optional[str] = None
|
|
127
|
+
op_rfc_curp_ord: Optional[str] = None
|
|
126
128
|
|
|
127
129
|
op_nom_ben: str
|
|
128
|
-
op_tc_clave_ben: types.TipoCuentaOrdenPago = None
|
|
129
|
-
op_cuenta_ben: str = None
|
|
130
|
+
op_tc_clave_ben: Optional[types.TipoCuentaOrdenPago] = None
|
|
131
|
+
op_cuenta_ben: Optional[str] = None
|
|
130
132
|
|
|
131
|
-
op_nom_ben_2: str = None
|
|
132
|
-
op_tc_clave_ben_2: types.TipoCuentaOrdenPago = None
|
|
133
|
-
op_cuenta_ben_2: str = None
|
|
134
|
-
op_rfc_curp_ben_2: str = None
|
|
133
|
+
op_nom_ben_2: Optional[str] = None
|
|
134
|
+
op_tc_clave_ben_2: Optional[types.TipoCuentaOrdenPago] = None
|
|
135
|
+
op_cuenta_ben_2: Optional[str] = None
|
|
136
|
+
op_rfc_curp_ben_2: Optional[str] = None
|
|
135
137
|
|
|
136
138
|
op_concepto_pago: str
|
|
137
|
-
op_concepto_pag_2: str = None
|
|
138
|
-
op_iva: float = None
|
|
139
|
+
op_concepto_pag_2: Optional[str] = None
|
|
140
|
+
op_iva: Optional[float] = None
|
|
139
141
|
op_ref_numerica: str
|
|
140
142
|
|
|
141
143
|
|
|
142
144
|
class ParticipanteATerceroFSW(Orden):
|
|
143
145
|
op_nom_ben: str
|
|
144
|
-
op_tc_clave_ben: types.TipoCuentaOrdenPago = None
|
|
145
|
-
op_cuenta_ben: str = None
|
|
146
|
-
op_rfc_curp_ben: str = None
|
|
146
|
+
op_tc_clave_ben: Optional[types.TipoCuentaOrdenPago] = None
|
|
147
|
+
op_cuenta_ben: Optional[str] = None
|
|
148
|
+
op_rfc_curp_ben: Optional[str] = None
|
|
147
149
|
|
|
148
150
|
op_concepto_pag_2: str
|
|
149
|
-
op_iva: float = None
|
|
151
|
+
op_iva: Optional[float] = None
|
|
150
152
|
op_ref_numerica: str
|
|
151
153
|
|
|
152
154
|
|
|
153
155
|
class ParticipanteATerceroVostroFSW(Orden):
|
|
154
156
|
op_nom_ben: str
|
|
155
|
-
op_tc_clave_ben: types.TipoCuentaOrdenPago = None
|
|
156
|
-
op_cuenta_ben: str = None
|
|
157
|
+
op_tc_clave_ben: Optional[types.TipoCuentaOrdenPago] = None
|
|
158
|
+
op_cuenta_ben: Optional[str] = None
|
|
157
159
|
|
|
158
|
-
op_nom_ben_2: str = None
|
|
159
|
-
op_tc_clave_ben_2: types.TipoCuentaOrdenPago = None
|
|
160
|
-
op_cuenta_ben_2: str = None
|
|
161
|
-
op_rfc_curp_ben_2: str = None
|
|
160
|
+
op_nom_ben_2: Optional[str] = None
|
|
161
|
+
op_tc_clave_ben_2: Optional[types.TipoCuentaOrdenPago] = None
|
|
162
|
+
op_cuenta_ben_2: Optional[str] = None
|
|
163
|
+
op_rfc_curp_ben_2: Optional[str] = None
|
|
162
164
|
|
|
163
|
-
op_concepto_pago: str = None
|
|
164
|
-
op_concepto_pag_2: str = None
|
|
165
|
-
op_iva: float = None
|
|
166
|
-
op_ref_numerica: str = None
|
|
165
|
+
op_concepto_pago: Optional[str] = None
|
|
166
|
+
op_concepto_pag_2: Optional[str] = None
|
|
167
|
+
op_iva: Optional[float] = None
|
|
168
|
+
op_ref_numerica: Optional[str] = None
|
|
167
169
|
|
|
168
170
|
|
|
169
171
|
class Nomina(Orden):
|
|
@@ -175,12 +177,12 @@ class Nomina(Orden):
|
|
|
175
177
|
op_nom_ben: str
|
|
176
178
|
op_tc_clave_ben: types.TipoCuentaOrdenPago
|
|
177
179
|
op_cuenta_ben: str
|
|
178
|
-
op_rfc_curp_ben: str = None
|
|
180
|
+
op_rfc_curp_ben: Optional[str] = None
|
|
179
181
|
|
|
180
182
|
op_concepto_pag_2: str
|
|
181
|
-
op_iva: float = None
|
|
183
|
+
op_iva: Optional[float] = None
|
|
182
184
|
op_ref_numerica: str
|
|
183
|
-
op_ref_cobranza: str = None
|
|
185
|
+
op_ref_cobranza: Optional[str] = None
|
|
184
186
|
|
|
185
187
|
|
|
186
188
|
class PagoFactura(Orden):
|
|
@@ -192,7 +194,7 @@ class PagoFactura(Orden):
|
|
|
192
194
|
op_nom_ben: str
|
|
193
195
|
op_tc_clave_ben: types.TipoCuentaOrdenPago
|
|
194
196
|
op_cuenta_ben: str
|
|
195
|
-
op_rfc_curp_ben: str = None
|
|
197
|
+
op_rfc_curp_ben: Optional[str] = None
|
|
196
198
|
|
|
197
199
|
op_concepto_pag_2: str
|
|
198
200
|
op_ref_numerica: str
|
|
@@ -209,7 +211,7 @@ class CobrosPresencialesUnaOcasion(Orden):
|
|
|
209
211
|
op_nom_ben: str
|
|
210
212
|
op_tc_clave_ben: types.TipoCuentaOrdenPago
|
|
211
213
|
op_cuenta_ben: str
|
|
212
|
-
op_rfc_curp_ben: str = None
|
|
214
|
+
op_rfc_curp_ben: Optional[str] = None
|
|
213
215
|
|
|
214
216
|
op_concepto_pag_2: str
|
|
215
217
|
op_ref_numerica: str
|
|
@@ -234,7 +236,7 @@ class CobrosNoPresencialesUnaOcasion(Orden):
|
|
|
234
236
|
op_nom_ben: str
|
|
235
237
|
op_tc_clave_ben: types.TipoCuentaOrdenPago
|
|
236
238
|
op_cuenta_ben: str
|
|
237
|
-
op_rfc_curp_ben: str = None
|
|
239
|
+
op_rfc_curp_ben: Optional[str] = None
|
|
238
240
|
|
|
239
241
|
op_concepto_pag_2: str
|
|
240
242
|
op_ref_numerica: str
|
|
@@ -259,7 +261,7 @@ class CobrosNoPresencialesRecurrentes(Orden):
|
|
|
259
261
|
op_nom_ben: str
|
|
260
262
|
op_tc_clave_ben: types.TipoCuentaOrdenPago
|
|
261
263
|
op_cuenta_ben: str
|
|
262
|
-
op_rfc_curp_ben: str = None
|
|
264
|
+
op_rfc_curp_ben: Optional[str] = None
|
|
263
265
|
|
|
264
266
|
op_concepto_pag_2: str
|
|
265
267
|
op_ref_numerica: str
|
|
@@ -284,12 +286,12 @@ class CobrosNoPresencialesNoRecurrentesTercero(Orden):
|
|
|
284
286
|
op_nom_ben: str
|
|
285
287
|
op_tc_clave_ben: types.TipoCuentaOrdenPago
|
|
286
288
|
op_cuenta_ben: str
|
|
287
|
-
op_rfc_curp_ben: str = None
|
|
289
|
+
op_rfc_curp_ben: Optional[str] = None
|
|
288
290
|
|
|
289
291
|
op_nom_ben_2: str
|
|
290
292
|
op_tc_clave_ben_2: types.TipoCuentaOrdenPago
|
|
291
293
|
op_cuenta_ben_2: str
|
|
292
|
-
op_rfc_curp_ben_2: str = None
|
|
294
|
+
op_rfc_curp_ben_2: Optional[str] = None
|
|
293
295
|
|
|
294
296
|
op_concepto_pag_2: str
|
|
295
297
|
op_ref_numerica: str
|
|
@@ -306,7 +308,7 @@ class CobrosNoPresencialesNoRecurrentesTercero(Orden):
|
|
|
306
308
|
|
|
307
309
|
|
|
308
310
|
class DevolucionNoAcreditada(Orden):
|
|
309
|
-
op_cd_clave
|
|
311
|
+
op_cd_clave: types.TipoDevolucionOrdenPago
|
|
310
312
|
|
|
311
313
|
|
|
312
314
|
class DevolucionExtemporaneaNoAcreditada(Orden):
|
|
@@ -318,8 +320,8 @@ class DevolucionExtemporaneaNoAcreditada(Orden):
|
|
|
318
320
|
|
|
319
321
|
op_cd_clave: types.TipoDevolucionOrdenPago
|
|
320
322
|
|
|
321
|
-
op_folio_ori: int = None
|
|
322
|
-
paq_folio_ori: int = None
|
|
323
|
+
op_folio_ori: Optional[int] = None
|
|
324
|
+
paq_folio_ori: Optional[int] = None
|
|
323
325
|
|
|
324
326
|
op_fecha_oper_ori: int
|
|
325
327
|
op_rastreo_ori: str
|
|
@@ -337,8 +339,8 @@ class DevolucionExtemporaneaAcreditada(Orden):
|
|
|
337
339
|
op_concepto_pag_2: str
|
|
338
340
|
op_ref_numerica: str
|
|
339
341
|
|
|
340
|
-
op_folio_ori: int = None
|
|
341
|
-
paq_folio_ori: int = None
|
|
342
|
+
op_folio_ori: Optional[int] = None
|
|
343
|
+
paq_folio_ori: Optional[int] = None
|
|
342
344
|
|
|
343
345
|
op_fecha_oper_ori: int
|
|
344
346
|
op_rastreo_ori: str
|
|
@@ -349,7 +351,7 @@ class DevolucionEspecialAcreditada(Orden):
|
|
|
349
351
|
op_rastreo_ori: str
|
|
350
352
|
op_monto_ori: float
|
|
351
353
|
|
|
352
|
-
op_indica_ben_rec: int = None
|
|
354
|
+
op_indica_ben_rec: Optional[int] = None
|
|
353
355
|
|
|
354
356
|
|
|
355
357
|
class DevolucionExtemporaneaEspecialAcreditada(Orden):
|
|
@@ -359,11 +361,11 @@ class DevolucionExtemporaneaEspecialAcreditada(Orden):
|
|
|
359
361
|
op_concepto_pag_2: str
|
|
360
362
|
op_ref_numerica: str
|
|
361
363
|
|
|
362
|
-
op_folio_ori: int = None
|
|
363
|
-
paq_folio_ori: int = None
|
|
364
|
+
op_folio_ori: Optional[int] = None
|
|
365
|
+
paq_folio_ori: Optional[int] = None
|
|
364
366
|
|
|
365
367
|
op_fecha_oper_ori: int
|
|
366
368
|
op_rastreo_ori: str
|
|
367
369
|
op_monto_ori: float
|
|
368
370
|
|
|
369
|
-
op_indica_ben_rec: int = None
|
|
371
|
+
op_indica_ben_rec: Optional[int] = None
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Optional, TypedDict
|
|
2
|
+
|
|
1
3
|
from lxml import etree
|
|
2
4
|
from pydantic import BaseModel
|
|
3
5
|
|
|
@@ -5,12 +7,20 @@ from spei import types
|
|
|
5
7
|
from spei.utils import to_snake_case, to_upper_camel_case # noqa: WPS347
|
|
6
8
|
|
|
7
9
|
|
|
10
|
+
class DataDict(TypedDict, total=False):
|
|
11
|
+
categoria: types.CategoriaOrdenPago
|
|
12
|
+
id: Optional[str]
|
|
13
|
+
fecha_oper: Optional[int]
|
|
14
|
+
err_codigo: Optional[types.CodigoError]
|
|
15
|
+
err_descripcion: Optional[str]
|
|
16
|
+
|
|
17
|
+
|
|
8
18
|
class Respuesta(BaseModel):
|
|
9
|
-
id: str
|
|
10
|
-
fecha_oper: int
|
|
11
19
|
err_codigo: types.CodigoError
|
|
12
|
-
err_descripcion: str
|
|
13
20
|
categoria: types.CategoriaOrdenPago
|
|
21
|
+
id: Optional[str]
|
|
22
|
+
fecha_oper: Optional[int]
|
|
23
|
+
err_descripcion: Optional[str]
|
|
14
24
|
|
|
15
25
|
class Config: # noqa: WPS306, WPS431
|
|
16
26
|
use_enum_values = True
|
|
@@ -28,12 +38,12 @@ class Respuesta(BaseModel):
|
|
|
28
38
|
|
|
29
39
|
@classmethod
|
|
30
40
|
def parse_xml(cls, respuesta_element, categoria: types.CategoriaOrdenPago):
|
|
31
|
-
respuesta_data = {
|
|
41
|
+
respuesta_data: DataDict = {
|
|
32
42
|
'categoria': categoria,
|
|
33
43
|
}
|
|
34
44
|
|
|
35
45
|
for sub_element in respuesta_element.getchildren():
|
|
36
46
|
tag = to_snake_case(sub_element.tag)
|
|
37
|
-
respuesta_data[tag] = sub_element.text
|
|
47
|
+
respuesta_data[tag] = sub_element.text # type: ignore
|
|
38
48
|
|
|
39
49
|
return cls(**respuesta_data)
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
from typing import Type
|
|
2
|
+
|
|
1
3
|
from lxml import etree
|
|
2
4
|
|
|
3
5
|
from spei.resources import Orden
|
|
4
6
|
|
|
5
7
|
|
|
6
8
|
class OrdenPagoElement(object):
|
|
7
|
-
def __new__(cls, mensaje_element, orden_cls: Orden = Orden):
|
|
9
|
+
def __new__(cls, mensaje_element, orden_cls: Type[Orden] = Orden):
|
|
8
10
|
ordenpago = mensaje_element.find('ordenpago')
|
|
9
11
|
categoria = mensaje_element.attrib['categoria']
|
|
10
12
|
return orden_cls.parse_xml(ordenpago, categoria)
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
from typing import Type
|
|
2
|
+
|
|
1
3
|
from lxml import etree
|
|
2
4
|
|
|
3
5
|
from spei.resources import Respuesta
|
|
4
6
|
|
|
5
7
|
|
|
6
8
|
class RespuestaElement(object):
|
|
7
|
-
def __new__(cls, mensaje_element, respuesta_cls: Respuesta = Respuesta):
|
|
9
|
+
def __new__(cls, mensaje_element, respuesta_cls: Type[Respuesta] = Respuesta):
|
|
8
10
|
respuesta = mensaje_element.find('respuesta')
|
|
9
11
|
categoria = mensaje_element.attrib['categoria']
|
|
10
12
|
return respuesta_cls.parse_xml(respuesta, categoria)
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
from types import MappingProxyType
|
|
2
|
-
|
|
3
|
-
from spei.resources import payments
|
|
4
|
-
from spei.types import CategoriaOrdenPago, TipoPagoOrdenPago
|
|
5
|
-
|
|
6
|
-
ORDEN_RESPONSES = MappingProxyType({
|
|
7
|
-
CategoriaOrdenPago.odps_liquidadas_abonos: CategoriaOrdenPago.odps_liquidadas_abonos_respuesta, # noqa: E501
|
|
8
|
-
CategoriaOrdenPago.odps_liquidadas_cargos: CategoriaOrdenPago.odps_liquidadas_cargos_respuesta, # noqa: E501
|
|
9
|
-
CategoriaOrdenPago.odps_canceladas_local: CategoriaOrdenPago.odps_canceladas_local_respuesta, # noqa: E501
|
|
10
|
-
CategoriaOrdenPago.odps_canceladas_x_banxico: CategoriaOrdenPago.odps_canceladas_x_banxico_respuesta, # noqa: E501
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
ORDEN_PAYMENT_TYPES = MappingProxyType({
|
|
14
|
-
TipoPagoOrdenPago.devolucion_no_acreditada: payments.DevolucionNoAcreditada,
|
|
15
|
-
TipoPagoOrdenPago.tercero_a_tercero: payments.TerceroATercero,
|
|
16
|
-
TipoPagoOrdenPago.tercero_a_ventanilla: payments.TerceroAVentilla,
|
|
17
|
-
TipoPagoOrdenPago.tercero_a_tercero_vostro: payments.TerceroATerceroVostro,
|
|
18
|
-
TipoPagoOrdenPago.tercero_a_participante: payments.TerceroAParticipante,
|
|
19
|
-
TipoPagoOrdenPago.participante_a_tercero: payments.ParticipanteATercero,
|
|
20
|
-
TipoPagoOrdenPago.participante_a_tercero_vostro: payments.ParticipanteATerceroVostro,
|
|
21
|
-
TipoPagoOrdenPago.participante_a_participante: payments.ParticipanteAParticipante,
|
|
22
|
-
TipoPagoOrdenPago.tercero_a_tercero_fsw: payments.TerceroATerceroFSW,
|
|
23
|
-
TipoPagoOrdenPago.tercero_a_tercero_vostro_fsw: payments.TerceroATerceroVostroFSW,
|
|
24
|
-
TipoPagoOrdenPago.participante_a_tercero_fsw: payments.ParticipanteATerceroFSW,
|
|
25
|
-
TipoPagoOrdenPago.participante_a_tercero_vostro_fsw: payments.TerceroATerceroFSW,
|
|
26
|
-
TipoPagoOrdenPago.nomina: payments.Nomina,
|
|
27
|
-
TipoPagoOrdenPago.pago_factura: payments.PagoFactura,
|
|
28
|
-
TipoPagoOrdenPago.devolucion_extemporanea_no_acreditada: payments.DevolucionExtemporaneaNoAcreditada,
|
|
29
|
-
TipoPagoOrdenPago.devolucion_acreditada: payments.DevolucionAcreditada,
|
|
30
|
-
TipoPagoOrdenPago.devolucion_extemporanea_acreditada: payments.DevolucionExtemporaneaAcreditada,
|
|
31
|
-
TipoPagoOrdenPago.cobros_presenciales_de_una_ocasion: payments.CobrosPresencialesUnaOcasion,
|
|
32
|
-
TipoPagoOrdenPago.cobros_no_presenciales_de_una_ocasion: payments.CobrosNoPresencialesUnaOcasion,
|
|
33
|
-
TipoPagoOrdenPago.cobros_no_presenciales_recurrentes: payments.CobrosNoPresencialesRecurrentes,
|
|
34
|
-
TipoPagoOrdenPago.cobros_no_presenciales_a_nombre_de_tercero: payments.CobrosNoPresencialesNoRecurrentesTercero,
|
|
35
|
-
TipoPagoOrdenPago.devolucion_especial_acreditada: payments.DevolucionEspecialAcreditada,
|
|
36
|
-
TipoPagoOrdenPago.devolucion_extemporanea_especial_acreditada: payments.DevolucionEspecialAcreditada,
|
|
37
|
-
})
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|