Skip to content

Commit 95b556f

Browse files
authored
Removes Connections, adds credit scores (#19)
* removed deprecated connections. Added credit_scores endpoint * fixed factors type in EntityCreditScoresType * updated version
1 parent cd3c37d commit 95b556f

File tree

6 files changed

+41
-77
lines changed

6 files changed

+41
-77
lines changed

README.md

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -419,22 +419,3 @@ report = method.reports.get('rpt_cj2mkA3hFyHT5')
419419
report_csv = method.reports.download('rpt_cj2mkA3hFyHT5')
420420
```
421421

422-
## Connections
423-
424-
### List Connections
425-
426-
```python
427-
connections = method.connections.list()
428-
```
429-
430-
### Retrieve Connection
431-
432-
```python
433-
connection = method.connections.get('cxn_iENwAPKnNqA5j')
434-
```
435-
436-
### Update Connection
437-
438-
```python
439-
connection = method.connections.update('cxn_iENwAPKnNqA5j', { 'status': 'syncing' })
440-
```

method/method.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from method.resources.RoutingNumber import RoutingNumberResource
1010
from method.resources.Webhook import WebhookResource
1111
from method.resources.HealthCheck import PingResponse, HealthCheckResource
12-
from method.resources.Connection import ConnectionResource
1312
from method.resources.Simulate import SimulateResource
1413

1514

@@ -24,7 +23,6 @@ class Method:
2423
routing_numbers: RoutingNumberResource
2524
webhooks: WebhookResource
2625
healthcheck: HealthCheckResource
27-
connections: ConnectionResource
2826
simulate: SimulateResource
2927

3028
def __init__(self, opts: ConfigurationOpts = None, **kwargs: ConfigurationOpts):
@@ -41,7 +39,6 @@ def __init__(self, opts: ConfigurationOpts = None, **kwargs: ConfigurationOpts):
4139
self.routing_numbers = RoutingNumberResource(config)
4240
self.webhooks = WebhookResource(config)
4341
self.healthcheck = HealthCheckResource(config)
44-
self.connections = ConnectionResource(config)
4542
self.simulate = SimulateResource(config)
4643

4744
def ping(self) -> PingResponse:

method/resources/Connection.py

Lines changed: 0 additions & 53 deletions
This file was deleted.

method/resources/Entity.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,21 @@
3131
]
3232

3333

34+
CreditScoreStatusesLiterals = Literal[
35+
'completed',
36+
'in_progress',
37+
'pending',
38+
'failed'
39+
]
40+
41+
42+
CreditReportBureausLiterals = Literal[
43+
'experian',
44+
'equifax',
45+
'transunion'
46+
]
47+
48+
3449
class EntityIndividual(TypedDict):
3550
first_name: Optional[str]
3651
last_name: Optional[str]
@@ -126,6 +141,25 @@ class EntityGetCreditScoreResponse(TypedDict):
126141
score: int
127142
updated_at: str
128143

144+
class EntityCreditScoresFactorsType(TypedDict):
145+
code: str
146+
description: str
147+
148+
class EntityCreditScoresType(TypedDict):
149+
score: int
150+
source: CreditReportBureausLiterals
151+
model: str
152+
factors: List[EntityCreditScoresFactorsType]
153+
created_at: str
154+
155+
class EntityCreditScoresResponse(TypedDict):
156+
id: str
157+
status: EntityStatusesLiterals
158+
credit_scores: Optional[List[EntityCreditScoresType]]
159+
error: Optional[ResourceError]
160+
created_at: str
161+
updated_at: str
162+
129163
class AnswerOpts(TypedDict):
130164
question_id: str
131165
answer_id: str
@@ -159,6 +193,12 @@ def create_auth_session(self, _id: str) -> EntityQuestionResponse:
159193

160194
def get_credit_score(self, _id: str) -> EntityQuestionResponse:
161195
return super(EntityResource, self)._get_with_sub_path('{_id}/credit_score'.format(_id=_id))
196+
197+
def get_credit_scores(self, _id: str, crs_id: str) -> EntityCreditScoresResponse:
198+
return super(EntityResource, self)._get_with_sub_path('{_id}/credit_scores/{crs_id}'.format(_id=_id, crs_id=crs_id))
199+
200+
def create_credit_scores(self, _id: str) -> EntityCreditScoresResponse:
201+
return super(EntityResource, self)._create_with_sub_path('{_id}/credit_scores'.format(_id=_id), {})
162202

163203
def update_auth_session(self, _id: str, opts: EntityUpdateAuthOpts) -> EntityUpdateAuthResponse:
164204
return super(EntityResource, self)._update_with_sub_path('{_id}/auth_session'.format(_id=_id), opts)

method/resources/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@
1111
from method.resources.Verification import Verification, VerificationResource
1212
from method.resources.Webhook import Webhook, WebhookResource
1313
from method.resources.HealthCheck import HealthCheckResource
14-
from method.resources.Connection import ConnectionResource
1514
from method.resources.Simulate import SimulatePaymentResource

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name='method-python',
5-
version='0.0.31',
5+
version='0.0.32',
66
description='Python library for the Method API',
77
long_description='Python library for the Method API',
88
long_description_content_type='text/x-rst',

0 commit comments

Comments
 (0)