spei-python 0.18.0__tar.gz → 0.18.2__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.
@@ -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',
@@ -17,7 +17,7 @@ Use our client to send orders to SPEI.
17
17
  from spei.client import BaseClient
18
18
 
19
19
  client = BaseClient(
20
- host='karpay-beta.intfondeadora.app',
20
+ host='http://karpay-beta.intfondeadora.app',
21
21
  username='karpay',
22
22
  password='password',
23
23
  priv_key='private_key',
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "spei-python"
3
- version = "0.18.0"
3
+ version = "0.18.2"
4
4
  description = ""
5
5
  authors = ["tech <tech@fondeadora.com>"]
6
6
  readme = "README.md"
@@ -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.18.0"
35
+ version = "0.18.2"
36
36
  tag_format = "v$version"
37
37
  bump_message = "bump: Semantic Release Bot: Release Version: $new_version 🤖🚀 [skip ci]"
38
38
  version_files = [
@@ -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
 
@@ -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
  )
@@ -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
@@ -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
  )
File without changes