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 e296a50c..e3e40270 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 @@ -21,7 +21,7 @@ open class TanChallenge( * As [availableTanMethods] also contains selected TanMethod, we didn't want to duplicate this object. Use * [selectedTanMethod] to get selected TanMethod or iterate over [availableTanMethods] and filter selected one by this id. */ - open val selectedTanMethodId: String, + open val selectedTanMethodIdentifier: String, /** * When adding an account, frontend has no UserAccount object in BankingClientCallback to know which TanMethods are * available for user. @@ -38,7 +38,7 @@ open class TanChallenge( * As [availableTanMedia] also contains selected TanMedium, we didn't want to duplicate this object. Use * [selectedTanMedium] to get selected TanMedium or iterate over [availableTanMedia] and filter selected one by this medium name. */ - open val selectedTanMediumName: String? = null, + open val selectedTanMediumIdentifier: String? = null, open val availableTanMedia: List = emptyList(), open val tanImage: TanImage? = null, @@ -56,11 +56,11 @@ open class TanChallenge( @get:JsonIgnore open val selectedTanMethod: TanMethod - get() = availableTanMethods.first { it.identifier == selectedTanMethodId } + get() = availableTanMethods.first { it.identifier == selectedTanMethodIdentifier } @get:JsonIgnore open val selectedTanMedium: TanMedium? - get() = availableTanMedia.firstOrNull { it.mediumName == selectedTanMediumName } + get() = availableTanMedia.firstOrNull { it.mediumName == selectedTanMediumIdentifier } /** 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 3d6ccfca..75f3832c 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 @@ -292,11 +292,11 @@ open class FinTs4kMapper { val action = mapActionRequiringTan(challenge.forAction) val tanMethods = challenge.bank.tanMethodsAvailableForUser.map { mapTanMethod(it) } - val selectedTanMethodId = challenge.tanMethod.securityFunction.code + val selectedTanMethodIdentifier = challenge.tanMethod.securityFunction.code val tanMedia = challenge.bank.tanMedia.map { mapTanMedium(it) } // TanMedium has not natural id in FinTS model so we have to create our own one - val selectedTanMediumName = challenge.bank.selectedTanMedium?.let { selected -> tanMedia.firstOrNull { it == selected } }?.identifier + val selectedTanMediumIdentifier = challenge.bank.selectedTanMedium?.let { selected -> tanMedia.firstOrNull { it == selected } }?.identifier val bank = mapToBankViewInfo(challenge.bank) val account = challenge.account?.let { mapToBankAccountViewInfo(it) } @@ -304,7 +304,7 @@ open class FinTs4kMapper { val tanImage = if (challenge is ImageTanChallenge) mapTanImage(challenge.image) else null val flickerCode = if (challenge is FlickerCodeTanChallenge) mapFlickerCode(challenge.flickerCode) else null - return object : TanChallenge(type, action, challenge.messageToShowToUser, selectedTanMethodId, tanMethods, selectedTanMediumName, tanMedia, tanImage, flickerCode, bank, account, challenge.tanExpirationTime, challenge.challengeCreationTimestamp) { + return object : TanChallenge(type, action, challenge.messageToShowToUser, selectedTanMethodIdentifier, tanMethods, selectedTanMediumIdentifier, tanMedia, tanImage, flickerCode, bank, account, challenge.tanExpirationTime, challenge.challengeCreationTimestamp) { override fun addTanExpiredCallback(callback: () -> Unit) { challenge.addTanExpiredCallback(callback) }