From 803e44118c4a2220019a07688e6e65c2121d6ad9 Mon Sep 17 00:00:00 2001 From: dankito Date: Wed, 16 Oct 2024 15:33:26 +0200 Subject: [PATCH] Extracted TanMethodsPreferredByMostApplications --- .../banking/client/model/options/GetAccountDataOptions.kt | 2 +- .../banking/client/model/request/TransferMoneyRequest.kt | 2 +- .../client/model/request/TransferMoneyRequestForUser.kt | 4 ++-- .../net/codinux/banking/client/model/tan/TanMethodType.kt | 4 ++++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/options/GetAccountDataOptions.kt b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/options/GetAccountDataOptions.kt index 2373c9f8..5e3a0c18 100644 --- a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/options/GetAccountDataOptions.kt +++ b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/options/GetAccountDataOptions.kt @@ -34,7 +34,7 @@ open class GetAccountDataOptions( * But also graphical applications prefer non visual TanMethods as then they only have to display a text field to input * TAN, and then image based TanMethods as then they additionally only have to display an image. */ - val preferredTanMethods: List? = TanMethodType.NonVisualOrImageBased, + val preferredTanMethods: List? = TanMethodType.TanMethodsPreferredByMostApplications, val tanMethodsNotSupportedByApplication: List = TanMethodType.TanMethodsNotSupportedByMostApplications, diff --git a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/request/TransferMoneyRequest.kt b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/request/TransferMoneyRequest.kt index 5ea70665..9da345c7 100644 --- a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/request/TransferMoneyRequest.kt +++ b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/request/TransferMoneyRequest.kt @@ -71,7 +71,7 @@ open class TransferMoneyRequest( * But also graphical applications prefer non visual TanMethods as then they only have to display a text field to input * TAN, and then image based TanMethods as then they additionally only have to display an image. */ - val preferredTanMethods: List? = TanMethodType.NonVisualOrImageBased, + val preferredTanMethods: List? = TanMethodType.TanMethodsPreferredByMostApplications, val tanMethodsNotSupportedByApplication: List = TanMethodType.TanMethodsNotSupportedByMostApplications, diff --git a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/request/TransferMoneyRequestForUser.kt b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/request/TransferMoneyRequestForUser.kt index e1ff34c5..92ab2b9a 100644 --- a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/request/TransferMoneyRequestForUser.kt +++ b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/request/TransferMoneyRequestForUser.kt @@ -35,7 +35,7 @@ open class TransferMoneyRequestForUser( instantTransfer: Boolean = false, - preferredTanMethods: List? = TanMethodType.NonVisualOrImageBased, + preferredTanMethods: List? = TanMethodType.TanMethodsPreferredByMostApplications, tanMethodsNotSupportedByApplication: List = TanMethodType.TanMethodsNotSupportedByMostApplications, clientData: Any? = null, @@ -52,7 +52,7 @@ open class TransferMoneyRequestForUser( amount: Amount, currency: String = DefaultValues.DefaultCurrency, paymentReference: String? = null, instantTransfer: Boolean = false ) : this(bank.domesticBankCode, bank.loginName, bank.password!!, account?.let { BankAccountIdentifier(it.identifier, it.subAccountNumber, it.iban) }, recipientName, recipientAccountIdentifier, recipientBankIdentifier, amount, currency, paymentReference, instantTransfer, - listOf(bank.selectedTanMethod.type) + TanMethodType.NonVisualOrImageBased, TanMethodType.TanMethodsNotSupportedByMostApplications, bank.clientData, bank.serializedClientData) { + listOf(bank.selectedTanMethod.type) + TanMethodType.TanMethodsPreferredByMostApplications, TanMethodType.TanMethodsNotSupportedByMostApplications, bank.clientData, bank.serializedClientData) { this.bank = bank this.account = account } diff --git a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/tan/TanMethodType.kt b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/tan/TanMethodType.kt index 2d9ddeec..c3fbe142 100644 --- a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/tan/TanMethodType.kt +++ b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/tan/TanMethodType.kt @@ -57,6 +57,10 @@ enum class TanMethodType { this.add(index, ChipTanFlickerCode) }.toList() + + val TanMethodsPreferredByMostApplications = NonVisualOrImageBased + + val TanMethodsNotSupportedByMostApplications = listOf(TanMethodType.ChipTanUsb) }