Skip to content
Closed
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
2 changes: 2 additions & 0 deletions method/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def generate(opts: MethodErrorOpts):
if error_type == 'API_ERROR':
return MethodInternalError(opts)

return MethodError(opts)


class MethodInternalError(MethodError):
pass
Expand Down
4 changes: 2 additions & 2 deletions method/resources/Accounts/Products.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 3 additions & 1 deletion method/resources/Accounts/Updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
33 changes: 31 additions & 2 deletions test/resources/Account_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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',
Expand All @@ -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'],
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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'],
Expand All @@ -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'],
Expand All @@ -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'],
Expand Down
Loading