diff --git a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/model/TanMethodType.kt b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/model/TanMethodType.kt index 5b19f9c7..f3623de6 100644 --- a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/model/TanMethodType.kt +++ b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/model/TanMethodType.kt @@ -19,6 +19,10 @@ enum class TanMethodType { AppTan, + DecoupledTan, + + DecoupledPushTan, + photoTan, QrCode diff --git a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/model/mapper/ModelMapper.kt b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/model/mapper/ModelMapper.kt index 46bf47b1..95f2c297 100644 --- a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/model/mapper/ModelMapper.kt +++ b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/model/mapper/ModelMapper.kt @@ -230,6 +230,10 @@ open class ModelMapper( tanMethodNameContains(name, "SMS", "mobile", "mTAN") -> TanMethodType.SmsTan + parameters.dkTanMethod == DkTanMethod.Decoupled -> TanMethodType.DecoupledTan + + parameters.dkTanMethod == DkTanMethod.DecoupledPush -> TanMethodType.DecoupledPushTan + // 'flateXSecure' identifies itself as 'PPTAN' instead of 'AppTAN' // 'activeTAN-Verfahren' can actually be used either with an app or a reader; it's like chipTAN QR but without a chip card parameters.dkTanMethod == DkTanMethod.App diff --git a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/util/TanMethodSelector.kt b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/util/TanMethodSelector.kt index cf386ce4..958e5971 100644 --- a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/util/TanMethodSelector.kt +++ b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/util/TanMethodSelector.kt @@ -8,7 +8,7 @@ open class TanMethodSelector { companion object { - val NonVisual = listOf(TanMethodType.AppTan, TanMethodType.SmsTan, TanMethodType.ChipTanManuell, TanMethodType.EnterTan) + val NonVisual = listOf(TanMethodType.DecoupledTan, TanMethodType.DecoupledPushTan, TanMethodType.AppTan, TanMethodType.SmsTan, TanMethodType.ChipTanManuell, TanMethodType.EnterTan) val ImageBased = listOf(TanMethodType.QrCode, TanMethodType.ChipTanQrCode, TanMethodType.photoTan, TanMethodType.ChipTanPhotoTanMatrixCode) @@ -16,7 +16,7 @@ open class TanMethodSelector { open fun getSuggestedTanMethod(tanMethods: List): TanMethod? { - return tanMethods.firstOrNull { it.decoupledParameters != null } // decoupled TAN method is the most simplistic TAN method, user only has to confirm the action in her TAN app, no manual TAN entering required + return tanMethods.firstOrNull { it.type == TanMethodType.DecoupledPushTan || it.type == TanMethodType.DecoupledTan } // decoupled TAN method is the most simplistic TAN method, user only has to confirm the action in her TAN app, no manual TAN entering required ?: tanMethods.firstOrNull { it.type == TanMethodType.AppTan } // that's the second most simplistic TAN method: user has to confirm action in her TAN app and then enter the displayed TAN ?: tanMethods.firstOrNull { it.type != TanMethodType.ChipTanUsb && it.type != TanMethodType.SmsTan && it.type != TanMethodType.ChipTanManuell } ?: tanMethods.firstOrNull { it.type != TanMethodType.ChipTanUsb && it.type != TanMethodType.SmsTan } diff --git a/fints4k/src/commonTest/kotlin/net/codinux/banking/fints/response/ResponseParserTest.kt b/fints4k/src/commonTest/kotlin/net/codinux/banking/fints/response/ResponseParserTest.kt index d7e1c33c..289f18f3 100644 --- a/fints4k/src/commonTest/kotlin/net/codinux/banking/fints/response/ResponseParserTest.kt +++ b/fints4k/src/commonTest/kotlin/net/codinux/banking/fints/response/ResponseParserTest.kt @@ -941,10 +941,10 @@ class ResponseParserTest : FinTsTestBase() { assertEquals(2, decoupledPushTanMethod.countSupportedActiveTanMedia) assertEquals(180, decoupledPushTanMethod.maxNumberOfStateRequestsForDecoupled) - assertEquals(1, decoupledPushTanMethod.initialDelayInSecondsForStateRequestsForDecoupled) - assertEquals(1, decoupledPushTanMethod.delayInSecondsForNextStateRequestsForDecoupled) + assertEquals(1, decoupledPushTanMethod.initialDelayInSecondsForDecoupledStateRequest) + assertEquals(1, decoupledPushTanMethod.delayInSecondsForNextDecoupledStateRequests) assertEquals(true, decoupledPushTanMethod.manualConfirmationAllowedForDecoupled) - assertEquals(true, decoupledPushTanMethod.periodicStateRequestsAllowedForDecoupled) + assertEquals(true, decoupledPushTanMethod.periodicDecoupledStateRequestsAllowed) } ?: run { fail("No segment of type TanInfo found in ${result.receivedSegments}") } }