From 49d34f1733a064ef7343f4d144388b868073c737 Mon Sep 17 00:00:00 2001 From: dankito Date: Tue, 8 Sep 2020 01:19:34 +0200 Subject: [PATCH] Removed unused supportsRetrievingTransactionsOfLast90DaysWithoutTan and triedToRetrieveTransactionsOfLast90DaysWithoutTan --- .../net/dankito/banking/fints/FinTsClient.kt | 23 +------------------ .../banking/fints/model/AccountData.kt | 4 +--- 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt index 3df4cb56..8bfcb75c 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt @@ -297,7 +297,7 @@ open class FinTsClient( } accountSupportingRetrievingTransactions.forEach { account -> - tryGetTransactionsOfLast90DaysWithoutTan(bank, customer, account, false) { response -> + tryGetTransactionsOfLast90DaysWithoutTan(bank, customer, account) { response -> transactionsOfLast90DaysResponses.add(response) response.balance?.let { balances.put(account, it) } @@ -336,25 +336,11 @@ open class FinTsClient( * Check if bank supports this. */ open fun tryGetTransactionsOfLast90DaysWithoutTan(bank: BankData, customer: CustomerData, account: AccountData, callback: (GetTransactionsResponse) -> Unit) { - tryGetTransactionsOfLast90DaysWithoutTan(bank, customer, account, false, callback) - } - - protected open fun tryGetTransactionsOfLast90DaysWithoutTan(bank: BankData, customer: CustomerData, account: AccountData, - hasRetrievedTransactionsWithTanJustBefore: Boolean, callback: (GetTransactionsResponse) -> Unit) { val now = Date() val ninetyDaysAgo = Date(now.millisSinceEpoch - NinetyDaysMillis) getTransactionsAsync(GetTransactionsParameter(account.supportsFeature(AccountFeature.RetrieveBalance), ninetyDaysAgo, abortIfTanIsRequired = true), bank, customer, account) { response -> - account.triedToRetrieveTransactionsOfLast90DaysWithoutTan = true - - if (response.isSuccessful) { - if (response.isStrongAuthenticationRequired == false || hasRetrievedTransactionsWithTanJustBefore) { - // TODO: make use of supportsRetrievingTransactionsOfLast90DaysWithoutTan in UI e.g. in updateAccountsTransactionsIfNoTanIsRequiredAsync() - account.supportsRetrievingTransactionsOfLast90DaysWithoutTan = !!! response.isStrongAuthenticationRequired - } - } - callback(response) } } @@ -410,13 +396,6 @@ open class FinTsClient( getAndHandleResponseForMessage(message, dialogContext) { response -> closeDialog(dialogContext) - - // just retrieved all transactions -> check if retrieving that ones of last 90 days is possible without entering TAN - if (account.supportsRetrievingTransactionsOfLast90DaysWithoutTan == null && - response.successful && bookedTransactions.isNotEmpty() && parameter.fromDate == null) { - tryGetTransactionsOfLast90DaysWithoutTan(dialogContext.bank, dialogContext.customer, account, true) { } - } - callback(GetTransactionsResponse( response, bookedTransactions, diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/AccountData.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/AccountData.kt index b22942cc..9f8563de 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/AccountData.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/AccountData.kt @@ -18,9 +18,7 @@ open class AccountData( val productName: String?, val accountLimit: String?, val allowedJobNames: List, - var allowedJobs: List = listOf(), - var supportsRetrievingTransactionsOfLast90DaysWithoutTan: Boolean? = null, - var triedToRetrieveTransactionsOfLast90DaysWithoutTan: Boolean = false + var allowedJobs: List = listOf() ) { internal constructor() : this("", null, Laenderkennzeichen.Germany, "", null, "", null, null, "", null, null, listOf()) // for object deserializers