Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
1d914fc
removes duplicate method
ossiggy Apr 5, 2024
437b307
Merge branch 'MethodFi:master' into master
ossiggy Apr 5, 2024
80ba013
rebase
ossiggy Apr 8, 2024
4592b51
changed all gets to retrieve
ossiggy Apr 8, 2024
5e712c7
adds Balances to Account
ossiggy Apr 9, 2024
12c0d82
Merge pull request #35 from ossiggy/v1-updates
ossiggy Apr 24, 2024
1ea4b76
added the rest of the products for entities and accounts, general fil…
ossiggy Apr 24, 2024
c479cb6
nit fix
ossiggy Apr 24, 2024
ac704a5
nit fix
ossiggy Apr 24, 2024
3a8f36b
bumped version to 1.0.0
ossiggy Apr 24, 2024
0d142d7
updating to match node SDK
ossiggy May 20, 2024
4c5e787
started adding tests, fixed circular deps
ossiggy May 29, 2024
e8826b2
added more account tests, updated simulate transactions, updated requ…
ossiggy May 30, 2024
83d95b2
started Entity tests, fixed typings, finished Account tests
ossiggy May 31, 2024
2faf395
added verification session and connect tests for entity
ossiggy May 31, 2024
3fbd852
updated credit score methods, added more entity tests
ossiggy May 31, 2024
7c4eb67
finished python tests, fixed element to use correct structure
ossiggy Jun 3, 2024
433cc92
updated README with v2 endpoints
ossiggy Jun 3, 2024
852cb67
fixed quotes in README
ossiggy Jun 3, 2024
4c8b552
nit new line at end of file
ossiggy Jun 3, 2024
41aaf7b
nit spacing fixes
ossiggy Jun 4, 2024
6857ecc
removed const and awaits from README
ossiggy Jun 5, 2024
d650c31
fixed Entity type to include new changes
ossiggy Jun 5, 2024
2fabec1
updated tests with new structures, increased retries
ossiggy Jun 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,034 changes: 813 additions & 221 deletions README.md

Large diffs are not rendered by default.

Empty file added conftest.py
Empty file.
19 changes: 5 additions & 14 deletions method/method.py
Original file line number Diff line number Diff line change
@@ -1,48 +1,39 @@
from method.configuration import Configuration, ConfigurationOpts
from method.resources.Account import AccountResource
from method.resources.Bin import BinResource
from method.resources.Entity import EntityResource
from method.resources.Element import ElementResource
from method.resources.Accounts import AccountResource
from method.resources.Entities import EntityResource
from method.resources.Elements import ElementResource
from method.resources.Merchant import MerchantResource
from method.resources.Payment import PaymentResource
from method.resources.Payments import PaymentResource
from method.resources.Report import ReportResource
from method.resources.RoutingNumber import RoutingNumberResource
from method.resources.Webhook import WebhookResource
from method.resources.HealthCheck import PingResponse, HealthCheckResource
from method.resources.Simulate import SimulateResource
from method.resources.Transaction import TransactionResource


class Method:
accounts: AccountResource
bins: BinResource
entities: EntityResource
elements: ElementResource
merchants: MerchantResource
payments: PaymentResource
reports: ReportResource
routing_numbers: RoutingNumberResource
webhooks: WebhookResource
healthcheck: HealthCheckResource
simulate: SimulateResource
transaction: TransactionResource

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

self.accounts = AccountResource(config)
self.bins = BinResource(config)
self.entities = EntityResource(config)
self.elements = ElementResource(config)
self.merchants = MerchantResource(config)
self.payments = PaymentResource(config)
self.reports = ReportResource(config)
self.routing_numbers = RoutingNumberResource(config)
self.webhooks = WebhookResource(config)
self.healthcheck = HealthCheckResource(config)
self.simulate = SimulateResource(config)
self.transaction = TransactionResource(config)

def ping(self) -> PingResponse:
return self.healthcheck.get()
return self.healthcheck.retrieve()
19 changes: 18 additions & 1 deletion method/resource.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
from importlib.metadata import version
import json
from typing import Optional, List, Dict, Any, TypedDict
from typing import Optional, List, Dict, Any, TypedDict, Literal
from hammock import Hammock as Client # type: ignore
from method.configuration import Configuration
from method.errors import MethodError


ResourceStatusLiterals = Literal[
'completed',
'in_progress',
'pending',
'failed'
]


class RequestOpts(TypedDict):
idempotency_key: Optional[str]


class ResourceListOpts(TypedDict):
from_date: Optional[str]
to_date: Optional[str]
page: Optional[int | str]
page_limit: Optional[int | str]
page_cursor: Optional[int | str]


class Resource:
config: Configuration
client: Client
Expand All @@ -20,6 +36,7 @@ def __init__(self, config: Configuration):
'Authorization': 'Bearer {token}'.format(token=config.api_key),
'Content-Type': 'application/json',
'User-Agent': 'Method-Python/v{version}'.format(version=version('method-python')),
'method-version': '2024-04-04'
})

@MethodError.catch
Expand Down
Loading