diff --git a/method/errors.py b/method/errors.py index d97b578..b0ce1ee 100644 --- a/method/errors.py +++ b/method/errors.py @@ -49,6 +49,8 @@ def generate(opts: MethodErrorOpts): if error_type == 'API_ERROR': return MethodInternalError(opts) + return MethodError(opts) + class MethodInternalError(MethodError): pass diff --git a/method/resources/Accounts/Products.py b/method/resources/Accounts/Products.py index 4beca6d..cd209db 100644 --- a/method/resources/Accounts/Products.py +++ b/method/resources/Accounts/Products.py @@ -29,10 +29,10 @@ class AccountProductListResponse(TypedDict): payment: Optional[AccountProduct] sensitive: Optional[AccountProduct] update: Optional[AccountProduct] - transactions: Optional[AccountProduct] + transaction: Optional[AccountProduct] payoff: Optional[AccountProduct] card_brand: Optional[AccountProduct] - payment_instruments: Optional[AccountProduct] + payment_instrument: Optional[AccountProduct] class AccountProductResource(Resource): def __init__(self, config: Configuration): diff --git a/method/resources/Accounts/Updates.py b/method/resources/Accounts/Updates.py index d7c9d04..d3db8cf 100644 --- a/method/resources/Accounts/Updates.py +++ b/method/resources/Accounts/Updates.py @@ -4,13 +4,15 @@ from method.configuration import Configuration from method.errors import ResourceError from method.resources.Accounts.Types import AccountLiabilityTypesLiterals, AccountLiabilityAutoLoan, \ - AccountLiabilityCreditCard, AccountLiabilityMortgage, AccountLiabilityStudentLoans, AccountLiabilityPersonalLoan + AccountLiabilityCreditCard, AccountLiabilityMortgage, AccountLiabilityStudentLoans, AccountLiabilityPersonalLoan, \ + AccountUpdateSourceLiterals class AccountUpdate(TypedDict): id: str status: ResourceStatusLiterals account_id: str + source: AccountUpdateSourceLiterals type: AccountLiabilityTypesLiterals auto_loan: Optional[AccountLiabilityAutoLoan] credit_card: Optional[AccountLiabilityCreditCard] diff --git a/test/resources/Account_test.py b/test/resources/Account_test.py index 218e245..eb2b20b 100644 --- a/test/resources/Account_test.py +++ b/test/resources/Account_test.py @@ -124,9 +124,21 @@ def test_create_ach_account(setup): 'number': '123456789', 'type': 'checking', }, + 'liability': None, 'latest_verification_session': accounts_create_ach_response['latest_verification_session'], + 'balance': None, + 'update': None, + 'attribute': None, + 'card_brand': None, + 'payoff': None, + 'transaction': None, + 'payment_instrument': None, + 'sensitive': None, 'products': ['payment'], 'restricted_products': [], + 'subscriptions': accounts_create_ach_response['subscriptions'], + 'available_subscriptions': accounts_create_ach_response['available_subscriptions'], + 'restricted_subscriptions': accounts_create_ach_response['restricted_subscriptions'], 'status': 'active', 'error': None, 'metadata': None, @@ -149,12 +161,13 @@ def test_create_liability_account(setup): }, }) - accounts_create_liability_response['products'] = accounts_create_liability_response['products'].sort() + accounts_create_liability_response['products'].sort() expect_results: Account = { 'id': accounts_create_liability_response['id'], 'holder_id': holder_1_response['id'], 'type': 'liability', + 'ach': None, 'liability': { 'fingerprint': None, 'mch_id': 'mch_302086', @@ -170,8 +183,9 @@ def test_create_liability_account(setup): 'attribute': accounts_create_liability_response['attribute'], 'card_brand': None, 'payoff': None, + 'transaction': None, 'payment_instrument': None, - 'payoff': None, + 'sensitive': None, 'products': accounts_create_liability_response['products'], 'restricted_products': accounts_create_liability_response['restricted_products'], 'subscriptions': accounts_create_liability_response['subscriptions'], @@ -199,9 +213,21 @@ def test_retrieve_account(setup): 'number': '123456789', 'type': 'checking', }, + 'liability': None, 'latest_verification_session': accounts_create_ach_response['latest_verification_session'], + 'balance': None, + 'update': None, + 'attribute': None, + 'card_brand': None, + 'payoff': None, + 'transaction': None, + 'payment_instrument': None, + 'sensitive': None, 'products': ['payment'], 'restricted_products': [], + 'subscriptions': accounts_retrieve_response['subscriptions'], + 'available_subscriptions': accounts_retrieve_response['available_subscriptions'], + 'restricted_subscriptions': accounts_retrieve_response['restricted_subscriptions'], 'status': 'active', 'error': None, 'metadata': None, @@ -959,6 +985,7 @@ def test_create_attributes(setup): 'id': attributes_create_response['id'], 'account_id': test_credit_card_account['id'], 'status': 'completed', + 'payload': attributes_create_response['payload'], 'attributes': attributes_create_response['attributes'], 'error': None, 'created_at': attributes_create_response['created_at'], @@ -978,6 +1005,7 @@ def test_list_attributes(setup): 'id': attributes_create_response['id'], 'account_id': test_credit_card_account['id'], 'status': 'completed', + 'payload': attribute_to_check['payload'], 'attributes': attributes_create_response['attributes'], 'error': None, 'created_at': attribute_to_check['created_at'], @@ -995,6 +1023,7 @@ def test_retrieve_attributes(setup): 'id': attributes_create_response['id'], 'account_id': test_credit_card_account['id'], 'status': 'completed', + 'payload': retrieve_attributes_response['payload'], 'attributes': attributes_create_response['attributes'], 'error': None, 'created_at': retrieve_attributes_response['created_at'],