incognia-python 3.4.0__tar.gz → 3.5.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.
- {incognia_python-3.4.0 → incognia_python-3.5.0}/PKG-INFO +1 -1
- {incognia_python-3.4.0 → incognia_python-3.5.0}/incognia/api.py +19 -3
- {incognia_python-3.4.0 → incognia_python-3.5.0}/incognia/models.py +2 -1
- {incognia_python-3.4.0 → incognia_python-3.5.0}/incognia_python.egg-info/PKG-INFO +1 -1
- {incognia_python-3.4.0 → incognia_python-3.5.0}/tests/test_api.py +34 -14
- {incognia_python-3.4.0 → incognia_python-3.5.0}/.github/dependabot.yml +0 -0
- {incognia_python-3.4.0 → incognia_python-3.5.0}/.github/workflows/codeql.yaml +0 -0
- {incognia_python-3.4.0 → incognia_python-3.5.0}/.github/workflows/continuous.yaml +0 -0
- {incognia_python-3.4.0 → incognia_python-3.5.0}/.gitignore +0 -0
- {incognia_python-3.4.0 → incognia_python-3.5.0}/CODEOWNERS +0 -0
- {incognia_python-3.4.0 → incognia_python-3.5.0}/LICENSE.txt +0 -0
- {incognia_python-3.4.0 → incognia_python-3.5.0}/MANIFEST.in +0 -0
- {incognia_python-3.4.0 → incognia_python-3.5.0}/README.md +0 -0
- {incognia_python-3.4.0 → incognia_python-3.5.0}/incognia/__init__.py +0 -0
- {incognia_python-3.4.0 → incognia_python-3.5.0}/incognia/base_request.py +0 -0
- {incognia_python-3.4.0 → incognia_python-3.5.0}/incognia/datetime_util.py +0 -0
- {incognia_python-3.4.0 → incognia_python-3.5.0}/incognia/endpoints.py +0 -0
- {incognia_python-3.4.0 → incognia_python-3.5.0}/incognia/exceptions.py +0 -0
- {incognia_python-3.4.0 → incognia_python-3.5.0}/incognia/feedback_events.py +0 -0
- {incognia_python-3.4.0 → incognia_python-3.5.0}/incognia/json_util.py +0 -0
- {incognia_python-3.4.0 → incognia_python-3.5.0}/incognia/singleton.py +0 -0
- {incognia_python-3.4.0 → incognia_python-3.5.0}/incognia/token_manager.py +0 -0
- {incognia_python-3.4.0 → incognia_python-3.5.0}/incognia_python.egg-info/SOURCES.txt +0 -0
- {incognia_python-3.4.0 → incognia_python-3.5.0}/incognia_python.egg-info/dependency_links.txt +0 -0
- {incognia_python-3.4.0 → incognia_python-3.5.0}/incognia_python.egg-info/not-zip-safe +0 -0
- {incognia_python-3.4.0 → incognia_python-3.5.0}/incognia_python.egg-info/requires.txt +0 -0
- {incognia_python-3.4.0 → incognia_python-3.5.0}/incognia_python.egg-info/top_level.txt +0 -0
- {incognia_python-3.4.0 → incognia_python-3.5.0}/pyproject.toml +0 -0
- {incognia_python-3.4.0 → incognia_python-3.5.0}/requirements.txt +0 -0
- {incognia_python-3.4.0 → incognia_python-3.5.0}/setup.cfg +0 -0
- {incognia_python-3.4.0 → incognia_python-3.5.0}/tests/__init__.py +0 -0
- {incognia_python-3.4.0 → incognia_python-3.5.0}/tests/test_base_request.py +0 -0
- {incognia_python-3.4.0 → incognia_python-3.5.0}/tests/test_token_manager.py +0 -0
|
@@ -32,6 +32,8 @@ class IncogniaAPI(metaclass=Singleton):
|
|
|
32
32
|
|
|
33
33
|
def register_new_signup(self,
|
|
34
34
|
request_token: Optional[str],
|
|
35
|
+
tenant_id: Optional[str] = None,
|
|
36
|
+
related_web_request_token: Optional[str] = None,
|
|
35
37
|
address_line: Optional[str] = None,
|
|
36
38
|
structured_address: Optional[StructuredAddress] = None,
|
|
37
39
|
address_coordinates: Optional[Coordinates] = None,
|
|
@@ -50,6 +52,8 @@ class IncogniaAPI(metaclass=Singleton):
|
|
|
50
52
|
headers.update(JSON_CONTENT_HEADER)
|
|
51
53
|
body = {
|
|
52
54
|
'request_token': request_token,
|
|
55
|
+
'tenant_id': tenant_id,
|
|
56
|
+
'related_web_request_token': related_web_request_token,
|
|
53
57
|
'address_line': address_line,
|
|
54
58
|
'structured_address': structured_address,
|
|
55
59
|
'address_coordinates': address_coordinates,
|
|
@@ -69,6 +73,7 @@ class IncogniaAPI(metaclass=Singleton):
|
|
|
69
73
|
|
|
70
74
|
def register_new_web_signup(self,
|
|
71
75
|
request_token: Optional[str],
|
|
76
|
+
tenant_id: Optional[str] = None,
|
|
72
77
|
policy_id: Optional[str] = None,
|
|
73
78
|
account_id: Optional[str] = None,
|
|
74
79
|
custom_properties: Optional[dict] = None,
|
|
@@ -81,6 +86,7 @@ class IncogniaAPI(metaclass=Singleton):
|
|
|
81
86
|
headers.update(JSON_CONTENT_HEADER)
|
|
82
87
|
body = {
|
|
83
88
|
'request_token': request_token,
|
|
89
|
+
'tenant_id': tenant_id,
|
|
84
90
|
'policy_id': policy_id,
|
|
85
91
|
'account_id': account_id,
|
|
86
92
|
'custom_properties': custom_properties,
|
|
@@ -152,7 +158,9 @@ class IncogniaAPI(metaclass=Singleton):
|
|
|
152
158
|
store_id: Optional[str] = None,
|
|
153
159
|
person_id: Optional[PersonID] = None,
|
|
154
160
|
debtor_account: Optional[BankAccountInfo] = None,
|
|
155
|
-
creditor_account: Optional[BankAccountInfo] = None
|
|
161
|
+
creditor_account: Optional[BankAccountInfo] = None,
|
|
162
|
+
tenant_id: Optional[str] = None,
|
|
163
|
+
related_web_request_token: Optional[str] = None) -> dict:
|
|
156
164
|
if not request_token:
|
|
157
165
|
raise IncogniaError('request_token is required.')
|
|
158
166
|
if not account_id:
|
|
@@ -190,6 +198,8 @@ class IncogniaAPI(metaclass=Singleton):
|
|
|
190
198
|
'person_id': person_id,
|
|
191
199
|
'debtor_account': debtor_account,
|
|
192
200
|
'creditor_account': creditor_account,
|
|
201
|
+
'tenant_id': tenant_id,
|
|
202
|
+
'related_web_request_token': related_web_request_token,
|
|
193
203
|
}
|
|
194
204
|
data = encode(body)
|
|
195
205
|
return self.__request.post(Endpoints.TRANSACTIONS, headers=headers, params=params,
|
|
@@ -208,7 +218,9 @@ class IncogniaAPI(metaclass=Singleton):
|
|
|
208
218
|
device_os: Optional[str] = None,
|
|
209
219
|
app_version: Optional[str] = None,
|
|
210
220
|
custom_properties: Optional[dict] = None,
|
|
211
|
-
person_id: Optional[PersonID] = None
|
|
221
|
+
person_id: Optional[PersonID] = None,
|
|
222
|
+
tenant_id: Optional[str] = None,
|
|
223
|
+
related_web_request_token: Optional[str] = None) -> dict:
|
|
212
224
|
|
|
213
225
|
if not request_token:
|
|
214
226
|
raise IncogniaError('request_token is required.')
|
|
@@ -240,6 +252,8 @@ class IncogniaAPI(metaclass=Singleton):
|
|
|
240
252
|
'app_version': app_version,
|
|
241
253
|
'custom_properties': custom_properties,
|
|
242
254
|
'person_id': person_id,
|
|
255
|
+
'tenant_id': tenant_id,
|
|
256
|
+
'related_web_request_token': related_web_request_token,
|
|
243
257
|
}
|
|
244
258
|
data = encode(body)
|
|
245
259
|
return self.__request.post(Endpoints.TRANSACTIONS, headers=headers, params=params,
|
|
@@ -255,7 +269,8 @@ class IncogniaAPI(metaclass=Singleton):
|
|
|
255
269
|
evaluate: Optional[bool] = None,
|
|
256
270
|
policy_id: Optional[str] = None,
|
|
257
271
|
custom_properties: Optional[dict] = None,
|
|
258
|
-
person_id: Optional[PersonID] = None
|
|
272
|
+
person_id: Optional[PersonID] = None,
|
|
273
|
+
tenant_id: Optional[str] = None) -> dict:
|
|
259
274
|
if not request_token:
|
|
260
275
|
raise IncogniaError('request_token is required.')
|
|
261
276
|
if not account_id:
|
|
@@ -273,6 +288,7 @@ class IncogniaAPI(metaclass=Singleton):
|
|
|
273
288
|
'policy_id': policy_id,
|
|
274
289
|
'custom_properties': custom_properties,
|
|
275
290
|
'person_id': person_id,
|
|
291
|
+
'tenant_id': tenant_id,
|
|
276
292
|
}
|
|
277
293
|
data = encode(body)
|
|
278
294
|
return self.__request.post(Endpoints.TRANSACTIONS, headers=headers, params=params,
|
|
@@ -49,7 +49,8 @@ class CardInfo(TypedDict, total=False):
|
|
|
49
49
|
class PaymentMethod(TypedDict, total=False):
|
|
50
50
|
type: Literal['account_balance', 'apple_pay', 'bancolombia',
|
|
51
51
|
'boleto_bancario', 'cash', 'credit_card', 'debit_card',
|
|
52
|
-
'google_pay', 'meal_voucher', 'nu_pay', 'paypal', 'pix'
|
|
52
|
+
'google_pay', 'meal_voucher', 'nu_pay', 'paypal', 'pix',
|
|
53
|
+
'credit_card_pos']
|
|
53
54
|
credit_card_info: CardInfo
|
|
54
55
|
debit_card_info: CardInfo
|
|
55
56
|
|
|
@@ -22,6 +22,8 @@ class TestIncogniaAPI(TestCase):
|
|
|
22
22
|
ADDRESS_LINE: Final[str] = 'ANY_ADDRESS_LINE'
|
|
23
23
|
DEVICE_OS: Final[str] = 'ANY_DEVICE_OS'
|
|
24
24
|
APP_VERSION: Final[str] = 'ANY_APP_VERSION'
|
|
25
|
+
TENANT_ID: Final[str] = 'TENANT_ID'
|
|
26
|
+
RELATED_WEB_REQUEST_TOKEN: Final[str] = 'RELATED_WEB_REQUEST_TOKEN'
|
|
25
27
|
PERSON_ID: Final[dict] = {
|
|
26
28
|
'type': 'cpf',
|
|
27
29
|
'value': '12345678901'
|
|
@@ -72,6 +74,8 @@ class TestIncogniaAPI(TestCase):
|
|
|
72
74
|
}
|
|
73
75
|
FULL_REGISTER_SIGNUP_DATA: Final[bytes] = encode({
|
|
74
76
|
'request_token': f'{REQUEST_TOKEN}',
|
|
77
|
+
'tenant_id': TENANT_ID,
|
|
78
|
+
'related_web_request_token': RELATED_WEB_REQUEST_TOKEN,
|
|
75
79
|
'address_line': f'{ADDRESS_LINE}',
|
|
76
80
|
'structured_address': STRUCTURED_ADDRESS,
|
|
77
81
|
'address_coordinates': ADDRESS_COORDINATES,
|
|
@@ -91,6 +95,7 @@ class TestIncogniaAPI(TestCase):
|
|
|
91
95
|
})
|
|
92
96
|
FULL_REGISTER_WEB_SIGNUP_DATA: Final[bytes] = encode({
|
|
93
97
|
'request_token': f'{REQUEST_TOKEN}',
|
|
98
|
+
'tenant_id': TENANT_ID,
|
|
94
99
|
'policy_id': f'{POLICY_ID}',
|
|
95
100
|
'account_id': f'{ACCOUNT_ID}',
|
|
96
101
|
'custom_properties': CUSTOM_PROPERTIES,
|
|
@@ -207,7 +212,9 @@ class TestIncogniaAPI(TestCase):
|
|
|
207
212
|
'store_id': f'{STORE_ID}',
|
|
208
213
|
'person_id': PERSON_ID,
|
|
209
214
|
'debtor_account': BANK_ACCOUNT_INFO,
|
|
210
|
-
'creditor_account': BANK_ACCOUNT_INFO
|
|
215
|
+
'creditor_account': BANK_ACCOUNT_INFO,
|
|
216
|
+
'tenant_id': TENANT_ID,
|
|
217
|
+
'related_web_request_token': RELATED_WEB_REQUEST_TOKEN
|
|
211
218
|
})
|
|
212
219
|
REGISTER_VALID_PAYMENT_DATA_WITH_LOCATION: Final[bytes] = encode({
|
|
213
220
|
'type': 'payment',
|
|
@@ -245,6 +252,8 @@ class TestIncogniaAPI(TestCase):
|
|
|
245
252
|
'app_version': f'{APP_VERSION}',
|
|
246
253
|
'custom_properties': CUSTOM_PROPERTIES,
|
|
247
254
|
'person_id': PERSON_ID,
|
|
255
|
+
'tenant_id': TENANT_ID,
|
|
256
|
+
'related_web_request_token': RELATED_WEB_REQUEST_TOKEN
|
|
248
257
|
})
|
|
249
258
|
REGISTER_VALID_WEB_LOGIN_DATA: Final[bytes] = encode({
|
|
250
259
|
'type': 'login',
|
|
@@ -259,7 +268,8 @@ class TestIncogniaAPI(TestCase):
|
|
|
259
268
|
'external_id': f'{EXTERNAL_ID}',
|
|
260
269
|
'policy_id': f'{POLICY_ID}',
|
|
261
270
|
'custom_properties': CUSTOM_PROPERTIES,
|
|
262
|
-
'person_id': PERSON_ID
|
|
271
|
+
'person_id': PERSON_ID,
|
|
272
|
+
'tenant_id': TENANT_ID,
|
|
263
273
|
})
|
|
264
274
|
REGISTER_INVALID_LOGIN_DATA: Final[bytes] = encode({
|
|
265
275
|
'type': 'login',
|
|
@@ -328,6 +338,8 @@ class TestIncogniaAPI(TestCase):
|
|
|
328
338
|
device_os=self.DEVICE_OS,
|
|
329
339
|
app_version=self.APP_VERSION,
|
|
330
340
|
person_id=self.PERSON_ID,
|
|
341
|
+
tenant_id=self.TENANT_ID,
|
|
342
|
+
related_web_request_token=self.RELATED_WEB_REQUEST_TOKEN,
|
|
331
343
|
custom_properties=self.CUSTOM_PROPERTIES)
|
|
332
344
|
|
|
333
345
|
mock_token_manager_get.assert_called()
|
|
@@ -348,7 +360,8 @@ class TestIncogniaAPI(TestCase):
|
|
|
348
360
|
policy_id=self.POLICY_ID,
|
|
349
361
|
account_id=self.ACCOUNT_ID,
|
|
350
362
|
custom_properties=self.CUSTOM_PROPERTIES,
|
|
351
|
-
person_id=self.PERSON_ID
|
|
363
|
+
person_id=self.PERSON_ID,
|
|
364
|
+
tenant_id=self.TENANT_ID)
|
|
352
365
|
|
|
353
366
|
mock_token_manager_get.assert_called()
|
|
354
367
|
mock_base_request_post.assert_called_with(Endpoints.SIGNUPS,
|
|
@@ -529,7 +542,9 @@ class TestIncogniaAPI(TestCase):
|
|
|
529
542
|
store_id=self.STORE_ID,
|
|
530
543
|
person_id=self.PERSON_ID,
|
|
531
544
|
debtor_account=self.BANK_ACCOUNT_INFO,
|
|
532
|
-
creditor_account=self.BANK_ACCOUNT_INFO
|
|
545
|
+
creditor_account=self.BANK_ACCOUNT_INFO,
|
|
546
|
+
tenant_id=self.TENANT_ID,
|
|
547
|
+
related_web_request_token=self.RELATED_WEB_REQUEST_TOKEN,
|
|
533
548
|
)
|
|
534
549
|
|
|
535
550
|
mock_token_manager_get.assert_called()
|
|
@@ -681,7 +696,8 @@ class TestIncogniaAPI(TestCase):
|
|
|
681
696
|
external_id=self.EXTERNAL_ID,
|
|
682
697
|
policy_id=self.POLICY_ID,
|
|
683
698
|
custom_properties=self.CUSTOM_PROPERTIES,
|
|
684
|
-
person_id=self.PERSON_ID
|
|
699
|
+
person_id=self.PERSON_ID,
|
|
700
|
+
tenant_id=self.TENANT_ID,)
|
|
685
701
|
mock_token_manager_get.assert_called()
|
|
686
702
|
mock_base_request_post.assert_called_with(Endpoints.TRANSACTIONS,
|
|
687
703
|
headers=self.AUTH_AND_JSON_CONTENT_HEADERS,
|
|
@@ -765,15 +781,19 @@ class TestIncogniaAPI(TestCase):
|
|
|
765
781
|
|
|
766
782
|
api = IncogniaAPI(self.CLIENT_ID, self.CLIENT_SECRET)
|
|
767
783
|
|
|
768
|
-
request_response = api.register_login(
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
784
|
+
request_response = api.register_login(
|
|
785
|
+
self.REQUEST_TOKEN,
|
|
786
|
+
self.ACCOUNT_ID,
|
|
787
|
+
location=self.LOCATION,
|
|
788
|
+
external_id=self.EXTERNAL_ID,
|
|
789
|
+
policy_id=self.POLICY_ID,
|
|
790
|
+
device_os=self.DEVICE_OS,
|
|
791
|
+
app_version=self.APP_VERSION,
|
|
792
|
+
custom_properties=self.CUSTOM_PROPERTIES,
|
|
793
|
+
person_id=self.PERSON_ID,
|
|
794
|
+
tenant_id=self.TENANT_ID,
|
|
795
|
+
related_web_request_token=self.RELATED_WEB_REQUEST_TOKEN,
|
|
796
|
+
)
|
|
777
797
|
|
|
778
798
|
mock_token_manager_get.assert_called()
|
|
779
799
|
mock_base_request_post.assert_called_with(Endpoints.TRANSACTIONS,
|
|
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
|
{incognia_python-3.4.0 → incognia_python-3.5.0}/incognia_python.egg-info/dependency_links.txt
RENAMED
|
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
|