spei-python 0.40.1__tar.gz → 0.42.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.40.1 → spei_python-0.42.0}/PKG-INFO +1 -1
- {spei_python-0.40.1 → spei_python-0.42.0}/pyproject.toml +2 -2
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/client.py +14 -2
- spei_python-0.42.0/spei/exceptions.py +15 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/types/spei.py +1 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/README.md +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/README.md +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/__init__.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/cep_generator.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/checksum/__init__.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/checksum/factory.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/checksum/generator.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/checksum/types.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/errors/__init__.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/errors/sice.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/errors/spei.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/mappings.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/requests/__init__.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/requests/acuse.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/requests/cda.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/requests/orden.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/requests/respuesta.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/resources/__init__.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/resources/acuse.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/resources/cda.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/resources/mensaje.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/resources/orden.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/resources/payments.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/resources/respuesta.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/responses/__init__.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/responses/acuse.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/responses/orden.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/responses/respuesta.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/sice.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/types/__init__.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/types/sice.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.0}/spei/utils.py +0 -0
- {spei_python-0.40.1 → spei_python-0.42.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.42.0"
|
|
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.
|
|
35
|
+
version = "0.42.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 = [
|
|
@@ -7,9 +7,11 @@ from cryptography.hazmat.primitives import serialization
|
|
|
7
7
|
from cryptography.hazmat.primitives.asymmetric import padding
|
|
8
8
|
from cryptography.hazmat.primitives.hashes import SHA256
|
|
9
9
|
|
|
10
|
+
from spei import exceptions
|
|
10
11
|
from spei.checksum.factory import get_checksum_generator
|
|
12
|
+
from spei.errors import spei as errors
|
|
11
13
|
from spei.requests import OrdenRequest
|
|
12
|
-
from spei.resources import Orden
|
|
14
|
+
from spei.resources import Orden, Respuesta
|
|
13
15
|
from spei.responses import RespuestaResponse
|
|
14
16
|
|
|
15
17
|
logger = logging.getLogger('spei')
|
|
@@ -73,4 +75,14 @@ class BaseClient(object):
|
|
|
73
75
|
response = self.session.post(data=soap_request, url=self.host)
|
|
74
76
|
logger.info(response.text)
|
|
75
77
|
response.raise_for_status()
|
|
76
|
-
|
|
78
|
+
respuesta = respuesta_response_cls(response.text)
|
|
79
|
+
if respuesta.err_codigo != errors.GenericoCodigoError.exitoso:
|
|
80
|
+
self._raise_error(respuesta)
|
|
81
|
+
return respuesta
|
|
82
|
+
|
|
83
|
+
def _raise_error(self, respuesta: Respuesta):
|
|
84
|
+
if respuesta.err_codigo == errors.GenericoCodigoError.tipo_pago_invalido:
|
|
85
|
+
raise exceptions.TipoPagoInvalidoError(respuesta)
|
|
86
|
+
if respuesta.err_codigo == errors.OtrosCodigoError.otros_fecha_operacion_incorrecta: # noqa: E501
|
|
87
|
+
raise exceptions.FechaOperacionIncorrectaError(respuesta)
|
|
88
|
+
raise exceptions.SPEIError(respuesta)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from spei.resources import Respuesta
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class SPEIError(Exception):
|
|
5
|
+
def __init__(self, respuesta: Respuesta):
|
|
6
|
+
self.error_code = respuesta.err_codigo
|
|
7
|
+
self.error_description = respuesta.err_descripcion
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class TipoPagoInvalidoError(SPEIError):
|
|
11
|
+
"""Tipo pago es invalido."""
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class FechaOperacionIncorrectaError(SPEIError):
|
|
15
|
+
"""Fecha operacion incorrecta."""
|
|
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
|
|
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
|