From 2f4bac9fbf50292568bd71c3cba7b01a6457921e Mon Sep 17 00:00:00 2001 From: dankito Date: Mon, 8 Jun 2020 23:39:09 +0200 Subject: [PATCH] Fixed selectSuggestedTanProcedure() so that SmsTan(costs money) or ChipTanUSB (not supported) don't get selected by default --- .../kotlin/net/dankito/banking/fints/FinTsClient.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 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 a8c6a9ba..1af55a4d 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt @@ -527,8 +527,10 @@ open class FinTsClient( } protected open fun selectSuggestedTanProcedure(customer: CustomerData): TanProcedure? { - return customer.supportedTanProcedures.firstOrNull { it.displayName.contains("manuell", true) == false } - ?: customer.supportedTanProcedures.firstOrNull() + return customer.supportedTanProcedures.firstOrNull { it.type != TanProcedureType.ChipTanUsb && it.type != TanProcedureType.SmsTan && it.type != TanProcedureType.ChipTanManuell } + ?: customer.supportedTanProcedures.firstOrNull { it.type != TanProcedureType.ChipTanUsb && it.type != TanProcedureType.SmsTan } + ?: customer.supportedTanProcedures.firstOrNull { it.type != TanProcedureType.ChipTanUsb } + ?: customer.supportedTanProcedures.firstOrNull() }