Fixed that if TAN is required but we have been told to abort if requiring TAN, RetrievedAccountData is now set to successful

This commit is contained in:
dankito 2021-04-17 23:10:51 +02:00
parent 3e872514d6
commit e30127415c
2 changed files with 6 additions and 1 deletions

View File

@ -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)

View File

@ -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()