cuenca 2.1.1.dev0__py3-none-any.whl → 2.1.2.dev1__py3-none-any.whl

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.
cuenca/__init__.py CHANGED
@@ -20,6 +20,7 @@ __all__ = [
20
20
  'Identity',
21
21
  'IdentityEvent',
22
22
  'KYCValidation',
23
+ 'KYCVerification',
23
24
  'LimitedWallet',
24
25
  'LoginToken',
25
26
  'Otp',
@@ -67,6 +68,7 @@ from .resources import (
67
68
  IdentityEvent,
68
69
  JwtToken,
69
70
  KYCValidation,
71
+ KYCVerification,
70
72
  LimitedWallet,
71
73
  LoginToken,
72
74
  Otp,
@@ -19,6 +19,7 @@ __all__ = [
19
19
  'Identity',
20
20
  'IdentityEvent',
21
21
  'KYCValidation',
22
+ 'KYCVerification',
22
23
  'LimitedWallet',
23
24
  'LoginToken',
24
25
  'Otp',
@@ -61,6 +62,7 @@ from .identities import Identity
61
62
  from .identity_events import IdentityEvent
62
63
  from .jwt_tokens import JwtToken
63
64
  from .kyc_validations import KYCValidation
65
+ from .kyc_verifications import KYCVerification
64
66
  from .limited_wallets import LimitedWallet
65
67
  from .login_tokens import LoginToken
66
68
  from .otps import Otp
@@ -104,6 +106,7 @@ resource_classes = [
104
106
  Identity,
105
107
  IdentityEvent,
106
108
  KYCValidation,
109
+ KYCVerification,
107
110
  LimitedWallet,
108
111
  LoginToken,
109
112
  Questionnaires,
@@ -7,7 +7,6 @@ from cuenca_validations.types import (
7
7
  IdentityQuery,
8
8
  KYCFile,
9
9
  State,
10
- TOSAgreement,
11
10
  UserStatus,
12
11
  VerificationStatus,
13
12
  )
@@ -31,7 +30,6 @@ class Identity(Retrievable, Queryable):
31
30
  state_of_birth: Optional[State] = None
32
31
  country_of_birth: Optional[str] = None
33
32
  status: Optional[UserStatus] = None
34
- tos_agreement: Optional[TOSAgreement] = None
35
33
  blacklist_validation_status: Optional[VerificationStatus] = None
36
34
  address: Optional[Address] = None
37
35
  govt_id: Optional[KYCFile] = None
@@ -1,10 +1,6 @@
1
1
  from typing import ClassVar, Optional
2
2
 
3
- from cuenca_validations.types import (
4
- KYCFile,
5
- KYCValidationRequest,
6
- KYCValidationType,
7
- )
3
+ from cuenca_validations.types import KYCFile, KYCValidationRequest
8
4
  from pydantic import ConfigDict
9
5
 
10
6
  from ..http import Session, session as global_session
@@ -35,7 +31,6 @@ class KYCValidation(Creatable, Retrievable, Queryable):
35
31
  def create(
36
32
  cls,
37
33
  user_id: str,
38
- validation_type: KYCValidationType,
39
34
  force: bool = False,
40
35
  documents: list[KYCFile] = [],
41
36
  session: Session = global_session,
@@ -44,6 +39,5 @@ class KYCValidation(Creatable, Retrievable, Queryable):
44
39
  user_id=user_id,
45
40
  force=force,
46
41
  documents=documents,
47
- validation_type=validation_type,
48
42
  )
49
43
  return cls._create(**req.model_dump(), session=session)
@@ -0,0 +1,53 @@
1
+ import datetime as dt
2
+ from typing import ClassVar, Optional
3
+
4
+ from cuenca_validations.types import (
5
+ Address,
6
+ Curp,
7
+ KYCVerificationUpdateRequest,
8
+ Rfc,
9
+ )
10
+ from pydantic import ConfigDict
11
+
12
+ from ..http import Session, session as global_session
13
+ from .base import Creatable, Retrievable, Updateable
14
+
15
+
16
+ class KYCVerification(Creatable, Retrievable, Updateable):
17
+ _resource: ClassVar = 'kyc_verifications'
18
+
19
+ platform_id: str
20
+ created_at: dt.datetime
21
+ deactivated_at: Optional[dt.datetime] = None
22
+ verification_id: Optional[str] = None
23
+ curp: Optional[Curp] = None
24
+ rfc: Optional[Rfc] = None
25
+ address: Optional[Address] = None
26
+
27
+ model_config = ConfigDict(
28
+ json_schema_extra={
29
+ 'example': {
30
+ 'id': 'KVNEUInh69SuKXXmK95sROwQ',
31
+ 'updated_at': '2020-05-24T14:15:22Z',
32
+ 'platform_id': 'PT8UEv02zBTcymd4Kd3MO6pg',
33
+ 'created_at': '2020-05-24T14:15:22Z',
34
+ 'verification_id': 'string',
35
+ 'curp': 'GOCG650418HVZNML08',
36
+ 'rfc': 'GOCG650418123',
37
+ 'address': Address.schema().get('example'),
38
+ }
39
+ }
40
+ )
41
+
42
+ @classmethod
43
+ def create(cls, session: Session = global_session) -> 'KYCVerification':
44
+ return cls._create(session=session)
45
+
46
+ @classmethod
47
+ def update(
48
+ cls,
49
+ kyc_id: str,
50
+ curp: Optional[Curp] = None,
51
+ ) -> 'KYCVerification':
52
+ req = KYCVerificationUpdateRequest(curp=curp)
53
+ return cls._update(id=kyc_id, **req.model_dump())
@@ -0,0 +1,18 @@
1
+ import datetime as dt
2
+ from typing import ClassVar
3
+
4
+ from cuenca_validations.types import TermsOfService as TermsOfServiceEnum
5
+ from cuenca_validations.types.general import SerializableHttpUrl
6
+
7
+ from .base import Queryable, Retrievable
8
+
9
+
10
+ class TermsOfService(Retrievable, Queryable):
11
+ _resource: ClassVar = 'terms_of_services'
12
+
13
+ id: str
14
+ is_active: bool
15
+ created_at: dt.datetime
16
+ type: TermsOfServiceEnum
17
+ version: str
18
+ uri: SerializableHttpUrl
@@ -0,0 +1,21 @@
1
+ import datetime as dt
2
+ from typing import ClassVar
3
+
4
+ from cuenca_validations.types import TermsOfService
5
+ from cuenca_validations.types.general import SerializableHttpUrl
6
+
7
+ from .base import Creatable, Queryable, Retrievable
8
+
9
+
10
+ class UserTOSAgreement(Creatable, Retrievable, Queryable):
11
+ _resource: ClassVar = 'user_tos_agreements'
12
+
13
+ id: str
14
+ created_at: dt.datetime
15
+ user_id: str
16
+ type: TermsOfService
17
+ version: str
18
+ ip: str
19
+ location: str
20
+ hash: str
21
+ url: SerializableHttpUrl
cuenca/resources/users.py CHANGED
@@ -7,8 +7,6 @@ from cuenca_validations.types import (
7
7
  Beneficiary,
8
8
  KYCFile,
9
9
  PhoneNumber,
10
- TOSAgreement,
11
- TOSRequest,
12
10
  UserQuery,
13
11
  UserRequest,
14
12
  UserStatus,
@@ -41,7 +39,6 @@ class User(Creatable, Retrievable, Updateable, Queryable):
41
39
  phone_number: Optional[PhoneNumber] = None
42
40
  email_address: Optional[EmailStr] = None
43
41
  profession: Optional[str] = None
44
- terms_of_service: Optional[TOSAgreement] = None
45
42
  status: Optional[UserStatus] = None
46
43
  address: Optional[Address] = None
47
44
  govt_id: Optional[KYCFile] = Field(
@@ -87,7 +84,6 @@ class User(Creatable, Retrievable, Updateable, Queryable):
87
84
  'phone_number': '+525511223344',
88
85
  'email_address': 'user@example.com',
89
86
  'profession': 'engineer',
90
- 'terms_of_service': TOSAgreement.schema().get('example'),
91
87
  'status': 'active',
92
88
  'address': Address.schema().get('example'),
93
89
  'govt_id': KYCFile.schema().get('example'),
@@ -113,7 +109,6 @@ class User(Creatable, Retrievable, Updateable, Queryable):
113
109
  phone_verification_id: Optional[str] = None,
114
110
  status: Optional[UserStatus] = None,
115
111
  required_level: Optional[int] = None,
116
- terms_of_service: Optional[TOSRequest] = None,
117
112
  *,
118
113
  session: Session = global_session,
119
114
  ) -> 'User':
@@ -127,7 +122,6 @@ class User(Creatable, Retrievable, Updateable, Queryable):
127
122
  phone_verification_id=phone_verification_id,
128
123
  required_level=required_level,
129
124
  status=status,
130
- terms_of_service=terms_of_service,
131
125
  )
132
126
  return cls._create(session=session, **req.model_dump())
133
127
 
@@ -143,7 +137,6 @@ class User(Creatable, Retrievable, Updateable, Queryable):
143
137
  govt_id: Optional[KYCFile] = None,
144
138
  proof_of_address: Optional[KYCFile] = None,
145
139
  proof_of_life: Optional[KYCFile] = None,
146
- terms_of_service: Optional[TOSRequest] = None,
147
140
  verification_id: Optional[str] = None,
148
141
  status: Optional[UserStatus] = None,
149
142
  email_verification_id: Optional[str] = None,
@@ -161,7 +154,6 @@ class User(Creatable, Retrievable, Updateable, Queryable):
161
154
  govt_id=govt_id,
162
155
  proof_of_address=proof_of_address,
163
156
  proof_of_life=proof_of_life,
164
- terms_of_service=terms_of_service,
165
157
  verification_id=verification_id,
166
158
  email_verification_id=email_verification_id,
167
159
  phone_verification_id=phone_verification_id,
cuenca/version.py CHANGED
@@ -1,3 +1,3 @@
1
- __version__ = '2.1.1.dev0'
1
+ __version__ = '2.1.2.dev1'
2
2
  CLIENT_VERSION = __version__
3
3
  API_VERSION = '2020-03-19'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: cuenca
3
- Version: 2.1.1.dev0
3
+ Version: 2.1.2.dev1
4
4
  Summary: Cuenca API Client
5
5
  Home-page: https://github.com/cuenca-mx/cuenca-python
6
6
  Author: Cuenca
@@ -1,11 +1,11 @@
1
- cuenca/__init__.py,sha256=RM0mtsXTTe6egPaHFPE7QElKfi7pm9RQBAWMee3N1Pw,1746
1
+ cuenca/__init__.py,sha256=KQOScdvJ-rAsCugliTHsrxnV2A2hCLVpKnwaJpv3qO0,1790
2
2
  cuenca/exc.py,sha256=r_lL03-JS0AsXw71wuNbiwNYLHNDagM56tRxpYyK6Lw,601
3
3
  cuenca/jwt.py,sha256=plB2ttHPZnL0xq3gqubw_Jjtj1QYG2E5bk99N3cn5zg,1502
4
4
  cuenca/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- cuenca/version.py,sha256=yj9bckBHyWZotr_jgSRWwHFUNimRLxf7lJMj4hHYfZE,83
5
+ cuenca/version.py,sha256=0_pKwoKkikx2x9Kdkvd2AgOyDFTqx3Xae6DjFBpx7yE,83
6
6
  cuenca/http/__init__.py,sha256=V5TG6Ro9d3VY7umzcbtanmvHlGkv-k71H0tqrdMyH-s,49
7
7
  cuenca/http/client.py,sha256=psXJiSgd3SUSJ5jwvhdBWsVMNadenG353BNVXdh7HMY,4168
8
- cuenca/resources/__init__.py,sha256=6EF_HDxcJUBMmdbx00DsYDOMDhi5JGIOExkhPK9DbIY,2991
8
+ cuenca/resources/__init__.py,sha256=hD0V8_D3DV4aRZSR7hYrrQ-qRXvlVBxilnIEPa4H9nw,3082
9
9
  cuenca/resources/accounts.py,sha256=5yfNxAHpxWFosoR4WrPrDGpBCRkaQk98V-w0wCPPXqU,345
10
10
  cuenca/resources/api_keys.py,sha256=p65ZUiAu51JhEL_fZDc7_DTR0PMcSa-YQeK9gRFY82s,2618
11
11
  cuenca/resources/arpc.py,sha256=a9gGIgpBV8RK2ePSPBxI5c4ET4MtKH6Po_HRiv73B5k,1689
@@ -24,10 +24,11 @@ cuenca/resources/deposits.py,sha256=8FINQJ3c0Zg8FAq7e1JZu9i8G40fX-Kmawhl7Ouxpx4,
24
24
  cuenca/resources/endpoints.py,sha256=AhrG8O6-6rtjtA9Ll98nmxq7xxiLkrKHR7XXZ59PGSs,3235
25
25
  cuenca/resources/file_batches.py,sha256=2Fsmz8ryOjvLn3dpsyR0G2iS0zNVR4ajovNkaMZaHaM,786
26
26
  cuenca/resources/files.py,sha256=WZYRo76fIGXNXk2HzA252dSdIdA4bl3EjB6q0bb6BFg,1837
27
- cuenca/resources/identities.py,sha256=IdL495eTjx_2gDRxM9oG_QmDNOwaY7Nv9gzqeZu_Wdk,1092
27
+ cuenca/resources/identities.py,sha256=9w3BFCBsFWqxnf7PUuKqjH7VcI5-mIPSX3BSqlX7ie0,1025
28
28
  cuenca/resources/identity_events.py,sha256=K1G6IEGlw6n482nZhBo_CJNBdpKFCO6duMQr5y9k4x8,374
29
29
  cuenca/resources/jwt_tokens.py,sha256=NSFLMcWKPZLcVR6g8X-RIQ9e4i7VDoQvrkp3GLiapEc,952
30
- cuenca/resources/kyc_validations.py,sha256=X2mRrZHzFuGV7D6HQfeDSEhCn5uFTXwMBuHm1X9_YeM,1447
30
+ cuenca/resources/kyc_validations.py,sha256=1G_dr6e1mpLUlqT9RmBgiC06eh0vQjMzosM5w3ZCQoE,1322
31
+ cuenca/resources/kyc_verifications.py,sha256=ysvVS9zdvFZ1Wyh2G_cr_IMwYeLW5BRLVyAt46hTk4g,1563
31
32
  cuenca/resources/limited_wallets.py,sha256=Z3pKMRmMFTAaCw-KdzGSWfYFHCpy-ZrBwOmalVfSdRU,1049
32
33
  cuenca/resources/login_tokens.py,sha256=vxRWqQznxdEUK0R80k0qC0BkTSZwZgUsC2neX8TTd8Q,799
33
34
  cuenca/resources/otps.py,sha256=dZEwns98N8uUtRBFCu6Qs6ySHARU9v3zTF6T5rpF43M,711
@@ -38,12 +39,14 @@ cuenca/resources/savings.py,sha256=3DBP1ygxhcScDpLvAQS_fF5chljyDTz4xwnltI0LCAg,1
38
39
  cuenca/resources/service_providers.py,sha256=x-FNcyiUkdUsNCGudyLGYDbRkD2jPj8-T8U3IumxTVQ,310
39
40
  cuenca/resources/sessions.py,sha256=lWphgjG9SZl81ik7c9tuAI6OE4JUOF0ZfRBvmf4vwyQ,1764
40
41
  cuenca/resources/statements.py,sha256=PqMvhoE9cvBneXjaS7w4JnTzYdDakkCkbdNYrd7b8LI,282
42
+ cuenca/resources/terms_of_services.py,sha256=8Od1xYqMaW20R7zSO19Z4q5M2sMnV9pg2l2qxHsMjXY,462
41
43
  cuenca/resources/transfers.py,sha256=v742SAGUIZfvYHfCNtk0hSm2uyhMGh00RbHIIJiqLzQ,3201
42
44
  cuenca/resources/user_credentials.py,sha256=glpxUa5-aYhgJ1ZG1g_c1PAWaQ9eEWP01lauBaccSQQ,1356
43
45
  cuenca/resources/user_events.py,sha256=L57v7clStwxyJX2vwe-357uRTrzeQglDpCCgXRg7v9Y,728
44
46
  cuenca/resources/user_lists_validation.py,sha256=eOADDHKg-RthgeO50Edh4VQtQcNl2tHvdmXMYuGpsCA,1275
45
47
  cuenca/resources/user_logins.py,sha256=KDauv2c5BJUR-C5ZeIjAPsv-8VH11BhoT-wCU9KgrwY,1542
46
- cuenca/resources/users.py,sha256=3qb0-_3KBQCooqFUrknQ28ywU2v7s4JMudrd65z5Q-0,6321
48
+ cuenca/resources/user_tos_agreements.py,sha256=IjN7IjRHeAjGtw08mkb4NI8aG1tWEQbZQ2xucOf6LTI,503
49
+ cuenca/resources/users.py,sha256=YZBqQTHx5e_5OxRaH10V0gboRqf5bEnE5P--xhHU0zc,5957
47
50
  cuenca/resources/verifications.py,sha256=YyvSh5IpiJ02lHK8k-guTwoHSFoaMYSFk1aC2tPi7n0,1680
48
51
  cuenca/resources/wallet_transactions.py,sha256=8ePZI3-GaEd658GPYizAfHK9GVwlkt1r95-mEb7T3Jg,1030
49
52
  cuenca/resources/webhooks.py,sha256=bGjuvkSP3GXo4Q6v8iZ40Md8xc4AQrEmAD3r40VJqxM,392
@@ -76,7 +79,8 @@ tests/resources/test_files.py,sha256=2VSlvYnGHrw--mYNvA6hlpEw-olbW_Hlq2d4vdn8v7M
76
79
  tests/resources/test_identities.py,sha256=0osumiLrzKkGG4XLlL4nIdSp_nGutHaPf55w_IVREps,454
77
80
  tests/resources/test_identity_events.py,sha256=BZlM2RXKtCORdTDQCemY3NAR3KWb3mPNql4sd6oU4-U,344
78
81
  tests/resources/test_jwt_tokens.py,sha256=DnZS_kEGhtnb0KWFh9W0tJIiCvo_u1A3iXcu2h3z5WA,184
79
- tests/resources/test_kyc_validations.py,sha256=kly3EFCW6-tK8IZO8-ZB6-wp_YxqUH7EtAs3jlAI2u0,544
82
+ tests/resources/test_kyc_validations.py,sha256=TEyS6encW-InRpcAR4nDCfmkqqnn8yMC9AaS3iWm8Xw,420
83
+ tests/resources/test_kyc_verifications.py,sha256=Y-ZU61o18I_3NFqMN2w4WGZTzwsIhULAtESqIXiizUY,634
80
84
  tests/resources/test_limited_wallets.py,sha256=c0zDDOip3lJk8chbcGr_nWCdkO9yuL_HbD1IikR5jH4,527
81
85
  tests/resources/test_login_tokens.py,sha256=kn0gXFOanIXjgKjbeOzfNyKsGAUkc2iKnuVmzIRaMD8,572
82
86
  tests/resources/test_otps.py,sha256=IpCczDNRL_WaWwc1rYbSRmtWMR7GMa-Pfbq2TZcZQDw,616
@@ -97,8 +101,8 @@ tests/resources/test_verifications.py,sha256=yyL-bdryQU3MvqnmAgnnzGG9t7UTxWwPiVu
97
101
  tests/resources/test_wallet_transactions.py,sha256=_L2hjPHT4FwwhxksUoaoVHwFFYOGWfF4ScCbk0kb7Hw,3945
98
102
  tests/resources/test_webhooks.py,sha256=nYCqAnlNJcMJKRHhgoHOWTQnFLWQHHvFyY8GVCxGTD8,328
99
103
  tests/resources/test_whatsapp_transfers.py,sha256=4Dmrsbytx7LRrLQo9M8TAL7cGKJufPStkp51UdRCnYU,1030
100
- cuenca-2.1.1.dev0.dist-info/LICENSE,sha256=aWv5PmUiAcNENEAdghcVQSeU56pXJHWexJYgklK9XLg,1063
101
- cuenca-2.1.1.dev0.dist-info/METADATA,sha256=gJZdXC1lhtZvBADFqYmwwmqj4qYc1f9ZuufkqCIQDas,4966
102
- cuenca-2.1.1.dev0.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
103
- cuenca-2.1.1.dev0.dist-info/top_level.txt,sha256=5h3K7XJTmJniDloPq4sIJHni_xLw-Uoc6ZJ5mcw_lZY,13
104
- cuenca-2.1.1.dev0.dist-info/RECORD,,
104
+ cuenca-2.1.2.dev1.dist-info/LICENSE,sha256=aWv5PmUiAcNENEAdghcVQSeU56pXJHWexJYgklK9XLg,1063
105
+ cuenca-2.1.2.dev1.dist-info/METADATA,sha256=YT5XGGhUUHW-ld3Y5XK1-BdR7eDni9behrW8rOLlM0s,4966
106
+ cuenca-2.1.2.dev1.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
107
+ cuenca-2.1.2.dev1.dist-info/top_level.txt,sha256=5h3K7XJTmJniDloPq4sIJHni_xLw-Uoc6ZJ5mcw_lZY,13
108
+ cuenca-2.1.2.dev1.dist-info/RECORD,,
@@ -1,15 +1,11 @@
1
1
  import pytest
2
- from cuenca_validations.types import KYCValidationType
3
2
 
4
3
  from cuenca import KYCValidation
5
4
 
6
5
 
7
6
  @pytest.mark.vcr
8
7
  def test_validation_create():
9
- kyc_validation: KYCValidation = KYCValidation.create(
10
- user_id="USFOOBAR",
11
- validation_type=KYCValidationType.background,
12
- )
8
+ kyc_validation: KYCValidation = KYCValidation.create(user_id="USFOOBAR")
13
9
  assert kyc_validation.id
14
10
  assert kyc_validation.verification_id
15
11
 
@@ -0,0 +1,25 @@
1
+ import pytest
2
+
3
+ from cuenca import KYCVerification
4
+
5
+
6
+ @pytest.mark.vcr
7
+ def test_kyc_verification_create():
8
+ kyc_verification: KYCVerification = KYCVerification.create()
9
+ assert kyc_verification.id
10
+
11
+
12
+ @pytest.mark.vcr
13
+ def test_kyc_verification_retrieve():
14
+ kyc_verification = KYCVerification.retrieve('KYC01')
15
+ assert kyc_verification.id
16
+
17
+
18
+ @pytest.mark.vcr
19
+ def test_kyc_verification_update():
20
+ kyc_id = 'KYC01'
21
+ changes = dict(curp='HEMA921130HNERNN05')
22
+ kyc_verification = KYCVerification.update(kyc_id, **changes)
23
+ assert all(
24
+ item in kyc_verification.to_dict().items() for item in changes.items()
25
+ )