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 584176f7..9d05d14b 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 @@ -36,6 +36,8 @@ open class GetAccountDataOptions( */ val preferredTanMethods: List? = TanMethodType.NonVisualOrImageBased, + val tanMethodsNotSupportedByApplication: List = TanMethodType.TanMethodsNotSupportedByMostApplications, + val abortIfTanIsRequired: Boolean = false, // there's also the option preferredTanMedium, but can hardly find a use case for it as we 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 82aa3854..e12535ad 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,9 @@ 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.NonVisualOrImageBased, + + val tanMethodsNotSupportedByApplication: List = TanMethodType.TanMethodsNotSupportedByMostApplications ) { override fun toString() = "$amount to $recipientName - $paymentReference" } \ No newline at end of file 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 5133699c..4b81b477 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 @@ -37,12 +37,13 @@ open class TransferMoneyRequestForUser( instantTransfer: Boolean = false, - preferredTanMethods: List? = TanMethodType.NonVisualOrImageBased -) : TransferMoneyRequest(senderAccount, recipientName, recipientAccountIdentifier, recipientBankIdentifier, amount, currency, paymentReference, instantTransfer, preferredTanMethods) { + preferredTanMethods: List? = TanMethodType.NonVisualOrImageBased, + tanMethodsNotSupportedByApplication: List = TanMethodType.TanMethodsNotSupportedByMostApplications, +) : TransferMoneyRequest(senderAccount, recipientName, recipientAccountIdentifier, recipientBankIdentifier, amount, currency, paymentReference, instantTransfer, preferredTanMethods, tanMethodsNotSupportedByApplication) { constructor(bankCode: String, loginName: String, password: String, request: TransferMoneyRequest) : this(bankCode, loginName, password, request.senderAccount, request.recipientName, request.recipientAccountIdentifier, request.recipientBankIdentifier, - request.amount, request.currency, request.paymentReference, request.instantTransfer, request.preferredTanMethods) + request.amount, request.currency, request.paymentReference, request.instantTransfer, request.preferredTanMethods, request.tanMethodsNotSupportedByApplication) override fun toString() = "$bankCode $loginName ${super.toString()}" } \ No newline at end of file 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 377e890e..b75893ef 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 @@ -43,6 +43,8 @@ enum class TanMethodType { addAll(listOf(TanMethodType.ChipTanManuell)) // this is quite inconvenient for user, so i added it as last } + val TanMethodsNotSupportedByMostApplications = listOf(TanMethodType.ChipTanUsb) + } } \ No newline at end of file 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 becdf1c3..d32ae5da 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 @@ -46,6 +46,7 @@ open class FinTs4kMapper { options.retrieveBalance, RetrieveTransactions.valueOf(options.retrieveTransactions.name), options.retrieveTransactionsFrom, options.retrieveTransactionsTo, preferredTanMethods = options.preferredTanMethods?.map { mapTanMethodType(it) }, + tanMethodsNotSupportedByApplication = options.tanMethodsNotSupportedByApplication.map { mapTanMethodType(it) }, abortIfTanIsRequired = options.abortIfTanIsRequired, defaultBankValues = request.bankInfo?.let { mapToBankData(request, it) } ) @@ -306,7 +307,8 @@ open class FinTs4kMapper { request.bankCode, request.loginName, request.password, request.senderAccount?.let { mapBankAccountIdentifier(it) }, request.recipientName, request.recipientAccountIdentifier, request.recipientBankIdentifier, mapToMoney(request.amount, request.currency), request.paymentReference, request.instantTransfer, - request.preferredTanMethods?.map { mapTanMethodType(it) } + request.preferredTanMethods?.map { mapTanMethodType(it) }, + request.tanMethodsNotSupportedByApplication.map { mapTanMethodType(it) } ) open fun mapTransferMoneyResponse(response: net.dankito.banking.client.model.response.TransferMoneyResponse): Response =