spei-python 0.14.0__py3-none-any.whl → 0.15.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 CHANGED
@@ -1,7 +1,6 @@
1
1
  from types import MappingProxyType
2
2
 
3
- from spei.resources import orden
4
- from spei.types import CategoriaOrdenPago, TipoPagoOrdenPago
3
+ from spei.types import CategoriaOrdenPago, TipoPagoOrdenPago, orden
5
4
 
6
5
  ORDER_RESPONSES = MappingProxyType({
7
6
  CategoriaOrdenPago.cargar_odp: CategoriaOrdenPago.cargar_odp_respuesta, # noqa: E501
spei/resources/orden.py CHANGED
@@ -12,6 +12,7 @@ PRAXIS_NS = 'http://www.praxis.com.mx/'
12
12
 
13
13
 
14
14
  class Orden(BaseModel):
15
+ id: int
15
16
  categoria: types.CategoriaOrdenPago
16
17
 
17
18
  op_ord_clave: types.ClaveOrdenanteOrdenPago = types.ClaveOrdenanteOrdenPago.AMU
@@ -122,14 +123,15 @@ class Orden(BaseModel):
122
123
  return mensaje
123
124
 
124
125
  @classmethod
125
- def parse_xml(cls, orden_xml, category):
126
- orden = orden_xml.find('ordenpago')
126
+ def parse_xml(cls, mensaje_xml):
127
+ orden_xml = mensaje_xml.find('ordenpago')
127
128
 
128
129
  orden_data = {
129
- 'categoria': category,
130
+ 'id': orden_xml.attrib['Id'],
131
+ 'categoria': mensaje_xml.attrib['categoria'],
130
132
  }
131
133
 
132
- for element in orden.getchildren():
134
+ for element in orden_xml.getchildren():
133
135
  tag = to_snake_case(element.tag)
134
136
  if tag in cls.__fields__:
135
137
  orden_data[tag] = element.text
@@ -6,12 +6,11 @@ from spei.utils import to_snake_case, to_upper_camel_case # noqa: WPS347
6
6
 
7
7
 
8
8
  class Respuesta(BaseModel):
9
- categoria: types.CategoriaOrdenPago
10
-
11
9
  id: str
12
10
  fecha_oper: int
13
11
  err_codigo: types.CodigoError
14
12
  err_descripcion: str
13
+ categoria: types.CategoriaOrdenPago
15
14
 
16
15
  class Config: # noqa: WPS306, WPS431
17
16
  use_enum_values = True
@@ -30,11 +29,11 @@ class Respuesta(BaseModel):
30
29
  return mensaje
31
30
 
32
31
  @classmethod
33
- def parse_xml(cls, respuesta_xml, category):
34
- respuesta = respuesta_xml.find('respuesta')
32
+ def parse_xml(cls, mensaje_xml):
33
+ respuesta = mensaje_xml.find('respuesta')
35
34
 
36
35
  respuesta_data = {
37
- 'categoria': category,
36
+ 'categoria': mensaje_xml.attrib['categoria'],
38
37
  }
39
38
 
40
39
  for sub_element in respuesta.getchildren():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: spei-python
3
- Version: 0.14.0
3
+ Version: 0.15.0
4
4
  Summary:
5
5
  Author: gonz
6
6
  Author-email: gonzasestopal@gmail.com
@@ -2,19 +2,19 @@ spei/README.md,sha256=VWu0kLDrzj9EPLbJK9Rzde4uYMedzaqNwRoccowphmY,5569
2
2
  spei/__init__.py,sha256=UmjWrUFyb4o1Qmg7LZHdzPe05J1rwApDVYcrOelBEYo,49
3
3
  spei/client.py,sha256=W6euigkL_4ED1nlzC5Y9_LVhkWq7b2R5ACuiwR7Gpps,1956
4
4
  spei/errors.py,sha256=ne3Qg5ciRo_4TkiR4xJOSK7WQ-teeG6I9-dxqykUH-0,16065
5
- spei/mappings.py,sha256=CT6SQ9eKSFwWJvQ-cyxxTSKTutGcZzASBxVARoL0KO4,2661
5
+ spei/mappings.py,sha256=XtKtV-dOZKNlYiPNf1vUAE6l9e6wG62FJ4WlXFTWUoA,2635
6
6
  spei/requests/__init__.py,sha256=2EkzdNBsZJo3T5UFlHWUBeS9t8QGiV7Fj1usX-qR-pQ,126
7
7
  spei/requests/orden.py,sha256=OCKTRhOToLCNfXlEnevMCJAIA6mRYXDSUBOvRFfjuSA,1168
8
8
  spei/requests/respuesta.py,sha256=vCWinkOkZ81hG3ZGrGtvrlPqfv0_-zT0Yabe4XGmuIk,1068
9
9
  spei/resources/__init__.py,sha256=x5UoEH7eJtr8DcpCv4aTKzQmKBFkeh9bqJh3ntWJrqU,114
10
10
  spei/resources/mensaje.py,sha256=8PBu_qEow6AwHoamDO05y5zzuVmdybnIHAy8GkVvsBc,1375
11
- spei/resources/orden.py,sha256=r5htYTTpIpSOwUu5UFfSLjo4hnGpngvjoItA3nEqf0M,4195
12
- spei/resources/respuesta.py,sha256=ok4u55y30fv6z3fisFiU2_FCb8haCuvWIVhd2qc2SuQ,1396
11
+ spei/resources/orden.py,sha256=NiuF4D1o7UfiefRjo8vwZm3eLJwob0GJtBiz2lRsK6A,4274
12
+ spei/resources/respuesta.py,sha256=lY7FbplYag2dbH2ZC_igLro2Yz8PYmtQoCVlW4YOHgE,1404
13
13
  spei/types/__init__.py,sha256=MPeH3U1lzQSDDwGymvh2gdBD4FHCy3HUI9sQb-R8xQs,2992
14
14
  spei/types/error.py,sha256=ne3Qg5ciRo_4TkiR4xJOSK7WQ-teeG6I9-dxqykUH-0,16065
15
15
  spei/types/orden.py,sha256=Pb_r2rN8pmZcJAFkQtJulyupKHSyJoZOPizXw9vXqMo,8330
16
16
  spei/utils.py,sha256=bkicw5-QpygAKqTu3RCtHQ0Aal8HcUVyc8x7dvxg2JY,2272
17
17
  spei/validators.py,sha256=1b-brOmNesdiUi2X0LV0-Km4Sh6RGNeKNeAxshQXtOs,742
18
- spei_python-0.14.0.dist-info/METADATA,sha256=ZIX1GjvEfHTBaSIEi6iCdhsk5QaeE5BSP7LEKqknT0w,3020
19
- spei_python-0.14.0.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
20
- spei_python-0.14.0.dist-info/RECORD,,
18
+ spei_python-0.15.0.dist-info/METADATA,sha256=Tp1Q7Oi2Yb7bItJbCmCGkwg6vW-4Ug33CM97FagydnI,3020
19
+ spei_python-0.15.0.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
20
+ spei_python-0.15.0.dist-info/RECORD,,