spei-python 0.48.7__tar.gz → 0.48.9__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.
Files changed (39) hide show
  1. {spei_python-0.48.7 → spei_python-0.48.9}/PKG-INFO +2 -1
  2. {spei_python-0.48.7 → spei_python-0.48.9}/pyproject.toml +2 -2
  3. {spei_python-0.48.7 → spei_python-0.48.9}/spei/resources/mensaje.py +12 -7
  4. {spei_python-0.48.7 → spei_python-0.48.9}/spei/resources/orden.py +1 -1
  5. {spei_python-0.48.7 → spei_python-0.48.9}/spei/responses/orden.py +4 -2
  6. {spei_python-0.48.7 → spei_python-0.48.9}/spei/types/spei.py +2 -2
  7. {spei_python-0.48.7 → spei_python-0.48.9}/README.md +0 -0
  8. {spei_python-0.48.7 → spei_python-0.48.9}/spei/README.md +0 -0
  9. {spei_python-0.48.7 → spei_python-0.48.9}/spei/__init__.py +0 -0
  10. {spei_python-0.48.7 → spei_python-0.48.9}/spei/cep_generator.py +0 -0
  11. {spei_python-0.48.7 → spei_python-0.48.9}/spei/checksum/__init__.py +0 -0
  12. {spei_python-0.48.7 → spei_python-0.48.9}/spei/checksum/factory.py +0 -0
  13. {spei_python-0.48.7 → spei_python-0.48.9}/spei/checksum/generator.py +0 -0
  14. {spei_python-0.48.7 → spei_python-0.48.9}/spei/checksum/types.py +0 -0
  15. {spei_python-0.48.7 → spei_python-0.48.9}/spei/client.py +0 -0
  16. {spei_python-0.48.7 → spei_python-0.48.9}/spei/errors/__init__.py +0 -0
  17. {spei_python-0.48.7 → spei_python-0.48.9}/spei/errors/sice.py +0 -0
  18. {spei_python-0.48.7 → spei_python-0.48.9}/spei/errors/spei.py +0 -0
  19. {spei_python-0.48.7 → spei_python-0.48.9}/spei/exceptions.py +0 -0
  20. {spei_python-0.48.7 → spei_python-0.48.9}/spei/mappings.py +0 -0
  21. {spei_python-0.48.7 → spei_python-0.48.9}/spei/requests/__init__.py +0 -0
  22. {spei_python-0.48.7 → spei_python-0.48.9}/spei/requests/acuse.py +0 -0
  23. {spei_python-0.48.7 → spei_python-0.48.9}/spei/requests/cda.py +0 -0
  24. {spei_python-0.48.7 → spei_python-0.48.9}/spei/requests/orden.py +0 -0
  25. {spei_python-0.48.7 → spei_python-0.48.9}/spei/requests/respuesta.py +0 -0
  26. {spei_python-0.48.7 → spei_python-0.48.9}/spei/resources/__init__.py +0 -0
  27. {spei_python-0.48.7 → spei_python-0.48.9}/spei/resources/acuse.py +0 -0
  28. {spei_python-0.48.7 → spei_python-0.48.9}/spei/resources/cda.py +0 -0
  29. {spei_python-0.48.7 → spei_python-0.48.9}/spei/resources/ensesion.py +0 -0
  30. {spei_python-0.48.7 → spei_python-0.48.9}/spei/resources/payments.py +0 -0
  31. {spei_python-0.48.7 → spei_python-0.48.9}/spei/resources/respuesta.py +0 -0
  32. {spei_python-0.48.7 → spei_python-0.48.9}/spei/responses/__init__.py +0 -0
  33. {spei_python-0.48.7 → spei_python-0.48.9}/spei/responses/acuse.py +0 -0
  34. {spei_python-0.48.7 → spei_python-0.48.9}/spei/responses/respuesta.py +0 -0
  35. {spei_python-0.48.7 → spei_python-0.48.9}/spei/sice.py +0 -0
  36. {spei_python-0.48.7 → spei_python-0.48.9}/spei/types/__init__.py +0 -0
  37. {spei_python-0.48.7 → spei_python-0.48.9}/spei/types/sice.py +0 -0
  38. {spei_python-0.48.7 → spei_python-0.48.9}/spei/utils.py +0 -0
  39. {spei_python-0.48.7 → spei_python-0.48.9}/spei/validators.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: spei-python
3
- Version: 0.48.7
3
+ Version: 0.48.9
4
4
  Summary:
5
5
  Author: tech
6
6
  Author-email: tech@fondeadora.com
@@ -9,6 +9,7 @@ Classifier: Programming Language :: Python :: 3
9
9
  Classifier: Programming Language :: Python :: 3.9
10
10
  Classifier: Programming Language :: Python :: 3.10
11
11
  Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
12
13
  Requires-Dist: cryptography (>=3.0,<42.1)
13
14
  Requires-Dist: lxml (>=4.7.1,<5.0.0)
14
15
  Requires-Dist: pydantic (>=1.8.2,<2.0.0)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "spei-python"
3
- version = "0.48.7"
3
+ version = "0.48.9"
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.48.7"
35
+ version = "0.48.9"
36
36
  tag_format = "v$version"
37
37
  bump_message = "bump: Semantic Release Bot: Release Version: $new_version 🤖🚀 [skip ci]"
38
38
  version_files = [
@@ -16,10 +16,14 @@ class Mensaje(BaseModel):
16
16
  extra = Extra.allow
17
17
 
18
18
  @classmethod
19
- def parse_xml(cls, mensaje): # noqa: WPS210
20
- decoded = mensaje.decode('latin1').replace('&amp;', '&amp;amp;')
21
- encoded = decoded.encode('utf-8')
22
- mensaje = etree.fromstring(encoded) # noqa: S320
19
+ def parse_xml(cls, mensaje: bytes):
20
+ encoding = 'cp850'
21
+ if b'ENSESION' in mensaje:
22
+ encoding = 'utf-8'
23
+ mensaje = (
24
+ mensaje.decode('latin1').replace('&amp;', '&amp;amp;').encode(encoding)
25
+ )
26
+ mensaje = etree.fromstring(mensaje) # noqa: S320
23
27
  body = mensaje.find(
24
28
  '{http://schemas.xmlsoap.org/soap/envelope/}Body',
25
29
  )
@@ -28,20 +32,21 @@ class Mensaje(BaseModel):
28
32
 
29
33
  if ordenpago is not None:
30
34
  element = etree.fromstring( # noqa: S320
31
- bytes(ordenpago.text.strip(), encoding='utf-8'),
35
+ bytes(ordenpago.text.strip(), encoding=encoding),
32
36
  )
33
37
  categoria = element.attrib['categoria']
34
38
 
35
39
  if categoria == CategoriaOrdenPago.ensesion:
36
40
  return cls(
37
- categoria=categoria, ensesion=element,
41
+ categoria=categoria,
42
+ ensesion=element,
38
43
  )
39
44
 
40
45
  return cls(categoria=categoria, ordenpago=element)
41
46
 
42
47
  if respuesta is not None:
43
48
  element = etree.fromstring( # noqa: S320
44
- bytes(respuesta.text.strip(), encoding='cp850'),
49
+ bytes(respuesta.text.strip(), encoding=encoding),
45
50
  )
46
51
  categoria = element.attrib['categoria']
47
52
  return cls(categoria=categoria, respuesta=element)
@@ -173,7 +173,7 @@ class Orden(BaseModel):
173
173
  for element in orden_element.getchildren():
174
174
  tag = to_snake_case(element.tag)
175
175
  if tag in cls.__fields__:
176
- orden_data[tag] = element.text
176
+ orden_data[tag] = element.text.strip()
177
177
  if tag == 'op_ins_clave':
178
178
  orden_data['op_ins_clave_ord'] = element.text
179
179
 
@@ -13,7 +13,7 @@ class OrdenPagoElement(object):
13
13
  class MensajeElement(object):
14
14
  def __new__(cls, ordenpago):
15
15
  return etree.fromstring( # noqa: S320
16
- bytes(ordenpago.text, encoding='cp850'),
16
+ bytes(ordenpago.text.strip(), encoding='cp850'),
17
17
  )
18
18
 
19
19
 
@@ -31,5 +31,7 @@ class BodyElement(object):
31
31
 
32
32
  class OrdenResponse(object):
33
33
  def __new__(cls, orden):
34
- mensaje = etree.fromstring(orden) # noqa: S320
34
+ mensaje = etree.fromstring( # noqa: S320
35
+ bytes(orden, encoding='cp850'),
36
+ )
35
37
  return OrdenPagoElement(MensajeElement(RootElement(BodyElement(mensaje))))
@@ -146,7 +146,7 @@ class TipoDevolucionOrdenPago(str, Enum):
146
146
  account_blocked = 2
147
147
  account_canceled = 3
148
148
  wrong_account_currency = 5
149
- account_number_is_not_fondea = 6
149
+ account_number_does_not_belong = 6
150
150
  beneficiary_e_firma_revoked = 11
151
151
  beneficiary_unrecognized_payment = 13
152
152
  missing_required_data = 14
@@ -155,7 +155,7 @@ class TipoDevolucionOrdenPago(str, Enum):
155
155
  invalid_account_type = 17
156
156
  requested_by_origin = 18
157
157
  invalid_character = 19
158
- autorized_limit_exceeded = 20
158
+ authorized_limit_exceeded = 20
159
159
  deposit_limit_exceeded = 21
160
160
  phone_not_registered = 22
161
161
  additional_account_can_not_receive_payments = 23
File without changes
File without changes
File without changes