cuenca 1.0.2__py3-none-any.whl → 1.0.3.dev0__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 +0 -2
- cuenca/resources/__init__.py +0 -2
- cuenca/resources/api_keys.py +4 -5
- cuenca/resources/arpc.py +2 -2
- cuenca/resources/base.py +36 -46
- cuenca/resources/card_activations.py +1 -3
- cuenca/resources/cards.py +4 -5
- cuenca/resources/clabes.py +2 -2
- cuenca/resources/curp_validations.py +2 -5
- cuenca/resources/endpoints.py +3 -4
- cuenca/resources/file_batches.py +2 -2
- cuenca/resources/files.py +2 -8
- cuenca/resources/kyc_validations.py +2 -4
- cuenca/resources/kyc_verifications.py +3 -3
- cuenca/resources/limited_wallets.py +2 -2
- cuenca/resources/login_tokens.py +2 -2
- cuenca/resources/platforms.py +2 -2
- cuenca/resources/questionnaires.py +2 -4
- cuenca/resources/resources.py +2 -2
- cuenca/resources/savings.py +3 -3
- cuenca/resources/sessions.py +2 -2
- cuenca/resources/transfers.py +1 -1
- cuenca/resources/user_credentials.py +3 -8
- cuenca/resources/user_lists_validation.py +2 -5
- cuenca/resources/user_logins.py +2 -2
- cuenca/resources/users.py +3 -6
- cuenca/resources/verifications.py +3 -6
- cuenca/resources/wallet_transactions.py +1 -1
- cuenca/version.py +1 -1
- {cuenca-1.0.2.dist-info → cuenca-1.0.3.dev0.dist-info}/METADATA +4 -4
- {cuenca-1.0.2.dist-info → cuenca-1.0.3.dev0.dist-info}/RECORD +35 -37
- {cuenca-1.0.2.dist-info → cuenca-1.0.3.dev0.dist-info}/WHEEL +1 -1
- tests/resources/test_api_keys.py +1 -1
- cuenca/resources/otps.py +0 -24
- tests/resources/test_otps.py +0 -28
- {cuenca-1.0.2.dist-info → cuenca-1.0.3.dev0.dist-info}/LICENSE +0 -0
- {cuenca-1.0.2.dist-info → cuenca-1.0.3.dev0.dist-info}/top_level.txt +0 -0
cuenca/__init__.py
CHANGED
|
@@ -23,7 +23,6 @@ __all__ = [
|
|
|
23
23
|
'KYCVerification',
|
|
24
24
|
'LimitedWallet',
|
|
25
25
|
'LoginToken',
|
|
26
|
-
'Otp',
|
|
27
26
|
'Platform',
|
|
28
27
|
'Questionnaires',
|
|
29
28
|
'Saving',
|
|
@@ -71,7 +70,6 @@ from .resources import (
|
|
|
71
70
|
KYCVerification,
|
|
72
71
|
LimitedWallet,
|
|
73
72
|
LoginToken,
|
|
74
|
-
Otp,
|
|
75
73
|
Platform,
|
|
76
74
|
Questionnaires,
|
|
77
75
|
Saving,
|
cuenca/resources/__init__.py
CHANGED
|
@@ -22,7 +22,6 @@ __all__ = [
|
|
|
22
22
|
'KYCVerification',
|
|
23
23
|
'LimitedWallet',
|
|
24
24
|
'LoginToken',
|
|
25
|
-
'Otp',
|
|
26
25
|
'Platform',
|
|
27
26
|
'Questionnaires',
|
|
28
27
|
'Saving',
|
|
@@ -63,7 +62,6 @@ from .kyc_validations import KYCValidation
|
|
|
63
62
|
from .kyc_verifications import KYCVerification
|
|
64
63
|
from .limited_wallets import LimitedWallet
|
|
65
64
|
from .login_tokens import LoginToken
|
|
66
|
-
from .otps import Otp
|
|
67
65
|
from .platforms import Platform
|
|
68
66
|
from .questionnaires import Questionnaires
|
|
69
67
|
from .resources import RESOURCES
|
cuenca/resources/api_keys.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import ClassVar, Optional
|
|
2
|
+
from typing import ClassVar, Optional
|
|
3
3
|
|
|
4
4
|
from cuenca_validations.types import ApiKeyQuery, ApiKeyUpdateRequest
|
|
5
5
|
|
|
@@ -36,7 +36,7 @@ class ApiKey(Creatable, Queryable, Retrievable, Updateable):
|
|
|
36
36
|
|
|
37
37
|
@classmethod
|
|
38
38
|
def create(cls, *, session: Session = global_session) -> 'ApiKey':
|
|
39
|
-
return
|
|
39
|
+
return cls._create(session=session)
|
|
40
40
|
|
|
41
41
|
@classmethod
|
|
42
42
|
def deactivate(
|
|
@@ -55,7 +55,7 @@ class ApiKey(Creatable, Queryable, Retrievable, Updateable):
|
|
|
55
55
|
"""
|
|
56
56
|
url = cls._resource + f'/{api_key_id}'
|
|
57
57
|
resp = session.delete(url, dict(minutes=minutes))
|
|
58
|
-
return
|
|
58
|
+
return cls(**resp)
|
|
59
59
|
|
|
60
60
|
@classmethod
|
|
61
61
|
def update(
|
|
@@ -74,5 +74,4 @@ class ApiKey(Creatable, Queryable, Retrievable, Updateable):
|
|
|
74
74
|
req = ApiKeyUpdateRequest(
|
|
75
75
|
metadata=metadata, user_id=user_id, platform_id=platform_id
|
|
76
76
|
)
|
|
77
|
-
|
|
78
|
-
return cast('ApiKey', resp)
|
|
77
|
+
return cls._update(api_key_id, **req.dict(), session=session)
|
cuenca/resources/arpc.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import ClassVar, Optional
|
|
2
|
+
from typing import ClassVar, Optional
|
|
3
3
|
|
|
4
4
|
from cuenca_validations.types.requests import ARPCRequest
|
|
5
5
|
|
|
@@ -52,4 +52,4 @@ class Arpc(Creatable):
|
|
|
52
52
|
unique_number=unique_number,
|
|
53
53
|
track_data_method=track_data_method,
|
|
54
54
|
)
|
|
55
|
-
return
|
|
55
|
+
return cls._create(session=session, **req.dict())
|
cuenca/resources/base.py
CHANGED
|
@@ -2,7 +2,7 @@ import base64
|
|
|
2
2
|
import datetime as dt
|
|
3
3
|
import json
|
|
4
4
|
from io import BytesIO
|
|
5
|
-
from typing import ClassVar,
|
|
5
|
+
from typing import ClassVar, Generator, Optional, Type, TypeVar
|
|
6
6
|
from urllib.parse import urlencode
|
|
7
7
|
|
|
8
8
|
from cuenca_validations.types import (
|
|
@@ -12,34 +12,22 @@ from cuenca_validations.types import (
|
|
|
12
12
|
TransactionQuery,
|
|
13
13
|
TransactionStatus,
|
|
14
14
|
)
|
|
15
|
-
from pydantic import BaseModel
|
|
15
|
+
from pydantic import BaseModel, Extra
|
|
16
16
|
|
|
17
17
|
from ..exc import MultipleResultsFound, NoResultFound
|
|
18
18
|
from ..http import Session, session as global_session
|
|
19
19
|
|
|
20
|
+
R_co = TypeVar('R_co', bound='Resource', covariant=True)
|
|
21
|
+
Q_co = TypeVar('Q_co', bound='Queryable', covariant=True)
|
|
22
|
+
|
|
20
23
|
|
|
21
24
|
class Resource(BaseModel):
|
|
22
25
|
_resource: ClassVar[str]
|
|
23
26
|
|
|
24
27
|
id: str
|
|
25
28
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
cls._filter_excess_fields(obj_dict)
|
|
29
|
-
return cls(**obj_dict)
|
|
30
|
-
|
|
31
|
-
@classmethod
|
|
32
|
-
def _filter_excess_fields(cls, obj_dict):
|
|
33
|
-
"""
|
|
34
|
-
dataclasses don't allow __init__ to be called with excess fields. This
|
|
35
|
-
method allows the API to add fields in the response body without
|
|
36
|
-
breaking the client
|
|
37
|
-
"""
|
|
38
|
-
excess = set(obj_dict.keys()) - set(
|
|
39
|
-
cls.schema().get("properties").keys()
|
|
40
|
-
)
|
|
41
|
-
for f in excess:
|
|
42
|
-
del obj_dict[f]
|
|
29
|
+
class Config:
|
|
30
|
+
extra = Extra.ignore
|
|
43
31
|
|
|
44
32
|
def to_dict(self):
|
|
45
33
|
return SantizedDict(self.dict())
|
|
@@ -48,12 +36,12 @@ class Resource(BaseModel):
|
|
|
48
36
|
class Retrievable(Resource):
|
|
49
37
|
@classmethod
|
|
50
38
|
def retrieve(
|
|
51
|
-
cls, id: str, *, session: Session = global_session
|
|
52
|
-
) ->
|
|
39
|
+
cls: Type[R_co], id: str, *, session: Session = global_session
|
|
40
|
+
) -> R_co:
|
|
53
41
|
resp = session.get(f'/{cls._resource}/{id}')
|
|
54
|
-
return cls
|
|
42
|
+
return cls(**resp)
|
|
55
43
|
|
|
56
|
-
def refresh(self, *, session: Session = global_session):
|
|
44
|
+
def refresh(self, *, session: Session = global_session) -> None:
|
|
57
45
|
new = self.retrieve(self.id, session=session)
|
|
58
46
|
for attr, value in new.__dict__.items():
|
|
59
47
|
setattr(self, attr, value)
|
|
@@ -61,9 +49,11 @@ class Retrievable(Resource):
|
|
|
61
49
|
|
|
62
50
|
class Creatable(Resource):
|
|
63
51
|
@classmethod
|
|
64
|
-
def _create(
|
|
52
|
+
def _create(
|
|
53
|
+
cls: Type[R_co], *, session: Session = global_session, **data
|
|
54
|
+
) -> R_co:
|
|
65
55
|
resp = session.post(cls._resource, data)
|
|
66
|
-
return cls
|
|
56
|
+
return cls(**resp)
|
|
67
57
|
|
|
68
58
|
|
|
69
59
|
class Updateable(Resource):
|
|
@@ -72,10 +62,10 @@ class Updateable(Resource):
|
|
|
72
62
|
|
|
73
63
|
@classmethod
|
|
74
64
|
def _update(
|
|
75
|
-
cls, id: str, *, session: Session = global_session, **data
|
|
76
|
-
) ->
|
|
65
|
+
cls: Type[R_co], id: str, *, session: Session = global_session, **data
|
|
66
|
+
) -> R_co:
|
|
77
67
|
resp = session.patch(f'/{cls._resource}/{id}', data)
|
|
78
|
-
return cls
|
|
68
|
+
return cls(**resp)
|
|
79
69
|
|
|
80
70
|
|
|
81
71
|
class Deactivable(Resource):
|
|
@@ -83,20 +73,20 @@ class Deactivable(Resource):
|
|
|
83
73
|
|
|
84
74
|
@classmethod
|
|
85
75
|
def deactivate(
|
|
86
|
-
cls, id: str, *, session: Session = global_session, **data
|
|
87
|
-
) ->
|
|
76
|
+
cls: Type[R_co], id: str, *, session: Session = global_session, **data
|
|
77
|
+
) -> R_co:
|
|
88
78
|
resp = session.delete(f'/{cls._resource}/{id}', data)
|
|
89
|
-
return cls
|
|
79
|
+
return cls(**resp)
|
|
90
80
|
|
|
91
81
|
@property
|
|
92
|
-
def is_active(self):
|
|
82
|
+
def is_active(self) -> bool:
|
|
93
83
|
return not self.deactivated_at
|
|
94
84
|
|
|
95
85
|
|
|
96
86
|
class Downloadable(Resource):
|
|
97
87
|
@classmethod
|
|
98
88
|
def download(
|
|
99
|
-
cls,
|
|
89
|
+
cls: Type[R_co],
|
|
100
90
|
id: str,
|
|
101
91
|
file_format: FileFormat = FileFormat.any,
|
|
102
92
|
*,
|
|
@@ -121,13 +111,13 @@ class Downloadable(Resource):
|
|
|
121
111
|
class Uploadable(Resource):
|
|
122
112
|
@classmethod
|
|
123
113
|
def _upload(
|
|
124
|
-
cls,
|
|
114
|
+
cls: Type[R_co],
|
|
125
115
|
file: bytes,
|
|
126
116
|
user_id: str,
|
|
127
117
|
*,
|
|
128
118
|
session: Session = global_session,
|
|
129
119
|
**data,
|
|
130
|
-
) ->
|
|
120
|
+
) -> R_co:
|
|
131
121
|
encoded_file = base64.b64encode(file)
|
|
132
122
|
resp = session.request(
|
|
133
123
|
'post',
|
|
@@ -138,7 +128,7 @@ class Uploadable(Resource):
|
|
|
138
128
|
**{k: (None, v) for k, v in data.items()},
|
|
139
129
|
),
|
|
140
130
|
)
|
|
141
|
-
return cls
|
|
131
|
+
return cls(**json.loads(resp))
|
|
142
132
|
|
|
143
133
|
|
|
144
134
|
class Queryable(Resource):
|
|
@@ -148,8 +138,8 @@ class Queryable(Resource):
|
|
|
148
138
|
|
|
149
139
|
@classmethod
|
|
150
140
|
def one(
|
|
151
|
-
cls, *, session: Session = global_session, **query_params
|
|
152
|
-
) ->
|
|
141
|
+
cls: Type[Q_co], *, session: Session = global_session, **query_params
|
|
142
|
+
) -> Q_co:
|
|
153
143
|
q = cls._query_params(limit=2, **query_params)
|
|
154
144
|
resp = session.get(cls._resource, q.dict())
|
|
155
145
|
items = resp['items']
|
|
@@ -158,12 +148,12 @@ class Queryable(Resource):
|
|
|
158
148
|
raise NoResultFound
|
|
159
149
|
if len_items > 1:
|
|
160
150
|
raise MultipleResultsFound
|
|
161
|
-
return cls
|
|
151
|
+
return cls(**items[0])
|
|
162
152
|
|
|
163
153
|
@classmethod
|
|
164
154
|
def first(
|
|
165
|
-
cls, *, session: Session = global_session, **query_params
|
|
166
|
-
) -> Optional[
|
|
155
|
+
cls: Type[Q_co], *, session: Session = global_session, **query_params
|
|
156
|
+
) -> Optional[Q_co]:
|
|
167
157
|
q = cls._query_params(limit=1, **query_params)
|
|
168
158
|
resp = session.get(cls._resource, q.dict())
|
|
169
159
|
try:
|
|
@@ -171,12 +161,12 @@ class Queryable(Resource):
|
|
|
171
161
|
except IndexError:
|
|
172
162
|
rv = None
|
|
173
163
|
else:
|
|
174
|
-
rv = cls
|
|
164
|
+
rv = cls(**item)
|
|
175
165
|
return rv
|
|
176
166
|
|
|
177
167
|
@classmethod
|
|
178
168
|
def count(
|
|
179
|
-
cls, *, session: Session = global_session, **query_params
|
|
169
|
+
cls: Type[Q_co], *, session: Session = global_session, **query_params
|
|
180
170
|
) -> int:
|
|
181
171
|
q = cls._query_params(count=True, **query_params)
|
|
182
172
|
resp = session.get(cls._resource, q.dict())
|
|
@@ -184,14 +174,14 @@ class Queryable(Resource):
|
|
|
184
174
|
|
|
185
175
|
@classmethod
|
|
186
176
|
def all(
|
|
187
|
-
cls, *, session: Session = global_session, **query_params
|
|
188
|
-
) -> Generator[
|
|
177
|
+
cls: Type[Q_co], *, session: Session = global_session, **query_params
|
|
178
|
+
) -> Generator[Q_co, None, None]:
|
|
189
179
|
session = session or global_session
|
|
190
180
|
q = cls._query_params(**query_params)
|
|
191
181
|
next_page_uri = f'{cls._resource}?{urlencode(q.dict())}'
|
|
192
182
|
while next_page_uri:
|
|
193
183
|
page = session.get(next_page_uri)
|
|
194
|
-
yield from (cls
|
|
184
|
+
yield from (cls(**item) for item in page['items'])
|
|
195
185
|
next_page_uri = page['next_page_uri']
|
|
196
186
|
|
|
197
187
|
|
|
@@ -42,9 +42,7 @@ class CardActivation(Creatable):
|
|
|
42
42
|
exp_year=exp_year,
|
|
43
43
|
cvv2=cvv2,
|
|
44
44
|
)
|
|
45
|
-
return
|
|
46
|
-
'CardActivation', cls._create(session=session, **req.dict())
|
|
47
|
-
)
|
|
45
|
+
return cls._create(session=session, **req.dict())
|
|
48
46
|
|
|
49
47
|
@property
|
|
50
48
|
def card(self) -> Optional[Card]:
|
cuenca/resources/cards.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import ClassVar, Optional
|
|
2
|
+
from typing import ClassVar, Optional
|
|
3
3
|
|
|
4
4
|
from cuenca_validations.types import (
|
|
5
5
|
CardFundingType,
|
|
@@ -81,7 +81,7 @@ class Card(Retrievable, Queryable, Creatable, Updateable):
|
|
|
81
81
|
card_holder_user_id=card_holder_user_id,
|
|
82
82
|
is_dynamic_cvv=is_dynamic_cvv,
|
|
83
83
|
)
|
|
84
|
-
return
|
|
84
|
+
return cls._create(session=session, **req.dict())
|
|
85
85
|
|
|
86
86
|
@classmethod
|
|
87
87
|
def update(
|
|
@@ -106,8 +106,7 @@ class Card(Retrievable, Queryable, Creatable, Updateable):
|
|
|
106
106
|
req = CardUpdateRequest(
|
|
107
107
|
status=status, pin_block=pin_block, is_dynamic_cvv=is_dynamic_cvv
|
|
108
108
|
)
|
|
109
|
-
|
|
110
|
-
return cast('Card', resp)
|
|
109
|
+
return cls._update(card_id, session=session, **req.dict())
|
|
111
110
|
|
|
112
111
|
@classmethod
|
|
113
112
|
def deactivate(
|
|
@@ -118,4 +117,4 @@ class Card(Retrievable, Queryable, Creatable, Updateable):
|
|
|
118
117
|
"""
|
|
119
118
|
url = f'{cls._resource}/{card_id}'
|
|
120
119
|
resp = session.delete(url)
|
|
121
|
-
return
|
|
120
|
+
return cls(**resp)
|
cuenca/resources/clabes.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import ClassVar
|
|
1
|
+
from typing import ClassVar
|
|
2
2
|
|
|
3
3
|
from ..http import Session, session as global_session
|
|
4
4
|
from .base import Creatable, Queryable, Retrievable
|
|
@@ -11,4 +11,4 @@ class Clabe(Creatable, Queryable, Retrievable):
|
|
|
11
11
|
|
|
12
12
|
@classmethod
|
|
13
13
|
def create(cls, session: Session = global_session):
|
|
14
|
-
return
|
|
14
|
+
return cls._create(session=session)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import ClassVar, Optional
|
|
2
|
+
from typing import ClassVar, Optional
|
|
3
3
|
|
|
4
4
|
from cuenca_validations.types import (
|
|
5
5
|
Country,
|
|
@@ -98,7 +98,4 @@ class CurpValidation(Creatable, Retrievable):
|
|
|
98
98
|
gender=gender,
|
|
99
99
|
manual_curp=manual_curp,
|
|
100
100
|
)
|
|
101
|
-
return
|
|
102
|
-
'CurpValidation',
|
|
103
|
-
cls._create(session=session, **req.dict()),
|
|
104
|
-
)
|
|
101
|
+
return cls._create(session=session, **req.dict())
|
cuenca/resources/endpoints.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import ClassVar, List, Optional
|
|
1
|
+
from typing import ClassVar, List, Optional
|
|
2
2
|
|
|
3
3
|
from cuenca_validations.types.enums import WebhookEvent
|
|
4
4
|
from cuenca_validations.types.requests import (
|
|
@@ -72,7 +72,7 @@ class Endpoint(Creatable, Deactivable, Retrievable, Queryable, Updateable):
|
|
|
72
72
|
:return: New active endpoint
|
|
73
73
|
"""
|
|
74
74
|
req = EndpointRequest(url=url, events=events)
|
|
75
|
-
return
|
|
75
|
+
return cls._create(session=session, **req.dict())
|
|
76
76
|
|
|
77
77
|
@classmethod
|
|
78
78
|
def update(
|
|
@@ -96,5 +96,4 @@ class Endpoint(Creatable, Deactivable, Retrievable, Queryable, Updateable):
|
|
|
96
96
|
req = EndpointUpdateRequest(
|
|
97
97
|
url=url, is_enable=is_enable, events=events
|
|
98
98
|
)
|
|
99
|
-
|
|
100
|
-
return cast('Endpoint', resp)
|
|
99
|
+
return cls._update(endpoint_id, session=session, **req.dict())
|
cuenca/resources/file_batches.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import ClassVar, Dict, List
|
|
1
|
+
from typing import ClassVar, Dict, List
|
|
2
2
|
|
|
3
3
|
from cuenca_validations.types import BatchFileMetadata, FileBatchUploadRequest
|
|
4
4
|
|
|
@@ -22,4 +22,4 @@ class FileBatch(Creatable, Queryable):
|
|
|
22
22
|
session: Session = global_session,
|
|
23
23
|
) -> 'FileBatch':
|
|
24
24
|
req = FileBatchUploadRequest(files=files, user_id=user_id)
|
|
25
|
-
return
|
|
25
|
+
return cls._create(session=session, **req.dict())
|
cuenca/resources/files.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from io import BytesIO
|
|
2
|
-
from typing import ClassVar, Optional
|
|
2
|
+
from typing import ClassVar, Optional
|
|
3
3
|
|
|
4
4
|
from cuenca_validations.types import FileQuery, FileUploadRequest, KYCFileType
|
|
5
5
|
from pydantic import HttpUrl
|
|
@@ -44,13 +44,7 @@ class File(Downloadable, Queryable, Uploadable):
|
|
|
44
44
|
is_back=is_back,
|
|
45
45
|
user_id=user_id,
|
|
46
46
|
)
|
|
47
|
-
return
|
|
48
|
-
'File',
|
|
49
|
-
cls._upload(
|
|
50
|
-
session=session,
|
|
51
|
-
**req.dict(),
|
|
52
|
-
),
|
|
53
|
-
)
|
|
47
|
+
return cls._upload(session=session, **req.dict())
|
|
54
48
|
|
|
55
49
|
@property
|
|
56
50
|
def file(self) -> bytes:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import ClassVar, List, Optional
|
|
1
|
+
from typing import ClassVar, List, Optional
|
|
2
2
|
|
|
3
3
|
from cuenca_validations.types import KYCFile, KYCValidationRequest
|
|
4
4
|
|
|
@@ -38,6 +38,4 @@ class KYCValidation(Creatable, Retrievable, Queryable):
|
|
|
38
38
|
force=force,
|
|
39
39
|
documents=documents,
|
|
40
40
|
)
|
|
41
|
-
return
|
|
42
|
-
'KYCValidation', cls._create(**req.dict(), session=session)
|
|
43
|
-
)
|
|
41
|
+
return cls._create(**req.dict(), session=session)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import ClassVar, Optional
|
|
2
|
+
from typing import ClassVar, Optional
|
|
3
3
|
|
|
4
4
|
from cuenca_validations.types import (
|
|
5
5
|
Address,
|
|
@@ -39,7 +39,7 @@ class KYCVerification(Creatable, Retrievable, Updateable):
|
|
|
39
39
|
|
|
40
40
|
@classmethod
|
|
41
41
|
def create(cls, session: Session = global_session) -> 'KYCVerification':
|
|
42
|
-
return
|
|
42
|
+
return cls._create(session=session)
|
|
43
43
|
|
|
44
44
|
@classmethod
|
|
45
45
|
def update(
|
|
@@ -48,4 +48,4 @@ class KYCVerification(Creatable, Retrievable, Updateable):
|
|
|
48
48
|
curp: Optional[CurpField] = None,
|
|
49
49
|
) -> 'KYCVerification':
|
|
50
50
|
req = KYCVerificationUpdateRequest(curp=curp)
|
|
51
|
-
return
|
|
51
|
+
return cls._update(id=kyc_id, **req.dict())
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import ClassVar, Optional
|
|
1
|
+
from typing import ClassVar, Optional
|
|
2
2
|
|
|
3
3
|
from clabe import Clabe
|
|
4
4
|
from cuenca_validations.types import (
|
|
@@ -37,4 +37,4 @@ class LimitedWallet(Wallet):
|
|
|
37
37
|
allowed_curp=allowed_curp,
|
|
38
38
|
allowed_rfc=allowed_rfc,
|
|
39
39
|
)
|
|
40
|
-
return
|
|
40
|
+
return cls._create(**request.dict())
|
cuenca/resources/login_tokens.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import ClassVar
|
|
1
|
+
from typing import ClassVar
|
|
2
2
|
|
|
3
3
|
from ..http import Session, session as global_session
|
|
4
4
|
from .base import Creatable
|
|
@@ -17,4 +17,4 @@ class LoginToken(Creatable):
|
|
|
17
17
|
Make sure to store this token in a safe place
|
|
18
18
|
:return: Token that you can use in cuenca.configure
|
|
19
19
|
"""
|
|
20
|
-
return
|
|
20
|
+
return cls._create(session=session)
|
cuenca/resources/platforms.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import ClassVar, Optional
|
|
2
|
+
from typing import ClassVar, Optional
|
|
3
3
|
|
|
4
4
|
from cuenca_validations.types import Country, PlatformRequest, State
|
|
5
5
|
|
|
@@ -76,4 +76,4 @@ class Platform(Creatable):
|
|
|
76
76
|
phone_number=phone_number,
|
|
77
77
|
email_address=email_address,
|
|
78
78
|
)
|
|
79
|
-
return
|
|
79
|
+
return cls._create(session=session, **req.dict())
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import ClassVar
|
|
2
|
+
from typing import ClassVar
|
|
3
3
|
|
|
4
4
|
from cuenca_validations.types import QuestionnairesRequest
|
|
5
5
|
|
|
@@ -38,6 +38,4 @@ class Questionnaires(Creatable, Retrievable):
|
|
|
38
38
|
token=token,
|
|
39
39
|
form_id=form_id,
|
|
40
40
|
)
|
|
41
|
-
return
|
|
42
|
-
'Questionnaires', cls._create(session=session, **req.dict())
|
|
43
|
-
)
|
|
41
|
+
return cls._create(session=session, **req.dict())
|
cuenca/resources/resources.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import re
|
|
2
2
|
from concurrent.futures import ThreadPoolExecutor
|
|
3
|
-
from typing import Dict, List
|
|
3
|
+
from typing import Dict, List
|
|
4
4
|
|
|
5
5
|
from .base import Retrievable
|
|
6
6
|
|
|
@@ -13,7 +13,7 @@ def retrieve_uri(uri: str) -> Retrievable:
|
|
|
13
13
|
if not m:
|
|
14
14
|
raise ValueError(f'uri is not a valid format: {uri}')
|
|
15
15
|
resource, id_ = m.groups()
|
|
16
|
-
return
|
|
16
|
+
return RESOURCES[resource].retrieve(id_)
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
def retrieve_uris(uris: List[str]) -> List[Retrievable]:
|
cuenca/resources/savings.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import ClassVar, Optional
|
|
2
|
+
from typing import ClassVar, Optional
|
|
3
3
|
|
|
4
4
|
from cuenca_validations.types import (
|
|
5
5
|
SavingCategory,
|
|
@@ -34,7 +34,7 @@ class Saving(Wallet, Updateable):
|
|
|
34
34
|
goal_amount=goal_amount,
|
|
35
35
|
goal_date=goal_date,
|
|
36
36
|
)
|
|
37
|
-
return
|
|
37
|
+
return cls._create(**request.dict())
|
|
38
38
|
|
|
39
39
|
@classmethod
|
|
40
40
|
def update(
|
|
@@ -51,4 +51,4 @@ class Saving(Wallet, Updateable):
|
|
|
51
51
|
goal_amount=goal_amount,
|
|
52
52
|
goal_date=goal_date,
|
|
53
53
|
)
|
|
54
|
-
return
|
|
54
|
+
return cls._update(id=saving_id, **request.dict())
|
cuenca/resources/sessions.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import ClassVar, Optional
|
|
2
|
+
from typing import ClassVar, Optional
|
|
3
3
|
|
|
4
4
|
from cuenca_validations.types import SessionRequest, SessionType
|
|
5
5
|
from pydantic import AnyUrl
|
|
@@ -50,4 +50,4 @@ class Session(Creatable, Retrievable, Queryable):
|
|
|
50
50
|
success_url=success_url,
|
|
51
51
|
failure_url=failure_url,
|
|
52
52
|
)
|
|
53
|
-
return
|
|
53
|
+
return cls._create(session=session, **req.dict())
|
cuenca/resources/transfers.py
CHANGED
|
@@ -69,7 +69,7 @@ class Transfer(Transaction, Creatable):
|
|
|
69
69
|
idempotency_key=idempotency_key,
|
|
70
70
|
user_id=user_id,
|
|
71
71
|
)
|
|
72
|
-
return
|
|
72
|
+
return cls._create(**req.dict())
|
|
73
73
|
|
|
74
74
|
@classmethod
|
|
75
75
|
def create_many(cls, requests: List[TransferRequest]) -> DictStrAny:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import ClassVar, Optional
|
|
2
|
+
from typing import ClassVar, Optional
|
|
3
3
|
|
|
4
4
|
from cuenca_validations.types.requests import (
|
|
5
5
|
UserCredentialRequest,
|
|
@@ -25,9 +25,7 @@ class UserCredential(Creatable, Updateable):
|
|
|
25
25
|
session: Session = global_session,
|
|
26
26
|
) -> 'UserCredential':
|
|
27
27
|
req = UserCredentialRequest(password=password, user_id=user_id)
|
|
28
|
-
return
|
|
29
|
-
'UserCredential', cls._create(**req.dict(), session=session)
|
|
30
|
-
)
|
|
28
|
+
return cls._create(**req.dict(), session=session)
|
|
31
29
|
|
|
32
30
|
@classmethod
|
|
33
31
|
def update(
|
|
@@ -42,7 +40,4 @@ class UserCredential(Creatable, Updateable):
|
|
|
42
40
|
is_active=is_active,
|
|
43
41
|
password=password,
|
|
44
42
|
)
|
|
45
|
-
return
|
|
46
|
-
'UserCredential',
|
|
47
|
-
cls._update(id=user_id, **req.dict(), session=session),
|
|
48
|
-
)
|
|
43
|
+
return cls._update(id=user_id, **req.dict(), session=session)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import ClassVar, Optional
|
|
2
|
+
from typing import ClassVar, Optional
|
|
3
3
|
|
|
4
4
|
from cuenca_validations.types import UserListsRequest, VerificationStatus
|
|
5
5
|
from cuenca_validations.types.identities import CurpField
|
|
@@ -36,7 +36,4 @@ class UserListsValidation(Creatable, Retrievable):
|
|
|
36
36
|
curp=curp,
|
|
37
37
|
account_number=account_number,
|
|
38
38
|
)
|
|
39
|
-
return
|
|
40
|
-
'UserListsValidation',
|
|
41
|
-
cls._create(session=session, **req.dict()),
|
|
42
|
-
)
|
|
39
|
+
return cls._create(session=session, **req.dict())
|
cuenca/resources/user_logins.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import ClassVar, Optional
|
|
2
|
+
from typing import ClassVar, Optional
|
|
3
3
|
|
|
4
4
|
from cuenca_validations.types.requests import UserLoginRequest
|
|
5
5
|
|
|
@@ -31,7 +31,7 @@ class UserLogin(Creatable):
|
|
|
31
31
|
session: Session = global_session,
|
|
32
32
|
) -> 'UserLogin':
|
|
33
33
|
req = UserLoginRequest(password=password, user_id=user_id)
|
|
34
|
-
login =
|
|
34
|
+
login = cls._create(session=session, **req.dict())
|
|
35
35
|
if login.success:
|
|
36
36
|
session.headers['X-Cuenca-LoginId'] = login.id
|
|
37
37
|
return login
|
cuenca/resources/users.py
CHANGED
|
@@ -59,7 +59,7 @@ class User(Creatable, Retrievable, Updateable, Queryable):
|
|
|
59
59
|
|
|
60
60
|
@property
|
|
61
61
|
def balance(self) -> int:
|
|
62
|
-
be =
|
|
62
|
+
be = BalanceEntry.first(user_id=self.id)
|
|
63
63
|
return be.rolling_balance if be else 0
|
|
64
64
|
|
|
65
65
|
class Config:
|
|
@@ -135,7 +135,7 @@ class User(Creatable, Retrievable, Updateable, Queryable):
|
|
|
135
135
|
status=status,
|
|
136
136
|
terms_of_service=terms_of_service,
|
|
137
137
|
)
|
|
138
|
-
return
|
|
138
|
+
return cls._create(session=session, **req.dict())
|
|
139
139
|
|
|
140
140
|
@classmethod
|
|
141
141
|
def update(
|
|
@@ -174,10 +174,7 @@ class User(Creatable, Retrievable, Updateable, Queryable):
|
|
|
174
174
|
curp_document=curp_document,
|
|
175
175
|
status=status,
|
|
176
176
|
)
|
|
177
|
-
return
|
|
178
|
-
'User',
|
|
179
|
-
cls._update(id=user_id, **request.dict(), session=session),
|
|
180
|
-
)
|
|
177
|
+
return cls._update(id=user_id, **request.dict(), session=session)
|
|
181
178
|
|
|
182
179
|
@property
|
|
183
180
|
def identity(self) -> Identity:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import ClassVar, Optional, Union
|
|
2
|
+
from typing import ClassVar, Optional, Union
|
|
3
3
|
|
|
4
4
|
from cuenca_validations.types import (
|
|
5
5
|
VerificationAttemptRequest,
|
|
@@ -44,7 +44,7 @@ class Verification(Creatable, Updateable):
|
|
|
44
44
|
req = VerificationRequest(
|
|
45
45
|
recipient=recipient, type=type, platform_id=platform_id
|
|
46
46
|
)
|
|
47
|
-
return
|
|
47
|
+
return cls._create(**req.dict(), session=session)
|
|
48
48
|
|
|
49
49
|
@classmethod
|
|
50
50
|
def verify(
|
|
@@ -54,7 +54,4 @@ class Verification(Creatable, Updateable):
|
|
|
54
54
|
session: Session = global_session,
|
|
55
55
|
) -> 'Verification':
|
|
56
56
|
req = VerificationAttemptRequest(code=code)
|
|
57
|
-
return
|
|
58
|
-
'Verification',
|
|
59
|
-
cls._update(id=id, **req.dict(), session=session),
|
|
60
|
-
)
|
|
57
|
+
return cls._update(id=id, **req.dict(), session=session)
|
cuenca/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cuenca
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.3.dev0
|
|
4
4
|
Summary: Cuenca API Client
|
|
5
5
|
Home-page: https://github.com/cuenca-mx/cuenca-python
|
|
6
6
|
Author: Cuenca
|
|
@@ -11,9 +11,9 @@ Classifier: Operating System :: OS Independent
|
|
|
11
11
|
Requires-Python: >=3.8
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
|
-
Requires-Dist: requests
|
|
15
|
-
Requires-Dist: cuenca-validations
|
|
16
|
-
Requires-Dist: dataclasses
|
|
14
|
+
Requires-Dist: requests<28,>=2.24
|
|
15
|
+
Requires-Dist: cuenca-validations<0.12.0,>=0.11.3
|
|
16
|
+
Requires-Dist: dataclasses>=0.7; python_version < "3.8"
|
|
17
17
|
|
|
18
18
|
# Cuenca – Python client library
|
|
19
19
|
|
|
@@ -1,51 +1,50 @@
|
|
|
1
|
-
cuenca/__init__.py,sha256=
|
|
1
|
+
cuenca/__init__.py,sha256=aUXUxZNqqVyukpUIKEkNxBcM3H5Xf7s0jYWugX5ClLI,1787
|
|
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=
|
|
5
|
+
cuenca/version.py,sha256=FW9sG478l3dxmQrNLjEAKb8ZQrow5NXjLYgbiCIAAMM,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=
|
|
8
|
+
cuenca/resources/__init__.py,sha256=9TYP93f7sIC5nYABiuycd4LLzZkgQrkWz-pJWRGJsKM,2986
|
|
9
9
|
cuenca/resources/accounts.py,sha256=5yfNxAHpxWFosoR4WrPrDGpBCRkaQk98V-w0wCPPXqU,345
|
|
10
|
-
cuenca/resources/api_keys.py,sha256=
|
|
11
|
-
cuenca/resources/arpc.py,sha256=
|
|
10
|
+
cuenca/resources/api_keys.py,sha256=98ye291Z9bt7J2lbTp64fxA9EsFz4XjqFLc3mRcTuCI,2471
|
|
11
|
+
cuenca/resources/arpc.py,sha256=pdpVkAOQKkhEX4UsbD90oOw1NJv6JrupjLjVpt4jHHs,1669
|
|
12
12
|
cuenca/resources/balance_entries.py,sha256=aw07ntL9D1AfsuBbcDk5xR9nQIIopQ_WHXd0KHBAges,1104
|
|
13
|
-
cuenca/resources/base.py,sha256=
|
|
13
|
+
cuenca/resources/base.py,sha256=prc3jQZCYEY6Dez5eoWRLsyqAqziPe7-sPNBZYhpPxY,5409
|
|
14
14
|
cuenca/resources/bill_payments.py,sha256=spZSVCkLoJTOJIvfYim3R1JEUCvCKdRqLmr98M9y8oo,529
|
|
15
|
-
cuenca/resources/card_activations.py,sha256=
|
|
15
|
+
cuenca/resources/card_activations.py,sha256=CxiXuVcXRZ6Hsd0alCNhC2OqrOdd1S2hqBe2ZQEQ9K0,1277
|
|
16
16
|
cuenca/resources/card_transactions.py,sha256=_7RvYXaHiGJyTfySIPV65vRAA1uWi7l_tE3fzKT5LSg,1083
|
|
17
17
|
cuenca/resources/card_validations.py,sha256=zfCMfbbftHEbBV62uqLz7EOPceVSWASBuGGQad1fheQ,1914
|
|
18
|
-
cuenca/resources/cards.py,sha256=
|
|
18
|
+
cuenca/resources/cards.py,sha256=9h8eWFVhDjiVSt0_cb7QPs69DlrGam7C0zNwlSAnoRA,3370
|
|
19
19
|
cuenca/resources/cash_references.py,sha256=ZVN4ed8pRV3u0BshE3OPJB76FMfLKWHm1rwnk2KvbLc,195
|
|
20
|
-
cuenca/resources/clabes.py,sha256=
|
|
20
|
+
cuenca/resources/clabes.py,sha256=mIWnOXLpUQMBRlhaoY5xv0vQXRnZz9basMD99RbUXuc,370
|
|
21
21
|
cuenca/resources/commissions.py,sha256=Fz5kHq7FPJl8Z0qiu5_z-Ws2jEPqGi1x2OOwXCCM-Yw,513
|
|
22
|
-
cuenca/resources/curp_validations.py,sha256=
|
|
22
|
+
cuenca/resources/curp_validations.py,sha256=MEOEg9Q-GFe0R0hs6Zr6pM3fGxe_S-UiypCLf9F1v2I,3712
|
|
23
23
|
cuenca/resources/deposits.py,sha256=sB92dodHQ7VVdF33WAGTXzXFqFsc7JAgkPw-B32bqJ0,559
|
|
24
|
-
cuenca/resources/endpoints.py,sha256=
|
|
25
|
-
cuenca/resources/file_batches.py,sha256=
|
|
26
|
-
cuenca/resources/files.py,sha256=
|
|
24
|
+
cuenca/resources/endpoints.py,sha256=JtMyAfjU7dE2n4eqpiekR0F3diFoESLqqbVb3K552tw,3205
|
|
25
|
+
cuenca/resources/file_batches.py,sha256=PPWkFElBClqLr4yhwjG02AcyVADQX8qjkKCo8JYzcv8,699
|
|
26
|
+
cuenca/resources/files.py,sha256=YgP-5Q2zwF4nwAAPxR2HZa3xgxnGAwd6QMXOrY9AXI4,1783
|
|
27
27
|
cuenca/resources/identities.py,sha256=dh4J6jikQ1_rtVuifuUnxWZBcAgrgARKV164qB5j_-s,1011
|
|
28
28
|
cuenca/resources/identity_events.py,sha256=K1G6IEGlw6n482nZhBo_CJNBdpKFCO6duMQr5y9k4x8,374
|
|
29
|
-
cuenca/resources/kyc_validations.py,sha256=
|
|
30
|
-
cuenca/resources/kyc_verifications.py,sha256=
|
|
31
|
-
cuenca/resources/limited_wallets.py,sha256=
|
|
32
|
-
cuenca/resources/login_tokens.py,sha256=
|
|
33
|
-
cuenca/resources/
|
|
34
|
-
cuenca/resources/
|
|
35
|
-
cuenca/resources/
|
|
36
|
-
cuenca/resources/
|
|
37
|
-
cuenca/resources/savings.py,sha256=1gF_HGSxbcDuzyqq1flmURfPevuLgQexaKBahY33xIc,1433
|
|
29
|
+
cuenca/resources/kyc_validations.py,sha256=EWbvTHuXee9YilnPGdIuRGXm5RTBxNDpx5qdOi5QHSo,1247
|
|
30
|
+
cuenca/resources/kyc_verifications.py,sha256=YECzqLfJPU8-yHRKManUUMB3UgIuErzRBakLYlllzMI,1504
|
|
31
|
+
cuenca/resources/limited_wallets.py,sha256=br6YxQaXR93FuHXm2Fi3--X2oOzt1FWxhjmlRkWk5us,1051
|
|
32
|
+
cuenca/resources/login_tokens.py,sha256=WnVLer9ajZeh04-omoFTmTyXMhBB8xrZlcOc2Dx5mdE,613
|
|
33
|
+
cuenca/resources/platforms.py,sha256=koalWdedx1BNmCkHNB46X_t0f25-Gp1tCbgRXcdqq9E,2719
|
|
34
|
+
cuenca/resources/questionnaires.py,sha256=CV-jVgxbGttA2HLorfq-b_nQ1TeiM9gA-uXl7-0ZA1w,983
|
|
35
|
+
cuenca/resources/resources.py,sha256=IUd_rsjlsn4grujxZ24PQs2Nhphcd4uIUZ2YDKlSbqA,681
|
|
36
|
+
cuenca/resources/savings.py,sha256=eyRpeVLDtz9zBCZzc2GqPDR6UKvmdgRn7rlcFIKqkfA,1395
|
|
38
37
|
cuenca/resources/service_providers.py,sha256=aOulwTAvCLyzojBlhO7EQaPtlM9YPRYAAUXLjuGZwAk,316
|
|
39
|
-
cuenca/resources/sessions.py,sha256=
|
|
38
|
+
cuenca/resources/sessions.py,sha256=nfc-LK-ynrweLHlUDMFcFIBZDY0caJOltYuYM4xtw8w,1541
|
|
40
39
|
cuenca/resources/statements.py,sha256=PqMvhoE9cvBneXjaS7w4JnTzYdDakkCkbdNYrd7b8LI,282
|
|
41
|
-
cuenca/resources/transfers.py,sha256=
|
|
42
|
-
cuenca/resources/user_credentials.py,sha256=
|
|
40
|
+
cuenca/resources/transfers.py,sha256=Nol4yqMM4a7FHYlMKH8bsiGqJowJMVlq7sBoMf4lzn8,3206
|
|
41
|
+
cuenca/resources/user_credentials.py,sha256=Vr6n-Ramlqd65hobs_6bet4J9mtAlVdSJTFZeOvykag,1153
|
|
43
42
|
cuenca/resources/user_events.py,sha256=UUIiM2VoHh8aUqMUdx3YuUwUvSSNkjfSd5ayiQ_javk,673
|
|
44
|
-
cuenca/resources/user_lists_validation.py,sha256=
|
|
45
|
-
cuenca/resources/user_logins.py,sha256=
|
|
46
|
-
cuenca/resources/users.py,sha256=
|
|
47
|
-
cuenca/resources/verifications.py,sha256=
|
|
48
|
-
cuenca/resources/wallet_transactions.py,sha256=
|
|
43
|
+
cuenca/resources/user_lists_validation.py,sha256=1MAl3nbSQyHeHRFWNhVryXg6PqVb6lwZ-LFTd3tGJso,1284
|
|
44
|
+
cuenca/resources/user_logins.py,sha256=ennHfHuEn-huuaSLdwtmvsRPs85XqbYb3muPCy5rG8w,1344
|
|
45
|
+
cuenca/resources/users.py,sha256=DHx40XSc9NrjYarhtBqJOklzneYqKchlohBVCFSlG5g,6351
|
|
46
|
+
cuenca/resources/verifications.py,sha256=f830qksMvU49E_H9dx-1StDs7_01uhbqkP28MB37n5A,1635
|
|
47
|
+
cuenca/resources/wallet_transactions.py,sha256=HFL-wHmZyCjiqWg61LbxnQhE7BQp1JHw7qv0Y9UOGgw,1001
|
|
49
48
|
cuenca/resources/webhooks.py,sha256=gF_88ewhK_koHQZhfTeShuAN5Cqv4LxJhqfSPIdiDkU,457
|
|
50
49
|
cuenca/resources/whatsapp_transfers.py,sha256=Dro2wECBWawZPD4A96eerFiDcUtO6N1jSfdFnYLKjfM,874
|
|
51
50
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -57,7 +56,7 @@ tests/http/conftest.py,sha256=TnVfv_s0eXC55HSJQotxIqV2Rl2WbgNt5Ow6z-ZOjZE,177
|
|
|
57
56
|
tests/http/test_client.py,sha256=y0dhBDG4ZKbIvN_TENFGT920mzxwI535imQ99UuqgC0,2594
|
|
58
57
|
tests/resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
59
58
|
tests/resources/test_accounts.py,sha256=q7dD3k9Qj4qnl9v3aXmYSw6ShkLKD2W9FViFU_6VFeY,313
|
|
60
|
-
tests/resources/test_api_keys.py,sha256=
|
|
59
|
+
tests/resources/test_api_keys.py,sha256=1ipbhYGoho_12MnM9UKr5zHNPUk7s_JCXowv5TkmKwo,2272
|
|
61
60
|
tests/resources/test_arpc.py,sha256=4lRd8fO5vf8rvoh1V8Rw9qjw__fdZCeIh4IEYlU0k5o,489
|
|
62
61
|
tests/resources/test_balance_entries.py,sha256=myoHpr3XSef_smUijS60EXW7YHcmr6m9b6B_BVW-JtY,643
|
|
63
62
|
tests/resources/test_bill_payments.py,sha256=TnvrTPtCPOvKPGC5G1zI0fng3HXyTdKegCOvoYDHc9s,340
|
|
@@ -79,7 +78,6 @@ tests/resources/test_kyc_validations.py,sha256=TEyS6encW-InRpcAR4nDCfmkqqnn8yMC9
|
|
|
79
78
|
tests/resources/test_kyc_verifications.py,sha256=Y-ZU61o18I_3NFqMN2w4WGZTzwsIhULAtESqIXiizUY,634
|
|
80
79
|
tests/resources/test_limited_wallets.py,sha256=c0zDDOip3lJk8chbcGr_nWCdkO9yuL_HbD1IikR5jH4,527
|
|
81
80
|
tests/resources/test_login_tokens.py,sha256=kn0gXFOanIXjgKjbeOzfNyKsGAUkc2iKnuVmzIRaMD8,572
|
|
82
|
-
tests/resources/test_otps.py,sha256=kr-NCK8V8EwI8iku06hEDW1y0BVSW-Q3FRfnn9u1-Jo,612
|
|
83
81
|
tests/resources/test_platforms.py,sha256=5b6-XC3uAz8GARFkFoanH62jxE1uJIMXcdpeUhmI8Kg,211
|
|
84
82
|
tests/resources/test_questionnaires.py,sha256=Sl8YHXgL42xiijUncycOUzGu5MtI3jEnhADS8Nol6N8,321
|
|
85
83
|
tests/resources/test_resources.py,sha256=rTcfjZOxujOJXjfqvOV6TPpYl8lae4bgbZj4jTAWm_o,170
|
|
@@ -97,8 +95,8 @@ tests/resources/test_verifications.py,sha256=yyL-bdryQU3MvqnmAgnnzGG9t7UTxWwPiVu
|
|
|
97
95
|
tests/resources/test_wallet_transactions.py,sha256=_L2hjPHT4FwwhxksUoaoVHwFFYOGWfF4ScCbk0kb7Hw,3945
|
|
98
96
|
tests/resources/test_webhooks.py,sha256=nYCqAnlNJcMJKRHhgoHOWTQnFLWQHHvFyY8GVCxGTD8,328
|
|
99
97
|
tests/resources/test_whatsapp_transfers.py,sha256=4Dmrsbytx7LRrLQo9M8TAL7cGKJufPStkp51UdRCnYU,1030
|
|
100
|
-
cuenca-1.0.
|
|
101
|
-
cuenca-1.0.
|
|
102
|
-
cuenca-1.0.
|
|
103
|
-
cuenca-1.0.
|
|
104
|
-
cuenca-1.0.
|
|
98
|
+
cuenca-1.0.3.dev0.dist-info/LICENSE,sha256=aWv5PmUiAcNENEAdghcVQSeU56pXJHWexJYgklK9XLg,1063
|
|
99
|
+
cuenca-1.0.3.dev0.dist-info/METADATA,sha256=BAvf3P0KvgdkG7YSrZbKtBPPOwswIzA9ULF8dsezVM8,4588
|
|
100
|
+
cuenca-1.0.3.dev0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
101
|
+
cuenca-1.0.3.dev0.dist-info/top_level.txt,sha256=5h3K7XJTmJniDloPq4sIJHni_xLw-Uoc6ZJ5mcw_lZY,13
|
|
102
|
+
cuenca-1.0.3.dev0.dist-info/RECORD,,
|
tests/resources/test_api_keys.py
CHANGED
|
@@ -84,7 +84,7 @@ def test_api_key_from_dict():
|
|
|
84
84
|
metadata=None,
|
|
85
85
|
user_id=None,
|
|
86
86
|
)
|
|
87
|
-
api_key = ApiKey
|
|
87
|
+
api_key = ApiKey(**api_keys_dict)
|
|
88
88
|
assert not hasattr(api_key, 'extra_field_1')
|
|
89
89
|
assert not hasattr(api_key, 'extra_field_2')
|
|
90
90
|
assert api_key.id is not None
|
cuenca/resources/otps.py
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
from typing import ClassVar, cast
|
|
2
|
-
|
|
3
|
-
from ..http import Session, session as global_session
|
|
4
|
-
from .base import Creatable
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class Otp(Creatable):
|
|
8
|
-
_resource: ClassVar = 'otps'
|
|
9
|
-
secret: str
|
|
10
|
-
|
|
11
|
-
class Config:
|
|
12
|
-
schema_extra = {
|
|
13
|
-
'example': {
|
|
14
|
-
'id': 'OTNEUInh69SuKXXmK95sROwQ',
|
|
15
|
-
'secret': 'somesecret',
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
@classmethod
|
|
20
|
-
def create(cls, session: Session = global_session) -> 'Otp':
|
|
21
|
-
"""
|
|
22
|
-
Use this method to create a OTP seed
|
|
23
|
-
"""
|
|
24
|
-
return cast('Otp', cls._create(session=session))
|
tests/resources/test_otps.py
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
|
|
3
|
-
from cuenca import LoginToken, Otp, UserLogin
|
|
4
|
-
from cuenca.http.client import Session
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@pytest.fixture(scope='function')
|
|
8
|
-
def session():
|
|
9
|
-
session = Session()
|
|
10
|
-
session.configure(
|
|
11
|
-
'api_key',
|
|
12
|
-
'api_secret',
|
|
13
|
-
sandbox=True,
|
|
14
|
-
)
|
|
15
|
-
return session
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
@pytest.mark.vcr
|
|
19
|
-
def test_otps(session):
|
|
20
|
-
UserLogin.create('111111', session=session)
|
|
21
|
-
login_token = LoginToken.create(session=session)
|
|
22
|
-
session.headers.pop(
|
|
23
|
-
'X-Cuenca-LoginId',
|
|
24
|
-
)
|
|
25
|
-
session.configure(login_token=login_token.id)
|
|
26
|
-
otp = Otp.create()
|
|
27
|
-
assert otp
|
|
28
|
-
assert type(otp.secret) == str
|
|
File without changes
|
|
File without changes
|