diff --git a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/tan/TanChallenge.kt b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/tan/TanChallenge.kt index 01846172..2946830b 100644 --- a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/tan/TanChallenge.kt +++ b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/tan/TanChallenge.kt @@ -65,7 +65,17 @@ open class TanChallenge( /** - * Principally a no-op method, not implemented for all client, only implementing client for not: FinTs4jBankingClient. + * Not implemented for all client, only implementing client for now: FinTs4jBankingClient. + * + * If a TAN expires either when [TanChallenge.tanExpirationTime] or a default timeout (15 min) is exceeded, + * you can add a callback to get notified when TAN expired e.g. to close a EnterTanDialog. + */ + open fun addTanExpiredCallback(callback: () -> Unit) { + + } + + /** + * Principally a no-op method, not implemented for all client, only implementing client for now: FinTs4jBankingClient. * * If a TAN is requested for a decoupled TAN method like [TanMethodType.DecoupledTan] or [TanMethodType.DecoupledPushTan], * you can add a callback to get notified when user approved TAN in her app e.g. to close a EnterTanDialog. diff --git a/FinTs4jBankingClient/src/commonMain/kotlin/net/codinux/banking/client/fints4k/FinTs4kMapper.kt b/FinTs4jBankingClient/src/commonMain/kotlin/net/codinux/banking/client/fints4k/FinTs4kMapper.kt index 51588201..fbbb50f7 100644 --- a/FinTs4jBankingClient/src/commonMain/kotlin/net/codinux/banking/client/fints4k/FinTs4kMapper.kt +++ b/FinTs4jBankingClient/src/commonMain/kotlin/net/codinux/banking/client/fints4k/FinTs4kMapper.kt @@ -216,6 +216,10 @@ open class FinTs4kMapper { val flickerCode = if (challenge is FlickerCodeTanChallenge) mapFlickerCode(challenge.flickerCode) else null return object : TanChallenge(type, action, challenge.messageToShowToUser, selectedTanMethodId, tanMethods, selectedTanMediumName, tanMedia, tanImage, flickerCode, user, account, challenge.tanExpirationTime, challenge.challengeCreationTimestamp) { + override fun addTanExpiredCallback(callback: () -> Unit) { + challenge.addTanExpiredCallback(callback) + } + override fun addUserApprovedDecoupledTanCallback(callback: () -> Unit) { challenge.addUserApprovedDecoupledTanCallback(callback) }