From 78cb96b8dc253d4c1d7d22c8248b988d844b1a4b Mon Sep 17 00:00:00 2001 From: dankito Date: Sat, 2 Jan 2021 22:49:05 +0100 Subject: [PATCH] Fixed that BankData didn't contain bank name --- .../net/dankito/banking/fints/rest/service/fints4kService.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rest/fints4kRest/src/main/kotlin/net/dankito/banking/fints/rest/service/fints4kService.kt b/rest/fints4kRest/src/main/kotlin/net/dankito/banking/fints/rest/service/fints4kService.kt index 676fc76d..dc56707e 100644 --- a/rest/fints4kRest/src/main/kotlin/net/dankito/banking/fints/rest/service/fints4kService.kt +++ b/rest/fints4kRest/src/main/kotlin/net/dankito/banking/fints/rest/service/fints4kService.kt @@ -117,7 +117,10 @@ class fints4kService { protected fun mapToBankData(accessData: BankAccessData): Pair { val bankSearchResult = bankFinder.findBankByBankCode(accessData.bankCode) val fintsServerAddress = accessData.finTsServerAddress ?: bankSearchResult.firstOrNull { it.pinTanAddress != null }?.pinTanAddress - val bank = BankData(accessData.bankCode, accessData.loginName, accessData.password, fintsServerAddress ?: "", bankSearchResult.firstOrNull()?.bic ?: "") + val potentialBankInfo = bankSearchResult.firstOrNull() + + val bank = BankData(accessData.bankCode, accessData.loginName, accessData.password, fintsServerAddress ?: "", + potentialBankInfo?.bic ?: "", potentialBankInfo?.name ?: "") if (fintsServerAddress == null) { val errorMessage = if (bankSearchResult.isEmpty()) "No bank found for bank code '${accessData.bankCode}'" else "Bank '${bankSearchResult.firstOrNull()?.name} does not support FinTS 3.0"