From 1e1e8e8f117e586f869527624ebeeca4f88d0e50 Mon Sep 17 00:00:00 2001 From: dankito Date: Mon, 1 Nov 2021 16:52:37 +0100 Subject: [PATCH] Renamed tanMethodSupportedByBank to tanMethodsSupportedByBank --- .../kotlin/net/dankito/banking/fints/FinTsJobExecutor.kt | 8 ++++---- .../kotlin/net/dankito/banking/fints/model/BankData.kt | 4 ++-- .../net/dankito/banking/fints/model/mapper/ModelMapper.kt | 4 ++-- .../net/dankito/banking/fints/FinTsClientTestBase.kt | 6 ++---- .../fints/bankdetails/BanksFinTsDetailsRetriever.kt | 4 +--- 5 files changed, 11 insertions(+), 15 deletions(-) diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsJobExecutor.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsJobExecutor.kt index 59b056ad..27e07fee 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsJobExecutor.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsJobExecutor.kt @@ -156,10 +156,10 @@ open class FinTsJobExecutor( getAnonymousBankInfo(bank) { anonymousBankInfoResponse -> if (anonymousBankInfoResponse.successful == false) { callback(anonymousBankInfoResponse) - } else if (bank.tanMethodSupportedByBank.isEmpty()) { // should only be a theoretical error + } else if (bank.tanMethodsSupportedByBank.isEmpty()) { // should only be a theoretical error callback(BankResponse(true, internalError = "Die TAN Verfahren der Bank konnten nicht ermittelt werden")) // TODO: translate } else { - bank.tanMethodsAvailableForUser = bank.tanMethodSupportedByBank + bank.tanMethodsAvailableForUser = bank.tanMethodsSupportedByBank getUsersTanMethod(bank) { didSelectTanMethod -> if (didSelectTanMethod) { @@ -622,11 +622,11 @@ open class FinTsJobExecutor( protected open fun ensureBasicBankDataRetrieved(bank: BankData, callback: (BankResponse) -> Unit) { - if (bank.tanMethodSupportedByBank.isEmpty() || bank.supportedJobs.isEmpty()) { + if (bank.tanMethodsSupportedByBank.isEmpty() || bank.supportedJobs.isEmpty()) { retrieveBasicDataLikeUsersTanMethods(bank) { getBankInfoResponse -> if (getBankInfoResponse.successful == false) { callback(getBankInfoResponse) - } else if (bank.tanMethodSupportedByBank.isEmpty() || bank.supportedJobs.isEmpty()) { + } else if (bank.tanMethodsSupportedByBank.isEmpty() || bank.supportedJobs.isEmpty()) { callback(BankResponse(false, internalError = "Could not retrieve basic bank data like supported tan methods or supported jobs")) // TODO: translate // TODO: add as messageToShowToUser } else { diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/BankData.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/BankData.kt index 35e45253..dd2099f1 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/BankData.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/BankData.kt @@ -17,14 +17,14 @@ open class BankData( open var bic: String, open var bankName: String = "", - open var countryCode: Int = Laenderkennzeichen.Germany, // TODO: currently there are only German banks. But change this if ever other countries get supported + open var countryCode: Int = Laenderkennzeichen.Germany, // TODO: currently we only support German banks. But change this if ever other countries get supported open var bpdVersion: Int = BPDVersion.VersionNotReceivedYet, open var userId: String = customerId, open var customerName: String = "", open var updVersion: Int = UPDVersion.VersionNotReceivedYet, - open var tanMethodSupportedByBank: List = listOf(), + open var tanMethodsSupportedByBank: List = listOf(), open var tanMethodsAvailableForUser: List = listOf(), open var selectedTanMethod: TanMethod = TanMethodNotSelected, open var tanMedia: List = listOf(), diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/mapper/ModelMapper.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/mapper/ModelMapper.kt index 10500a69..068d3a99 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/mapper/ModelMapper.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/mapper/ModelMapper.kt @@ -40,7 +40,7 @@ open class ModelMapper( } response.getFirstSegmentById(InstituteSegmentId.TanInfo)?.let { tanInfo -> - bank.tanMethodSupportedByBank = mapToTanMethods(tanInfo) + bank.tanMethodsSupportedByBank = mapToTanMethods(tanInfo) } response.getFirstSegmentById(InstituteSegmentId.CommunicationInfo)?.let { communicationInfo -> @@ -161,7 +161,7 @@ open class ModelMapper( } protected open fun findTanMethod(securityFunction: Sicherheitsfunktion, bank: BankData): TanMethod? { - return bank.tanMethodSupportedByBank.firstOrNull { it.securityFunction == securityFunction } + return bank.tanMethodsSupportedByBank.firstOrNull { it.securityFunction == securityFunction } } protected open fun setAllowedJobsForAccount(bank: BankData, account: AccountData, supportedJobs: List) { diff --git a/fints4k/src/jvm6Test/kotlin/net/dankito/banking/fints/FinTsClientTestBase.kt b/fints4k/src/jvm6Test/kotlin/net/dankito/banking/fints/FinTsClientTestBase.kt index f1660c6d..51a45ad3 100644 --- a/fints4k/src/jvm6Test/kotlin/net/dankito/banking/fints/FinTsClientTestBase.kt +++ b/fints4k/src/jvm6Test/kotlin/net/dankito/banking/fints/FinTsClientTestBase.kt @@ -19,8 +19,6 @@ import net.dankito.banking.fints.response.client.AddAccountResponse import net.dankito.banking.fints.response.client.FinTsClientResponse import net.dankito.banking.fints.response.client.GetTanMediaListResponse import net.dankito.banking.fints.response.client.GetTransactionsResponse -import net.dankito.banking.fints.util.PureKotlinBase64Service -import net.dankito.banking.fints.webclient.KtorWebClient import net.dankito.utils.multiplatform.Date import net.dankito.utils.multiplatform.DateFormatter import net.dankito.utils.multiplatform.UUID @@ -94,7 +92,7 @@ open class FinTsClientTestBase { // then expect(result.successful).isTrue() expect(BankDataAnonymous.supportedHbciVersions).isNotEmpty() - expect(BankDataAnonymous.tanMethodSupportedByBank).isNotEmpty() + expect(BankDataAnonymous.tanMethodsSupportedByBank).isNotEmpty() expect(BankDataAnonymous.supportedJobs).isNotEmpty() expect(BankDataAnonymous.supportedLanguages).isNotEmpty() expect(BankDataAnonymous.bankName).isNotEmpty() @@ -127,7 +125,7 @@ open class FinTsClientTestBase { expect(Bank.bankName).isNotEmpty() expect(Bank.supportedJobs).isNotEmpty() // supported jobs are now known - expect(Bank.tanMethodSupportedByBank).isNotEmpty() // supported tan methods are now known + expect(Bank.tanMethodsSupportedByBank).isNotEmpty() // supported tan methods are now known expect(Bank.supportedHbciVersions).isNotEmpty() // supported HBIC versions are now known expect(Bank.supportedLanguages).isNotEmpty() // supported languages are now known diff --git a/fints4k/src/jvm6Test/kotlin/net/dankito/banking/fints/bankdetails/BanksFinTsDetailsRetriever.kt b/fints4k/src/jvm6Test/kotlin/net/dankito/banking/fints/bankdetails/BanksFinTsDetailsRetriever.kt index 57b608b3..e2753474 100644 --- a/fints4k/src/jvm6Test/kotlin/net/dankito/banking/fints/bankdetails/BanksFinTsDetailsRetriever.kt +++ b/fints4k/src/jvm6Test/kotlin/net/dankito/banking/fints/bankdetails/BanksFinTsDetailsRetriever.kt @@ -1,7 +1,6 @@ package net.dankito.banking.fints.bankdetails import kotlinx.coroutines.runBlocking -import net.dankito.banking.fints.FinTsClient import net.dankito.banking.bankfinder.InMemoryBankFinder import net.dankito.banking.fints.callback.NoOpFinTsClientCallback import net.dankito.banking.fints.messages.MessageBuilder @@ -20,7 +19,6 @@ import net.dankito.banking.fints.response.segments.SepaAccountInfoParameters import net.dankito.banking.fints.response.segments.TanInfo import net.dankito.banking.fints.response.segments.TanMethodParameters import net.dankito.banking.fints.util.* -import net.dankito.banking.fints.webclient.KtorWebClient import org.apache.commons.csv.CSVFormat import org.apache.commons.csv.CSVPrinter import org.junit.Ignore @@ -186,7 +184,7 @@ class BanksFinTsDetailsRetriever { csvPrinter.printRecord(bankInfo.bankCode, bankInfo.name, bankInfo.city, bank.bpdVersion, - bank.tanMethodSupportedByBank.joinToString(", ") { it.securityFunction.code + ": " + it.displayName + " (" + it.type + ")" }, + bank.tanMethodsSupportedByBank.joinToString(", ") { it.securityFunction.code + ": " + it.displayName + " (" + it.type + ")" }, supportedTanMethods.joinToString(", "), hhd13Supported, hhd14Supported,