incognia-python 3.2.0__tar.gz → 3.4.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.
Files changed (33) hide show
  1. {incognia_python-3.2.0 → incognia_python-3.4.0}/PKG-INFO +1 -1
  2. {incognia_python-3.2.0 → incognia_python-3.4.0}/incognia/api.py +9 -1
  3. {incognia_python-3.2.0 → incognia_python-3.4.0}/incognia/models.py +19 -1
  4. {incognia_python-3.2.0 → incognia_python-3.4.0}/incognia_python.egg-info/PKG-INFO +1 -1
  5. {incognia_python-3.2.0 → incognia_python-3.4.0}/tests/test_api.py +27 -3
  6. {incognia_python-3.2.0 → incognia_python-3.4.0}/.github/dependabot.yml +0 -0
  7. {incognia_python-3.2.0 → incognia_python-3.4.0}/.github/workflows/codeql.yaml +0 -0
  8. {incognia_python-3.2.0 → incognia_python-3.4.0}/.github/workflows/continuous.yaml +0 -0
  9. {incognia_python-3.2.0 → incognia_python-3.4.0}/.gitignore +0 -0
  10. {incognia_python-3.2.0 → incognia_python-3.4.0}/CODEOWNERS +0 -0
  11. {incognia_python-3.2.0 → incognia_python-3.4.0}/LICENSE.txt +0 -0
  12. {incognia_python-3.2.0 → incognia_python-3.4.0}/MANIFEST.in +0 -0
  13. {incognia_python-3.2.0 → incognia_python-3.4.0}/README.md +0 -0
  14. {incognia_python-3.2.0 → incognia_python-3.4.0}/incognia/__init__.py +0 -0
  15. {incognia_python-3.2.0 → incognia_python-3.4.0}/incognia/base_request.py +0 -0
  16. {incognia_python-3.2.0 → incognia_python-3.4.0}/incognia/datetime_util.py +0 -0
  17. {incognia_python-3.2.0 → incognia_python-3.4.0}/incognia/endpoints.py +0 -0
  18. {incognia_python-3.2.0 → incognia_python-3.4.0}/incognia/exceptions.py +0 -0
  19. {incognia_python-3.2.0 → incognia_python-3.4.0}/incognia/feedback_events.py +0 -0
  20. {incognia_python-3.2.0 → incognia_python-3.4.0}/incognia/json_util.py +0 -0
  21. {incognia_python-3.2.0 → incognia_python-3.4.0}/incognia/singleton.py +0 -0
  22. {incognia_python-3.2.0 → incognia_python-3.4.0}/incognia/token_manager.py +0 -0
  23. {incognia_python-3.2.0 → incognia_python-3.4.0}/incognia_python.egg-info/SOURCES.txt +0 -0
  24. {incognia_python-3.2.0 → incognia_python-3.4.0}/incognia_python.egg-info/dependency_links.txt +0 -0
  25. {incognia_python-3.2.0 → incognia_python-3.4.0}/incognia_python.egg-info/not-zip-safe +0 -0
  26. {incognia_python-3.2.0 → incognia_python-3.4.0}/incognia_python.egg-info/requires.txt +0 -0
  27. {incognia_python-3.2.0 → incognia_python-3.4.0}/incognia_python.egg-info/top_level.txt +0 -0
  28. {incognia_python-3.2.0 → incognia_python-3.4.0}/pyproject.toml +0 -0
  29. {incognia_python-3.2.0 → incognia_python-3.4.0}/requirements.txt +0 -0
  30. {incognia_python-3.2.0 → incognia_python-3.4.0}/setup.cfg +0 -0
  31. {incognia_python-3.2.0 → incognia_python-3.4.0}/tests/__init__.py +0 -0
  32. {incognia_python-3.2.0 → incognia_python-3.4.0}/tests/test_base_request.py +0 -0
  33. {incognia_python-3.2.0 → incognia_python-3.4.0}/tests/test_token_manager.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: incognia-python
3
- Version: 3.2.0
3
+ Version: 3.4.0
4
4
  Summary: Python lightweight client library for Incognia APIs
5
5
  Home-page: https://github.com/inloco/incognia-python
6
6
  Author: Incognia
@@ -14,6 +14,7 @@ from .models import (
14
14
  Location,
15
15
  Coupon,
16
16
  PersonID,
17
+ BankAccountInfo,
17
18
  )
18
19
  from .singleton import Singleton
19
20
  from .token_manager import TokenManager
@@ -149,7 +150,9 @@ class IncogniaAPI(metaclass=Singleton):
149
150
  device_os: Optional[str] = None,
150
151
  app_version: Optional[str] = None,
151
152
  store_id: Optional[str] = None,
152
- person_id: Optional[PersonID] = None) -> dict:
153
+ person_id: Optional[PersonID] = None,
154
+ debtor_account: Optional[BankAccountInfo] = None,
155
+ creditor_account: Optional[BankAccountInfo] = None) -> dict:
153
156
  if not request_token:
154
157
  raise IncogniaError('request_token is required.')
155
158
  if not account_id:
@@ -185,6 +188,8 @@ class IncogniaAPI(metaclass=Singleton):
185
188
  'app_version': app_version,
186
189
  'store_id': store_id,
187
190
  'person_id': person_id,
191
+ 'debtor_account': debtor_account,
192
+ 'creditor_account': creditor_account,
188
193
  }
189
194
  data = encode(body)
190
195
  return self.__request.post(Endpoints.TRANSACTIONS, headers=headers, params=params,
@@ -202,7 +207,9 @@ class IncogniaAPI(metaclass=Singleton):
202
207
  policy_id: Optional[str] = None,
203
208
  device_os: Optional[str] = None,
204
209
  app_version: Optional[str] = None,
210
+ custom_properties: Optional[dict] = None,
205
211
  person_id: Optional[PersonID] = None) -> dict:
212
+
206
213
  if not request_token:
207
214
  raise IncogniaError('request_token is required.')
208
215
  if not account_id:
@@ -231,6 +238,7 @@ class IncogniaAPI(metaclass=Singleton):
231
238
  'policy_id': policy_id,
232
239
  'device_os': device_os.lower() if device_os is not None else None,
233
240
  'app_version': app_version,
241
+ 'custom_properties': custom_properties,
234
242
  'person_id': person_id,
235
243
  }
236
244
  data = encode(body)
@@ -1,4 +1,4 @@
1
- from typing import TypedDict, Literal
1
+ from typing import TypedDict, Literal, List
2
2
 
3
3
 
4
4
  class Coordinates(TypedDict):
@@ -63,3 +63,21 @@ class Location(TypedDict, total=False):
63
63
  class PersonID(TypedDict, total=False):
64
64
  type: str
65
65
  value: str
66
+
67
+
68
+ class PixKey(TypedDict):
69
+ type: str
70
+ value: str
71
+
72
+
73
+ class BankAccountInfo(TypedDict, total=False):
74
+ account_type: str
75
+ account_purpose: str
76
+ holder_type: str
77
+ holder_tax_id: PersonID
78
+ country: str
79
+ ispb_code: str
80
+ branch_code: str
81
+ account_number: str
82
+ account_check_digit: str
83
+ pix_keys: List[PixKey]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: incognia-python
3
- Version: 3.2.0
3
+ Version: 3.4.0
4
4
  Summary: Python lightweight client library for Incognia APIs
5
5
  Home-page: https://github.com/inloco/incognia-python
6
6
  Author: Incognia
@@ -150,6 +150,24 @@ class TestIncogniaAPI(TestCase):
150
150
  'longitude': 13.123,
151
151
  'collected_at': "12:04 14/10/2024"
152
152
  }
153
+ BANK_ACCOUNT_INFO: Final[dict] = {
154
+ "account_type": "checking",
155
+ "account_purpose": "personal",
156
+ "holder_type": "individual",
157
+ "holder_tax_id": {
158
+ "type": "cpf",
159
+ "value": "12345678900",
160
+ },
161
+ "country": "BR",
162
+ "ispb_code": "12345678",
163
+ "branch_code": "0001",
164
+ "account_number": "987654",
165
+ "account_check_digit": "0",
166
+ "pix_keys": [
167
+ {"type": "email", "value": "user@example.com"},
168
+ {"type": "phone", "value": "+5511999999999"},
169
+ ],
170
+ }
153
171
  REGISTER_VALID_FEEDBACK_DATA: Final[bytes] = encode({
154
172
  'event': f'{VALID_EVENT_FEEDBACK_TYPE}'
155
173
  })
@@ -187,7 +205,9 @@ class TestIncogniaAPI(TestCase):
187
205
  'device_os': f'{DEVICE_OS.lower()}',
188
206
  'app_version': f'{APP_VERSION}',
189
207
  'store_id': f'{STORE_ID}',
190
- 'person_id': PERSON_ID
208
+ 'person_id': PERSON_ID,
209
+ 'debtor_account': BANK_ACCOUNT_INFO,
210
+ 'creditor_account': BANK_ACCOUNT_INFO
191
211
  })
192
212
  REGISTER_VALID_PAYMENT_DATA_WITH_LOCATION: Final[bytes] = encode({
193
213
  'type': 'payment',
@@ -223,7 +243,8 @@ class TestIncogniaAPI(TestCase):
223
243
  'policy_id': f'{POLICY_ID}',
224
244
  'device_os': f'{DEVICE_OS.lower()}',
225
245
  'app_version': f'{APP_VERSION}',
226
- 'person_id': PERSON_ID
246
+ 'custom_properties': CUSTOM_PROPERTIES,
247
+ 'person_id': PERSON_ID,
227
248
  })
228
249
  REGISTER_VALID_WEB_LOGIN_DATA: Final[bytes] = encode({
229
250
  'type': 'login',
@@ -506,7 +527,9 @@ class TestIncogniaAPI(TestCase):
506
527
  device_os=self.DEVICE_OS,
507
528
  app_version=self.APP_VERSION,
508
529
  store_id=self.STORE_ID,
509
- person_id=self.PERSON_ID
530
+ person_id=self.PERSON_ID,
531
+ debtor_account=self.BANK_ACCOUNT_INFO,
532
+ creditor_account=self.BANK_ACCOUNT_INFO
510
533
  )
511
534
 
512
535
  mock_token_manager_get.assert_called()
@@ -749,6 +772,7 @@ class TestIncogniaAPI(TestCase):
749
772
  policy_id=self.POLICY_ID,
750
773
  device_os=self.DEVICE_OS,
751
774
  app_version=self.APP_VERSION,
775
+ custom_properties=self.CUSTOM_PROPERTIES,
752
776
  person_id=self.PERSON_ID)
753
777
 
754
778
  mock_token_manager_get.assert_called()