I'll add my answer here in case it helps you and you can mark it as the solution. There's a couple of things that we needed to consider when creating a list of eligible accounts for the user to choose from:
- We wanted to ensure that the accounts linked to the User's profile had view-permission. We utilize Member to Member transfers and when those accounts are linked to the User's profile, the permissions are set to deposit only (no withdrawal permissions or view permissions).
- I wanted to ensure that the accounts were internal only - no external accounts.
To get the list of accounts, I used self.account_list.accounts
https://docs.q2developer.com/api_references/q2_sdk/hq/models/AccountList.html
This is my function to get a list of accounts that satisfied the two priorities above. However, you could probably use a set() instead of building a dict like I did to get unique values.
def _get_unique_accounts(self) -> List[str]:
"""
Returns a unique list of accounts for the Online Banking user with external accounts filtered out.
"""
return [
account.cif_internal_unmasked.zfill(10)
for account in {
account.cif_internal_unmasked: account for account in self.account_list.accounts if not account.is_external_acct and account.can_view
}.values()
]
Hopefully this gets you going in the right direction.
We are a Symitar FI and have created extensions where we needed to allow the member to select an account if the member had several accounts with our Credit Union. Is that the scenario you are describing?
— Bradley Bell one year agoYes, that's the one! What method did you use? GetAccountList? What property has Account Numbers?
— Ken Kondo one year ago