Skip to content

Commit 28b836f

Browse files
authored
Mike/adds payment status (#49)
* adds cashed, payment method, and data_as_of * version * fix entity test date format
1 parent 0a2a53f commit 28b836f

5 files changed

Lines changed: 17 additions & 3 deletions

File tree

method/resources/Accounts/Updates.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class AccountUpdate(TypedDict):
1717
mortgage: Optional[AccountLiabilityMortgage]
1818
personal_loan: Optional[AccountLiabilityPersonalLoan]
1919
student_loans: Optional[AccountLiabilityStudentLoans]
20+
data_as_of: Optional[str]
2021
error: Optional[ResourceError]
2122
created_at: str
2223
updated_at: str

method/resources/Payments/Payment.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
'reversed',
1717
'reversal_required',
1818
'reversal_processing',
19-
'settled'
19+
'settled',
20+
'cashed'
2021
]
2122

2223

@@ -44,6 +45,12 @@
4445
]
4546

4647

48+
PaymentDestinationPaymentMethodsLiterals = Literal[
49+
'paper',
50+
'electronic'
51+
]
52+
53+
4754
class PaymentFee(TypedDict):
4855
type: PaymentFeeTypesLiterals
4956
amount: int
@@ -67,6 +74,7 @@ class Payment(TypedDict):
6774
destination_settlement_date: Optional[str]
6875
source_status: PaymentStatusesLiterals
6976
destination_status: PaymentStatusesLiterals
77+
destination_payment_method: Optional[PaymentDestinationPaymentMethodsLiterals]
7078
fee: Optional[PaymentFee]
7179
type: PaymentTypesLiterals
7280
created_at: str

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='1.1.8',
5+
version='1.1.9',
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',

test/resources/Account_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,15 @@ def setup():
7070
'holder_id': holder_1_response['id'],
7171
'liability.type': 'credit_card',
7272
'liability.mch_id': 'mch_302086',
73+
'status': 'active',
7374
})
7475
test_credit_card_account = test_credit_card_accounts[0]
7576

7677
test_auto_loan_accounts = method.accounts.list({
7778
'holder_id': holder_1_response['id'],
7879
'liability.type': 'auto_loan',
7980
'liability.mch_id': 'mch_2347',
81+
'status': 'active',
8082
})
8183
test_auto_loan_account = test_auto_loan_accounts[0]
8284

@@ -802,6 +804,7 @@ def test_create_updates(setup):
802804
'credit_limit': None,
803805
'usage_pattern': None
804806
},
807+
'data_as_of': None,
805808
'error': None,
806809
'created_at': create_updates_response['created_at'],
807810
'updated_at': create_updates_response['updated_at'],
@@ -840,6 +843,7 @@ def get_updates():
840843
'credit_limit': 2800000,
841844
'usage_pattern': None
842845
},
846+
'data_as_of': None,
843847
'error': None,
844848
'created_at': updates_retrieve_response['created_at'],
845849
'updated_at': updates_retrieve_response['updated_at'],
@@ -878,6 +882,7 @@ def test_list_updates_for_account(setup):
878882
'credit_limit': 2800000,
879883
'usage_pattern': None
880884
},
885+
'data_as_of': None,
881886
'error': None,
882887
'created_at': update_to_check['created_at'] if update_to_check else None,
883888
'updated_at': update_to_check['updated_at'] if update_to_check else None

test/resources/Entity_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def test_update_entity():
248248
def test_list_entities():
249249
global entities_list_response
250250
# list only those entities created in past hour, in the format of YYYY-MM-DD
251-
from_date = (datetime.now() - timedelta(hours=1)).strftime('%Y-%m-%dT%H:%M:%S.000Z')
251+
from_date = (datetime.now() - timedelta(hours=1)).strftime('%Y-%m-%d')
252252
entities_list_response = method.entities.list({'from_date': from_date})
253253
entities_list_response = [entity['id'] for entity in entities_list_response]
254254

0 commit comments

Comments
 (0)