diff --git a/cuenca/resources/arpc.py b/cuenca/resources/arpc.py index 983841cd..111a5924 100644 --- a/cuenca/resources/arpc.py +++ b/cuenca/resources/arpc.py @@ -2,7 +2,6 @@ from typing import ClassVar, Optional from cuenca_validations.types.requests import ARPCRequest -from pydantic_extra_types.payment import PaymentCardNumber from ..http import Session, session as global_session from .base import Creatable @@ -30,7 +29,7 @@ class Arpc(Creatable): @classmethod def create( cls, - number: PaymentCardNumber, + number: str, arqc: str, arpc_method: str, transaction_data: str, @@ -51,6 +50,6 @@ def create( transaction_counter=transaction_counter, pan_sequence=pan_sequence, unique_number=unique_number, - track_data_method=track_data_method, # type: ignore + track_data_method=track_data_method, ) return cls._create(session=session, **req.model_dump()) diff --git a/cuenca/resources/card_activations.py b/cuenca/resources/card_activations.py index 89777d59..f7d72520 100644 --- a/cuenca/resources/card_activations.py +++ b/cuenca/resources/card_activations.py @@ -2,7 +2,6 @@ from typing import ClassVar, Optional, cast from cuenca_validations.types.requests import CardActivationRequest -from pydantic_extra_types.payment import PaymentCardNumber from ..http import Session, session as global_session from .base import Creatable @@ -22,7 +21,7 @@ class CardActivation(Creatable): @classmethod def create( cls, - number: PaymentCardNumber, + number: str, exp_month: int, exp_year: int, cvv2: str, diff --git a/cuenca/resources/card_validations.py b/cuenca/resources/card_validations.py index 244a6ccf..2ad4ee87 100644 --- a/cuenca/resources/card_validations.py +++ b/cuenca/resources/card_validations.py @@ -3,7 +3,6 @@ from cuenca_validations.types import CardStatus, CardType from cuenca_validations.types.requests import CardValidationRequest -from pydantic_extra_types.payment import PaymentCardNumber from ..http import Session, session as global_session from .base import Creatable @@ -31,7 +30,7 @@ class CardValidation(Creatable): @classmethod def create( cls, - number: PaymentCardNumber, + number: str, cvv: Optional[str] = None, cvv2: Optional[str] = None, icvv: Optional[str] = None, diff --git a/cuenca/resources/curp_validations.py b/cuenca/resources/curp_validations.py index 4a43dd95..4b217490 100644 --- a/cuenca/resources/curp_validations.py +++ b/cuenca/resources/curp_validations.py @@ -94,7 +94,7 @@ def create( second_surname=second_surname, date_of_birth=date_of_birth, state_of_birth=state_of_birth, - country_of_birth=country_of_birth, # type: ignore + country_of_birth=country_of_birth, gender=gender, manual_curp=manual_curp, ) diff --git a/cuenca/resources/file_batches.py b/cuenca/resources/file_batches.py index d0d10fdb..185bf1cc 100644 --- a/cuenca/resources/file_batches.py +++ b/cuenca/resources/file_batches.py @@ -1,6 +1,10 @@ from typing import ClassVar -from cuenca_validations.types import BatchFileMetadata, FileBatchUploadRequest +from cuenca_validations.types import ( + BatchFileMetadata, + FileBatchUploadRequest, + FileRequest, +) from ..http import Session, session as global_session from .base import Creatable, Queryable @@ -22,7 +26,7 @@ def create( session: Session = global_session, ) -> 'FileBatch': req = FileBatchUploadRequest( - files=files, # type: ignore + files=[FileRequest(**f) for f in files], user_id=user_id, ) return cls._create(session=session, **req.model_dump()) diff --git a/cuenca/resources/files.py b/cuenca/resources/files.py index b7de4bc6..f97fbf93 100644 --- a/cuenca/resources/files.py +++ b/cuenca/resources/files.py @@ -40,7 +40,7 @@ def upload( req = FileUploadRequest( file=file.read(), type=file_type, - extension=extension, # type: ignore + extension=extension, is_back=is_back, user_id=user_id, ) diff --git a/cuenca/resources/sessions.py b/cuenca/resources/sessions.py index 0d6b0b96..4c8eff0d 100644 --- a/cuenca/resources/sessions.py +++ b/cuenca/resources/sessions.py @@ -48,7 +48,7 @@ def create( req = SessionRequest( user_id=user_id, type=type, - success_url=success_url, # type: ignore - failure_url=failure_url, # type: ignore + success_url=success_url, + failure_url=failure_url, ) return cls._create(session=session, **req.model_dump()) diff --git a/cuenca/resources/transfers.py b/cuenca/resources/transfers.py index ab20043a..bde76ac3 100644 --- a/cuenca/resources/transfers.py +++ b/cuenca/resources/transfers.py @@ -62,7 +62,7 @@ def create( if not idempotency_key: idempotency_key = cls._gen_idempotency_key(account_number, amount) req = TransferRequest( - account_number=account_number, # type: ignore + account_number=account_number, amount=amount, descriptor=descriptor, recipient_name=recipient_name, diff --git a/cuenca/resources/user_lists_validation.py b/cuenca/resources/user_lists_validation.py index ae01db21..9fb97ef1 100644 --- a/cuenca/resources/user_lists_validation.py +++ b/cuenca/resources/user_lists_validation.py @@ -34,6 +34,6 @@ def create( first_surname=first_surname, second_surname=second_surname, curp=curp, - account_number=account_number, # type: ignore + account_number=account_number, ) return cls._create(session=session, **req.model_dump()) diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 00000000..895701cc --- /dev/null +++ b/mypy.ini @@ -0,0 +1,2 @@ +[mypy] +plugins = pydantic.mypy \ No newline at end of file