From 1356249621c3e21586e556ea46dc391cf6a21f3a Mon Sep 17 00:00:00 2001 From: dankito Date: Sun, 31 Oct 2021 16:16:47 +0100 Subject: [PATCH] Added getTanMediaList() to retrieveBasicDataLikeUsersTanMethods() as may for other calls like getTransactions() this is a requirement to be able to establish strong authentication dialog (only known bank till now: Postbank) --- .../kotlin/net/dankito/banking/fints/FinTsClient.kt | 8 +------- .../net/dankito/banking/fints/FinTsJobExecutor.kt | 10 +++++++++- 2 files changed, 10 insertions(+), 8 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 dd5ece13..2d713a6f 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt @@ -76,13 +76,7 @@ open class FinTsClient( /* Second dialog: some banks require that in order to initialize a dialog with strong customer authorization TAN media is required */ - if (jobExecutor.isJobSupported(bank, CustomerSegmentId.TanMediaList)) { - getTanMediaList(bank, TanMedienArtVersion.Alle, TanMediumKlasse.AlleMedien) { - addAccountGetAccountsAndTransactions(parameter, bank, callback) - } - } else { - addAccountGetAccountsAndTransactions(parameter, bank, callback) - } + addAccountGetAccountsAndTransactions(parameter, bank, 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 0777a27d..b877953d 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsJobExecutor.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsJobExecutor.kt @@ -115,7 +115,15 @@ open class FinTsJobExecutor( callback(BankResponse(false, noTanMethodSelected = true)) } else { getUsersTanMethod(bank) { - callback(BankResponse(bank.isTanMethodSelected, noTanMethodSelected = !!!bank.isTanMethodSelected)) + if (bank.isTanMethodSelected == false) { + callback(BankResponse(false, noTanMethodSelected = true)) + } else if (bank.tanMedia.isEmpty() && isJobSupported(bank, CustomerSegmentId.TanMediaList)) { // tan media not retrieved yet + getTanMediaList(bank, TanMedienArtVersion.Alle, TanMediumKlasse.AlleMedien) { + callback(getTanMethodsResponse) // TODO: judge if bank requires selecting TAN media and if though evaluate getTanMediaListResponse + } + } else { + callback(getTanMethodsResponse) + } } } }