Skip to content

Commit 28027dd

Browse files
authored
Feat/v1 (#36)
* removes duplicate method * rebase * changed all gets to retrieve * adds Balances to Account * added the rest of the products for entities and accounts, general file structure clean up * nit fix * nit fix * bumped version to 1.0.0 * updating to match node SDK * started adding tests, fixed circular deps * added more account tests, updated simulate transactions, updated requirements to include testing modules, added testing utils * started Entity tests, fixed typings, finished Account tests * added verification session and connect tests for entity * updated credit score methods, added more entity tests * finished python tests, fixed element to use correct structure * updated README with v2 endpoints * fixed quotes in README * nit new line at end of file * nit spacing fixes * removed const and awaits from README * fixed Entity type to include new changes * updated tests with new structures, increased retries
1 parent 4e23be8 commit 28027dd

61 files changed

Lines changed: 4712 additions & 1500 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 813 additions & 221 deletions
Large diffs are not rendered by default.

conftest.py

Whitespace-only changes.

method/method.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,39 @@
11
from method.configuration import Configuration, ConfigurationOpts
2-
from method.resources.Account import AccountResource
3-
from method.resources.Bin import BinResource
4-
from method.resources.Entity import EntityResource
5-
from method.resources.Element import ElementResource
2+
from method.resources.Accounts import AccountResource
3+
from method.resources.Entities import EntityResource
4+
from method.resources.Elements import ElementResource
65
from method.resources.Merchant import MerchantResource
7-
from method.resources.Payment import PaymentResource
6+
from method.resources.Payments import PaymentResource
87
from method.resources.Report import ReportResource
9-
from method.resources.RoutingNumber import RoutingNumberResource
108
from method.resources.Webhook import WebhookResource
119
from method.resources.HealthCheck import PingResponse, HealthCheckResource
1210
from method.resources.Simulate import SimulateResource
13-
from method.resources.Transaction import TransactionResource
1411

1512

1613
class Method:
1714
accounts: AccountResource
18-
bins: BinResource
1915
entities: EntityResource
2016
elements: ElementResource
2117
merchants: MerchantResource
2218
payments: PaymentResource
2319
reports: ReportResource
24-
routing_numbers: RoutingNumberResource
2520
webhooks: WebhookResource
2621
healthcheck: HealthCheckResource
2722
simulate: SimulateResource
28-
transaction: TransactionResource
2923

3024
def __init__(self, opts: ConfigurationOpts = None, **kwargs: ConfigurationOpts):
3125
_opts: ConfigurationOpts = {**(opts or {}), **kwargs} # type: ignore
3226
config = Configuration(_opts)
3327

3428
self.accounts = AccountResource(config)
35-
self.bins = BinResource(config)
3629
self.entities = EntityResource(config)
3730
self.elements = ElementResource(config)
3831
self.merchants = MerchantResource(config)
3932
self.payments = PaymentResource(config)
4033
self.reports = ReportResource(config)
41-
self.routing_numbers = RoutingNumberResource(config)
4234
self.webhooks = WebhookResource(config)
4335
self.healthcheck = HealthCheckResource(config)
4436
self.simulate = SimulateResource(config)
45-
self.transaction = TransactionResource(config)
4637

4738
def ping(self) -> PingResponse:
48-
return self.healthcheck.get()
39+
return self.healthcheck.retrieve()

method/resource.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,31 @@
11
from importlib.metadata import version
22
import json
3-
from typing import Optional, List, Dict, Any, TypedDict
3+
from typing import Optional, List, Dict, Any, TypedDict, Literal
44
from hammock import Hammock as Client # type: ignore
55
from method.configuration import Configuration
66
from method.errors import MethodError
77

88

9+
ResourceStatusLiterals = Literal[
10+
'completed',
11+
'in_progress',
12+
'pending',
13+
'failed'
14+
]
15+
16+
917
class RequestOpts(TypedDict):
1018
idempotency_key: Optional[str]
1119

1220

21+
class ResourceListOpts(TypedDict):
22+
from_date: Optional[str]
23+
to_date: Optional[str]
24+
page: Optional[int | str]
25+
page_limit: Optional[int | str]
26+
page_cursor: Optional[int | str]
27+
28+
1329
class Resource:
1430
config: Configuration
1531
client: Client
@@ -20,6 +36,7 @@ def __init__(self, config: Configuration):
2036
'Authorization': 'Bearer {token}'.format(token=config.api_key),
2137
'Content-Type': 'application/json',
2238
'User-Agent': 'Method-Python/v{version}'.format(version=version('method-python')),
39+
'method-version': '2024-04-04'
2340
})
2441

2542
@MethodError.catch

0 commit comments

Comments
 (0)