spei-python 0.18.0__py3-none-any.whl → 0.18.2__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/requests/orden.py CHANGED
@@ -15,9 +15,9 @@ class OrdenPagoElement(object):
15
15
 
16
16
 
17
17
  class BodyElement(object):
18
- def __new__(cls, orden_pago):
18
+ def __new__(cls, ordenpago):
19
19
  body = etree.Element(etree.QName(SOAP_NS, 'Body'))
20
- body.append(orden_pago)
20
+ body.append(ordenpago)
21
21
  return body
22
22
 
23
23
 
spei/resources/mensaje.py CHANGED
@@ -8,7 +8,9 @@ from spei.types import CategoriaOrdenPago
8
8
 
9
9
  class Mensaje(BaseModel):
10
10
  categoria: Optional[CategoriaOrdenPago] = None
11
- element: Optional[Any] = None
11
+ ordenpago: Optional[Any] = None
12
+ respuesta: Optional[Any] = None
13
+ ensesion: Optional[Any] = None
12
14
 
13
15
  class Config: # noqa: WPS306, WPS431
14
16
  extra = Extra.allow
@@ -24,17 +26,19 @@ class Mensaje(BaseModel):
24
26
  ensesion = body.find('{http://www.praxis.com.mx/}ensesion')
25
27
 
26
28
  if ordenpago is not None:
27
- element = etree.fromstring(ordenpago.text) # noqa: S320
29
+ element = etree.fromstring( # noqa: S320
30
+ bytes(ordenpago.text, encoding='cp850'),
31
+ )
28
32
  categoria = element.attrib['categoria']
29
- return cls(categoria=categoria, element=element)
33
+ return cls(categoria=categoria, ordenpago=element)
30
34
 
31
35
  if respuesta is not None:
32
36
  element = etree.fromstring( # noqa: S320
33
37
  bytes(respuesta.text, encoding='cp850'),
34
38
  )
35
39
  categoria = element.attrib['categoria']
36
- return cls(categoria=categoria, element=element)
40
+ return cls(categoria=categoria, respuesta=element)
37
41
 
38
42
  return cls(
39
- element=ensesion,
43
+ ensesion=ensesion,
40
44
  )
spei/resources/orden.py CHANGED
@@ -111,7 +111,7 @@ class Orden(BaseModel):
111
111
 
112
112
  def build_xml(self):
113
113
  mensaje = etree.Element('mensaje', categoria=self.categoria)
114
- orden_pago = etree.SubElement(mensaje, 'ordenpago', Id=str(self.id))
114
+ ordenpago = etree.SubElement(mensaje, 'ordenpago', Id=str(self.id))
115
115
 
116
116
  elements = self.dict(
117
117
  exclude_none=True,
@@ -121,11 +121,11 @@ class Orden(BaseModel):
121
121
  for element, value in elements.items(): # noqa: WPS110
122
122
  if element in self.__fields__:
123
123
  if element == 'op_firma_dig':
124
- subelement = etree.SubElement(orden_pago, 'opFirmaDig')
124
+ subelement = etree.SubElement(ordenpago, 'opFirmaDig')
125
125
  subelement.text = str(value)
126
126
  continue
127
127
  upper_camel_case_element = to_upper_camel_case(element)
128
- subelement = etree.SubElement(orden_pago, upper_camel_case_element)
128
+ subelement = etree.SubElement(ordenpago, upper_camel_case_element)
129
129
  subelement.text = str(value)
130
130
 
131
131
  return mensaje
spei/utils.py CHANGED
@@ -13,17 +13,17 @@ def format_data(message: Dict[AnyStr, Any]) -> bytes:
13
13
  _monto_to_bytearray(message['op_monto']),
14
14
  ]
15
15
 
16
- if 'op_cuenta_ord' in message:
16
+ if message.get('op_cuenta_ord'):
17
17
  message_data.append(
18
18
  _to_byte_array(message['op_cuenta_ord'], add_zero_byte=True),
19
19
  )
20
20
 
21
- if 'op_cuenta_ben' in message:
21
+ if message.get('op_cuenta_ben'):
22
22
  message_data.append(
23
23
  _to_byte_array(message['op_cuenta_ben'], add_zero_byte=True),
24
24
  )
25
25
 
26
- if 'op_cuenta_ben_2' in message:
26
+ if message.get('op_cuenta_ben_2'):
27
27
  message_data.append(
28
28
  _to_byte_array(message['op_cuenta_ben_2'], add_zero_byte=True),
29
29
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: spei-python
3
- Version: 0.18.0
3
+ Version: 0.18.2
4
4
  Summary:
5
5
  Author: tech
6
6
  Author-email: tech@fondeadora.com
@@ -36,7 +36,7 @@ Use our client to send orders to SPEI.
36
36
  from spei.client import BaseClient
37
37
 
38
38
  client = BaseClient(
39
- host='karpay-beta.intfondeadora.app',
39
+ host='http://karpay-beta.intfondeadora.app',
40
40
  username='karpay',
41
41
  password='password',
42
42
  priv_key='private_key',
@@ -4,18 +4,18 @@ spei/client.py,sha256=xjoHRklmceQ1Ckx7ZlZsZXzZ0YSf_KKpjjxolm9pRAQ,2143
4
4
  spei/errors.py,sha256=ne3Qg5ciRo_4TkiR4xJOSK7WQ-teeG6I9-dxqykUH-0,16065
5
5
  spei/mappings.py,sha256=qfovi9J5S0G_LoWtFNoPZdDnrzLl4bGDKh5dZ62ulnA,2571
6
6
  spei/requests/__init__.py,sha256=2EkzdNBsZJo3T5UFlHWUBeS9t8QGiV7Fj1usX-qR-pQ,126
7
- spei/requests/orden.py,sha256=BJ0bR17kt3WHvVipzCTknGF5G4ZZLecw64d10fvL6Xs,1243
7
+ spei/requests/orden.py,sha256=8EpYx2FCr-rWVuJwmI9entNduFRrqcifzmHqzFKFZ1s,1241
8
8
  spei/requests/respuesta.py,sha256=aD2JxKlQHDVqMj5N0mcRzR6xx77-62lR0C97qNHd2Us,1176
9
9
  spei/resources/__init__.py,sha256=RixAVNm2K3H245HX7BFX_wu6P2UHRKqsYrdKUb-9j4w,131
10
- spei/resources/mensaje.py,sha256=CM1j9ngglPI9cI9bfqQCt1Crl-UxOxSutlTjJaSC0Xk,1292
11
- spei/resources/orden.py,sha256=FJXZ2kaaJa4uqnNUjw6heVQI0fbDXjiku6oDFtw9t1E,12630
10
+ spei/resources/mensaje.py,sha256=oTCqpP7GQFlnPSF8MJQJwqLjpPJxBn6yhf5W5sWO-8g,1426
11
+ spei/resources/orden.py,sha256=ErbGZt0VNdpJCuClc2qoYeDFv0f1z-pFQ_oHchNAlh8,12627
12
12
  spei/resources/respuesta.py,sha256=8oNb2yIFe5DwwZryx-djA_cIAYkPPHB5T3AicSIopGc,1449
13
13
  spei/responses/__init__.py,sha256=o8BnmqDo9QLZBuUCzZ_xkpM3cbShrcTJ_Wzr6_dbH7E,175
14
14
  spei/responses/orden.py,sha256=S3HSp_I-q1TNfcmZp3GWw_uMB7dc84l784mZuDE9riY,780
15
15
  spei/responses/respuesta.py,sha256=Z7au9tsJ5yMdeymLz9h-NffwzFL1QA1sGOx-Iaj6lto,814
16
16
  spei/types.py,sha256=DywBwAu0F3JUR2kGJRJSdoqbUFPuZkG89M2r1bcOk9s,3037
17
- spei/utils.py,sha256=IHobxIz2w5aMC_v7YS-WU6tciQuKgzMyy4poZUqpE_I,2583
17
+ spei/utils.py,sha256=_e6GT-ohRDsupcTAJg6kYV-_qbSzL0uXGVccNCT6ems,2589
18
18
  spei/validators.py,sha256=1b-brOmNesdiUi2X0LV0-Km4Sh6RGNeKNeAxshQXtOs,742
19
- spei_python-0.18.0.dist-info/METADATA,sha256=dLLYs0njrjqed6IKwbH8ErvVNvuf8lcbhGFOxWFnGyE,3016
20
- spei_python-0.18.0.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
21
- spei_python-0.18.0.dist-info/RECORD,,
19
+ spei_python-0.18.2.dist-info/METADATA,sha256=p1ypWIztb9V1m27WYAM6yoJSuXwSn5_UdxGnILgXN-o,3023
20
+ spei_python-0.18.2.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
21
+ spei_python-0.18.2.dist-info/RECORD,,