-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTransactions.py
More file actions
42 lines (33 loc) · 1.24 KB
/
Transactions.py
File metadata and controls
42 lines (33 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from typing import TypedDict, Optional, Literal, List
from method.resource import MethodResponse, Resource, ResourceListOpts
from method.configuration import Configuration
AccountTransactionStatusLiterals = Literal[
'pending',
'posted',
'voided',
]
class AccountTransaction(TypedDict):
id: str
account_id: str
descriptor: str
amount: int
auth_amount: int
currency_code: str
transaction_amount: int
transaction_auth_amount: int
transaction_currency_code: str
merchant_category_code: str
status: AccountTransactionStatusLiterals
transacted_at: str
posted_at: Optional[str]
voided_at: Optional[str]
original_txn_id: Optional[str]
created_at: str
updated_at: str
class AccountTransactionsResource(Resource):
def __init__(self, config: Configuration):
super(AccountTransactionsResource, self).__init__(config.add_path('transactions'))
def retrieve(self, txn_id: str) -> MethodResponse[AccountTransaction]:
return super(AccountTransactionsResource, self)._get_with_id(txn_id)
def list(self, params: Optional[ResourceListOpts] = None) -> MethodResponse[List[AccountTransaction]]:
return super(AccountTransactionsResource, self)._list(params)