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 0c6dcfc0..dd5ece13 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt @@ -74,22 +74,14 @@ open class FinTsClient( return@retrieveBasicDataLikeUsersTanMethods } - jobExecutor.getUsersTanMethod(bank) { didSelectTanMethod -> + /* Second dialog: some banks require that in order to initialize a dialog with strong customer authorization TAN media is required */ - if (didSelectTanMethod == false) { - callback(AddAccountResponse(BankResponse(false), bank)) - return@getUsersTanMethod - } - - /* 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 { + if (jobExecutor.isJobSupported(bank, CustomerSegmentId.TanMediaList)) { + getTanMediaList(bank, TanMedienArtVersion.Alle, TanMediumKlasse.AlleMedien) { addAccountGetAccountsAndTransactions(parameter, bank, callback) } + } else { + 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 d4d72c2d..0777a27d 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsJobExecutor.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsJobExecutor.kt @@ -110,7 +110,15 @@ open class FinTsJobExecutor( getAndHandleResponseForMessage(message, dialogContext) { response -> closeDialog(dialogContext) - handleGetUsersTanMethodsResponse(response, dialogContext, callback) + handleGetUsersTanMethodsResponse(response, dialogContext) { getTanMethodsResponse -> + if (bank.tanMethodsAvailableForUser.isEmpty()) { // could not retrieve supported tan methods for user + callback(BankResponse(false, noTanMethodSelected = true)) + } else { + getUsersTanMethod(bank) { + callback(BankResponse(bank.isTanMethodSelected, noTanMethodSelected = !!!bank.isTanMethodSelected)) + } + } + } } } @@ -632,15 +640,8 @@ open class FinTsJobExecutor( protected open fun ensureTanMethodIsSelected(bank: BankData, callback: (BankResponse) -> Unit) { if (bank.isTanMethodSelected == false) { if (bank.tanMethodsAvailableForUser.isEmpty()) { - retrieveBasicDataLikeUsersTanMethods(bank) { - if (bank.tanMethodsAvailableForUser.isEmpty()) { // could not retrieve supported tan methods for user - callback(BankResponse(false, noTanMethodSelected = true)) - } - else { - getUsersTanMethod(bank) { - callback(BankResponse(bank.isTanMethodSelected, noTanMethodSelected = !!!bank.isTanMethodSelected)) - } - } + retrieveBasicDataLikeUsersTanMethods(bank) { retrieveBasicDataResponse -> + callback(retrieveBasicDataResponse) } } else {