From 796218c2d67da3cc2e0fb085751ffd4d2f67992f Mon Sep 17 00:00:00 2001 From: dankito Date: Sat, 13 Nov 2021 15:39:30 +0100 Subject: [PATCH] Added nonVisualOrImageBased() --- .../net/dankito/banking/fints/util/TanMethodSelector.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/util/TanMethodSelector.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/util/TanMethodSelector.kt index a8cd064b..dc315c6a 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/util/TanMethodSelector.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/util/TanMethodSelector.kt @@ -54,12 +54,18 @@ open class TanMethodSelector { } + open fun nonVisualOrImageBased(tanMethods: List): TanMethod? { + return nonVisual(tanMethods) + ?: imageBased(tanMethods) + } + open fun nonVisualOrImageBasedOrFirst(tanMethods: List): TanMethod? { return nonVisual(tanMethods) ?: imageBased(tanMethods) ?: first(tanMethods) } + open fun first(tanMethods: List): TanMethod? { return tanMethods.firstOrNull() }