Add bank icons to the PaymentMethodsList
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Actual behavior:
Currently, bank accounts in the payment methods list only have the generic icon for banks/cards. Here's a screenshot for reference:

Expected behavior:
We want the banks/cards to have their actual brand/logo icons, like this:

Please consider the following when building the Expected behavior:
- Add the bank icons to the Expensicons file
- Modify
paymentMethodList.jsto attempt to match the right icon with each account- For bank accounts the bank name should be in
bankAccount.additionalData.bankName - For credit cards, the bank name should be in
card.bank - If the field is blank, or does not match an existing bank icon, default to the generic bank icon drive-download-20210723T192557Z-001.zip
- For bank accounts the bank name should be in
These are the lists of all bank/card names. Given that there are a lot of different names for things like American Express, I think the best way to do it will be something like this rather than trying to match each one directly. If you have a better idea feel free to pitch it to me!
if (bankAccount.additionalData.bankName.toLowerCase().contains('americanexpress')) {
// american express icon
}
banklist.csv bankaccountlist.csv
Platform:
- Web ✅
- Desktop ✅
- Android ✅
- iOS ✅
Expensify/Expensify Issue URL: https://github.com/Expensify/Expensify/issues/169740 Upwork job link: https://www.upwork.com/jobs/~01ab696311bb024cbd
Triggered auto assignment to @marcaaron (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
Triggered auto assignment to @arielgreen (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
@michaelhaxhiu ZIP is not downloadable
@Santhosh-Sellavel can you try once more? I think it was an issue of copy/pasting that zip file from another GH respository.
If we know possiblebankName we can use the same name for assets and retrieve them, it's a one-time job. No checks would be needed further. If no asset is found we use a default image.
Example
asset name bankIcon_americanexpress.jpg.
// Retrieval
getResource(bankIcon_${bankName}).
@michaelhaxhiu
@Santhosh-Sellavel can you try once more? I think it was an issue of copy/pasting that zip file from another GH respository.
It's working now check other attachments also.
Proposal
@michaelhaxhiu we can do a implementation like shown below

More or else we need to map bankName to a respective resource, we can easily retrieve the same.
Proposal
- I'll add all bank icons to
ExpensiIconsorsrc/components/Icon/BankIcons.jscan be created - in
this.props.bankAccountsListorthis.props.cardListloop, detect the icon, using:
const bankIcons = [{
name: 'Citizens Bank',
icon: CitizensBank
}]
const getIcon = (bankOrCardName) => {
const icon = bankIcons.find((item) => item.name === bankOrCardName)
return icon || defaultBankIcon
}
combinedPaymentMethods.push({
type: MENU_ITEM,
title: bankAccount.addressName,
// eslint-disable-next-line
description: formattedBankAccountNumber,
icon: getIcon(card.cardName),
onPress: e => this.props.onPress(e, bankAccount.bankAccountID),
key: `bankAccount-${bankAccount.bankAccountID}`,
});
- in the
renderItemfunction addiconHeightandiconWidthprops to make it bigger.
And here's the result:

I add the all bank icon with bank name and we check condition bank name compare all icon if this icon name equal to bank name or credit card bank name this icon is set in createPaymentMethodList() in "/src/pages/settings/Payments/PaymentMethodList.js" if does not match we use default bank icon or credit card icon
Hi everyone, as we mentioned in the description, there are lots of bank names in the list like americanexpress.com.uk and americanexpress.com.australia which should both map to the American Express Icon. Those can't be changed in the DB so we need to match in a different way than just straight ===, meaning that none of the proposed solutions will work.
Working @stitesExpensify
We can map bankNames and icon for icons we have. We can create a separate file for this. Using the method getBankIcon we can retrieve the icon.
Example like
{
'americanexpress.com.australia': AmericanExpressIcon,
'americanexpress.com.uk': AmericanExpressIcon
}
@stitesExpensify
Proposal
@michaelhaxhiu we can do a implementation like shown below
More or else we need to map
bankNameto a respective resource, we can easily retrieve the same.
This one time mapping for bank Icons we have
But the best way to handle this image should be available in API itself, URI pointing to a resource over web, like we have our profile pic in personalDetails.
From where do we get bankAccount.additionalData. Is it a third-party integration?
addtionalData should have a logoURI, like it has bankName.
While we fetch bank account details, logoURI can be added in response in backEnd
And lazy load image here in client-side using logoURI.
@stitesExpensify
From where do we get bankAccount.additionalData. Is it a third-party integration? addtionalData should have a logoURI, like it has bankName.
We get that data from a lot of different places both internal and external. A lot of it is legacy data too which makes it hard to go back and change. IMO we don't want to do a database change for this issue.
We can map bankNames and icon for icons we have. We can create a separate file for this.
Is there a reason you prefer this over the solution in the description? If we write a function to map all of these, then we could just write a function to map them on the fly right? This has the additional benefit that we are covered for all future bank account names that are not in our current list.
Is there a reason you prefer this over the solution in the description?
We don't need the assets to be bundled with apps, because more than 90% of assets are useless for any normal user. It increases app size.
If we write a function to map all of these, then we could just write a function to map them on the fly right?
Yes, we can do this.
@stitesExpensify
We don't need the assets to be bundled with apps, because more than 90% of assets are useless for any normal user. It increases app size.
That makes sense, but there are 2 downsides to that IMO.
- We would have to do a massive database migration to add an icon link to each bank account
- The icons would not work if we are offline
Yes, we can do this.
Great, let's do it that way then.