diff --git a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/BankingService.kt b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/BankingService.kt index 508683f..b14b5e8 100644 --- a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/BankingService.kt +++ b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/BankingService.kt @@ -15,6 +15,7 @@ import net.codinux.banking.client.model.request.GetAccountDataRequest import net.codinux.banking.client.model.request.TransferMoneyRequestForUser import net.codinux.banking.client.model.response.* import net.codinux.banking.client.model.securitiesaccount.Holding +import net.codinux.banking.client.model.tan.TanMethodType import net.codinux.banking.client.service.BankingModelService import net.codinux.banking.persistence.BankingRepository import net.codinux.banking.persistence.entities.AccountTransactionEntity @@ -45,6 +46,8 @@ class BankingService( private val bankFinder: BankFinder ) { + private val preferredTanMethods = TanMethodType.NonVisualOrImageBasedOrFlickerCode + private val client = FinTs4kBankingClient(FinTsClientOptions(true, closeDialogs = false), SimpleBankingClientCallback { tanChallenge, callback -> uiState.receivedTanChallenge(tanChallenge, callback) }) @@ -185,7 +188,9 @@ class BankingService( suspend fun addAccount(bank: BankInfo, loginName: String, password: String, retrieveAllTransactions: Boolean = false): Boolean { try { val retrieveTransactions = if (retrieveAllTransactions) RetrieveTransactions.All else RetrieveTransactions.OfLast90Days - val response = client.getAccountDataAsync(GetAccountDataRequest(bank.domesticBankCode, loginName, password, GetAccountDataOptions(retrieveTransactions), mapBankInfo(bank))) + val options = GetAccountDataOptions(retrieveTransactions, preferredTanMethods = preferredTanMethods) + + val response = client.getAccountDataAsync(GetAccountDataRequest(bank.domesticBankCode, loginName, password, options, mapBankInfo(bank))) if (response.type == ResponseType.Success && response.data != null) { handleSuccessfulGetAccountDataResponse(response.data!!) @@ -249,7 +254,7 @@ class BankingService( private suspend fun updateAccountTransactions(bank: BankAccessEntity, bankAccount: BankAccountEntity? = null) { try { - val response = client.updateAccountTransactionsAsync(bank, bankAccount?.let { listOf(it) }) + val response = client.updateAccountTransactionsAsync(bank, bankAccount?.let { listOf(it) }, preferredTanMethods) handleCommonBankingClientResponseValues(response) @@ -419,7 +424,8 @@ class BankingService( bank, account, recipientName, recipientAccountIdentifier, recipientBankIdentifier, amount, "EUR", - paymentReference, instantTransfer + paymentReference, instantTransfer, + preferredTanMethods )) handleCommonBankingClientResponseValues(response) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9820d06..3dd2a4f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ kotlin = "2.0.10" kotlinx-coroutines = "1.8.1" -banking-client = "0.7.0" +banking-client = "0.7.1" epcqrcode = "0.5.0" kcsv = "2.2.0"