Fixed that UniCredit uses a centralized bank code for online banking

This commit is contained in:
dankito 2020-04-29 17:00:09 +02:00
parent e71799fcc3
commit 841b23c970
1 changed files with 10 additions and 1 deletions

View File

@ -9,7 +9,7 @@ open class BankDataMapper {
open fun mapFromBankInfo(bankInfo: BankInfo): BankData { open fun mapFromBankInfo(bankInfo: BankInfo): BankData {
return BankData( return BankData(
bankInfo.bankCode, getBankCodeForOnlineBanking(bankInfo),
Laenderkennzeichen.Germany, // TODO: currently there are only German banks. But change this if ever other countries get supported Laenderkennzeichen.Germany, // TODO: currently there are only German banks. But change this if ever other countries get supported
bankInfo.pinTanAddress ?: "", bankInfo.pinTanAddress ?: "",
name = bankInfo.name, name = bankInfo.name,
@ -17,4 +17,13 @@ open class BankDataMapper {
) )
} }
protected open fun getBankCodeForOnlineBanking(bankInfo: BankInfo): String {
// for UniCredit / HypVereinsbank for online banking '70020270' has to be used as bank code
if (bankInfo.name.contains("unicredit", true)) {
return "70020270"
}
return bankInfo.bankCode
}
} }