Updated BankingClient version to 0.7.1; implemented passing preferredTanMethods to BankingClient

This commit is contained in:
dankito 2024-10-17 23:30:01 +02:00
parent 350a18c2a3
commit 6af5ef2529
2 changed files with 10 additions and 4 deletions

View File

@ -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)

View File

@ -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"