From e30127415c33dac573ca9f483e3314bdffba255e Mon Sep 17 00:00:00 2001 From: dankito Date: Sat, 17 Apr 2021 23:10:51 +0200 Subject: [PATCH] Fixed that if TAN is required but we have been told to abort if requiring TAN, RetrievedAccountData is now set to successful --- .../kotlin/net/dankito/banking/fints/FinTsClient.kt | 4 ++++ .../kotlin/net/dankito/banking/fints/FinTsJobExecutor.kt | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) 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 ad0da522..0589e34d 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt @@ -132,6 +132,10 @@ open class FinTsClient( tryGetTransactionsOfLast90DaysWithoutTan(bank, account) { response -> retrievedAccountData.put(account, response.retrievedData.first()) + if (response.errorMessage != null) { + //getAccountsResponse.errorMessage = response.errorMessage + } + countRetrievedAccounts++ if (countRetrievedAccounts == countAccountsSupportingRetrievingTransactions) { addAccountDone(bank, getAccountsResponse, retrievedAccountData, callback) 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 7b7ccb89..202b220f 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsJobExecutor.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsJobExecutor.kt @@ -240,7 +240,8 @@ open class FinTsJobExecutor( getAndHandleResponseForMessage(message, dialogContext) { response -> closeDialog(dialogContext) - val successful = response.successful && (parameter.alsoRetrieveBalance == false || balance != null) + val successful = response.tanRequiredButWeWereToldToAbortIfSo + || (response.successful && (parameter.alsoRetrieveBalance == false || balance != null)) val fromDate = parameter.fromDate ?: parameter.account.countDaysForWhichTransactionsAreKept?.let { Date.today.addDays(it * -1) } ?: bookedTransactions.map { it.valueDate }.sortedBy { it.millisSinceEpoch }.firstOrNull()