Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions cuenca/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
'Identity',
'IdentityEvent',
'KYCValidation',
'KYCVerification',
'LimitedWallet',
'LoginToken',
'Otp',
Expand Down Expand Up @@ -68,7 +67,6 @@
IdentityEvent,
JwtToken,
KYCValidation,
KYCVerification,
LimitedWallet,
LoginToken,
Otp,
Expand Down
3 changes: 0 additions & 3 deletions cuenca/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
'Identity',
'IdentityEvent',
'KYCValidation',
'KYCVerification',
'LimitedWallet',
'LoginToken',
'Otp',
Expand Down Expand Up @@ -62,7 +61,6 @@
from .identity_events import IdentityEvent
from .jwt_tokens import JwtToken
from .kyc_validations import KYCValidation
from .kyc_verifications import KYCVerification
from .limited_wallets import LimitedWallet
from .login_tokens import LoginToken
from .otps import Otp
Expand Down Expand Up @@ -106,7 +104,6 @@
Identity,
IdentityEvent,
KYCValidation,
KYCVerification,
LimitedWallet,
LoginToken,
Questionnaires,
Expand Down
22 changes: 14 additions & 8 deletions cuenca/resources/kyc_validations.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import ClassVar, Optional

from cuenca_validations.types import KYCFile, KYCValidationRequest
from cuenca_validations.types import KYCValidationRequest, KYCValidationSource
from pydantic import ConfigDict

from ..http import Session, session as global_session
Expand All @@ -10,19 +10,25 @@
class KYCValidation(Creatable, Retrievable, Queryable):
_resource: ClassVar = 'kyc_validations'
platform_id: str
attemps: Optional[int] = None
verification_id: Optional[str] = None
user_id: str
source_type: KYCValidationSource
flow_id: str
files_uri: Optional[list[str]] = None
verification_id: Optional[str] = None
identity_id: Optional[str] = None

model_config = ConfigDict(
json_schema_extra={
'example': {
'id': 'KVNEUInh69SuKXXmK95sROwQ',
'platform_id': 'PT8UEv02zBTcymd4Kd3MO6pg',
'created_at': '2020-05-24T14:15:22Z',
'verification_id': 'string',
'platform_id': 'PT-1234567890',
'user_id': 'US-1234567890',
'source_type': 'server',
'flow_id': '123e4567-e89b-12d3-a456-426614174000',
'files_uri': ['cuenca.com/files/id', 'cuenca.com/files/id2'],
'attemps': '1',
'verification_id': 'metamap-verification-id',
'identity_id': 'metamap-identity-id',
}
}
)
Expand All @@ -31,13 +37,13 @@ class KYCValidation(Creatable, Retrievable, Queryable):
def create(
cls,
user_id: str,
source_type: KYCValidationSource,
force: bool = False,
documents: list[KYCFile] = [],
session: Session = global_session,
) -> 'KYCValidation':
req = KYCValidationRequest(
user_id=user_id,
force=force,
documents=documents,
source_type=source_type,
)
return cls._create(**req.model_dump(), session=session)
53 changes: 0 additions & 53 deletions cuenca/resources/kyc_verifications.py

This file was deleted.

2 changes: 1 addition & 1 deletion cuenca/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = '2.1.2'
__version__ = '2.1.3'
CLIENT_VERSION = __version__
API_VERSION = '2020-03-19'
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
requests==2.32.3
cuenca-validations==2.1.0
cuenca-validations==2.1.5
pydantic-extra-types==2.10.2
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
python_requires='>=3.9',
install_requires=[
'requests>=2.32.0',
'cuenca-validations>=2.1.0',
'cuenca-validations>=2.1.5',
'pydantic-extra-types>=2.10.0',
],
classifiers=[
Expand Down
50 changes: 0 additions & 50 deletions tests/resources/cassettes/test_kyc_verification_create.yaml

This file was deleted.

46 changes: 0 additions & 46 deletions tests/resources/cassettes/test_kyc_verification_retrieve.yaml

This file was deleted.

50 changes: 0 additions & 50 deletions tests/resources/cassettes/test_kyc_verification_update.yaml

This file was deleted.

31 changes: 13 additions & 18 deletions tests/resources/cassettes/test_validation_create.yaml
Original file line number Diff line number Diff line change
@@ -1,51 +1,46 @@
interactions:
- request:
body: '{"user_id": "USFOOBAR"}'
body: '{"user_id": "USze_Bh1zhROKehtBOS7EHlw", "source_type": "server", "force":
false}'
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
Authorization:
- DUMMY
Connection:
- keep-alive
Content-Length:
- '39'
- '80'
Content-Type:
- application/json
User-Agent:
- cuenca-python/0.14.7.dev6
- cuenca-python/2.1.3.dev2
X-Cuenca-Api-Version:
- '2020-03-19'
method: POST
uri: https://sandbox.cuenca.com/kyc_validations
response:
body:
string: '{"id":"KVWZUhh-t_RUOPvU3hOnhbsQ","created_at":"2022-09-26T23:14:28.686030","verification_id":"6332324ca3b3cd001c6bcbf9","platform_id":"PTS7Wx1-1KRCKHQRWXsqxbMQ","user_id":"USOiwY3bhaRO-Or9koIBaehg","files_uri":["''https://sandbox.cuenca.com/files/EFfX_JE_wES3KA5cuR075rVA","https://sandbox.cuenca.com/files/EFWUXd3zl6Q6Gmd1tD2S65fw","https://sandbox.cuenca.com/files/EF2_YXyrMLSba7wpz-DQGgsw"]}'
string: '{"id":"KVvwIQTxHdQvOq769mEnoJsQ","created_at":"2025-03-27T20:10:03.783000","platform_id":"PTk5BbZcExRq-1u2W3J9mZpw","files_uri":["https://stage.cuenca.com/files/EF5pRc5dO4Q8WE6_zGCYUX6A","https://stage.cuenca.com/files/EF-y7kGVwlRESVGZOT-twioQ","https://stage.cuenca.com/files/EFB-J1hALOTPuuETDY5dtJJA","https://stage.cuenca.com/files/EFTrtO44_7QRiuRB8uXQizaw"],"user_id":"USze_Bh1zhROKehtBOS7EHlw","verification_id":"67e5b09c05c3102617d622b0","identity_id":"67e5b09c05c3101df5d622ad","source_type":"server","flow_id":"63486ce1e94af4001c126ccf"}'
headers:
Connection:
- keep-alive
Content-Length:
- '393'
- '545'
Content-Type:
- application/json
Date:
- Mon, 26 Sep 2022 23:14:28 GMT
- Thu, 27 Mar 2025 20:41:36 GMT
X-Request-Time:
- 'value: 27.792'
- 'value: 0.544'
x-amz-apigw-id:
- ZFzI7GHfoAMF4jQ=
- IGmwBF8BiYcEFLA=
x-amzn-Remapped-Connection:
- keep-alive
x-amzn-Remapped-Content-Length:
- '393'
- '545'
x-amzn-Remapped-Date:
- Mon, 26 Sep 2022 23:14:28 GMT
- Thu, 27 Mar 2025 20:41:36 GMT
x-amzn-Remapped-Server:
- nginx/1.22.0
- nginx/1.26.3
x-amzn-RequestId:
- 310039b7-a7dd-4980-bb0b-b5552c602d26
- 4fd4b9c9-08cf-44bb-b191-b8f18f10004c
status:
code: 201
message: Created
Expand Down
Loading
Loading