Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions method/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,10 @@ class MethodInvalidRequestError(MethodError):

class MethodAuthorizationError(MethodError):
pass


class ResourceError(TypedDict):
type: str
sub_type: str
message: str
code: str
2 changes: 2 additions & 0 deletions method/resources/Account.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from method.resource import Resource, RequestOpts
from method.configuration import Configuration
from method.errors import ResourceError
from method.resources.Verification import VerificationResource


Expand Down Expand Up @@ -60,6 +61,7 @@ class Account(TypedDict):
liability: Optional[AccountLiability]
clearing: Optional[AccountClearing]
capabilities: List[AccountCapabilitiesLiterals]
error: Optional[ResourceError]
created_at: str
updated_at: str
metadata: Optional[Dict[str, Any]]
Expand Down
2 changes: 2 additions & 0 deletions method/resources/Entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from method.resource import Resource, RequestOpts
from method.configuration import Configuration
from method.errors import ResourceError


EntityTypesLiterals = Literal[
Expand Down Expand Up @@ -76,6 +77,7 @@ class Entity(TypedDict):
capabilities: List[EntityCapabilitiesLiterals]
address: EntityAddress
status: EntityStatusesLiterals
error: Optional[ResourceError]
metadata: Optional[Dict[str, Any]]
created_at: str
updated_at: str
Expand Down
6 changes: 4 additions & 2 deletions method/resources/Payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from method.resource import Resource, RequestOpts
from method.configuration import Configuration
from method.errors import ResourceError


PaymentStatusesLiterals = Literal[
Expand All @@ -18,7 +19,8 @@
'hold',
'pending',
'requested',
'received',
'clearing',
'failed',
'sent',
'unknown'
]
Expand All @@ -37,7 +39,7 @@ class Payment(TypedDict):
description: str
status: PaymentStatusesLiterals
fund_status: PaymentFundStatusesLiterals
error: Optional[str]
error: Optional[ResourceError]
metadata: Optional[Dict[str, Any]]
estimated_completion_date: Optional[str]
type: PaymentTypesLiterals
Expand Down
2 changes: 2 additions & 0 deletions method/resources/Verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from method.resource import Resource
from method.configuration import Configuration
from method.errors import ResourceError


VerificationStatusesLiterals = Literal[
Expand All @@ -25,6 +26,7 @@ class Verification(TypedDict):
id: str
status: VerificationStatusesLiterals
type: VerificationTypesLiterals
error: Optional[ResourceError]
initiated_at: str
pending_at: str
verified_at: str
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='method-python',
version='0.0.13',
version='0.0.14',
description='Python library for the Method API',
author='Marco del Carmen',
author_email='marco@mdelcarmen.me',
Expand Down