Making use of supportXyz convenience properties
This commit is contained in:
parent
395ef5445c
commit
dee6f4aebe
|
@ -301,7 +301,7 @@ open class FinTsClient(
|
||||||
|
|
||||||
val retrievedAccountData = bank.accounts.associateBy( { it }, { RetrievedAccountData.unsuccessful(it) } ).toMutableMap()
|
val retrievedAccountData = bank.accounts.associateBy( { it }, { RetrievedAccountData.unsuccessful(it) } ).toMutableMap()
|
||||||
|
|
||||||
val accountsSupportingRetrievingTransactions = bank.accounts.filter { it.supportsFeature(AccountFeature.RetrieveBalance) || it.supportsFeature(AccountFeature.RetrieveAccountTransactions) }
|
val accountsSupportingRetrievingTransactions = bank.accounts.filter { it.supportsRetrievingBalance || it.supportsRetrievingAccountTransactions }
|
||||||
val countAccountsSupportingRetrievingTransactions = accountsSupportingRetrievingTransactions.size
|
val countAccountsSupportingRetrievingTransactions = accountsSupportingRetrievingTransactions.size
|
||||||
var countRetrievedAccounts = 0
|
var countRetrievedAccounts = 0
|
||||||
|
|
||||||
|
@ -347,7 +347,7 @@ open class FinTsClient(
|
||||||
|
|
||||||
val ninetyDaysAgo = Date(Date.today.millisSinceEpoch - NinetyDaysMillis)
|
val ninetyDaysAgo = Date(Date.today.millisSinceEpoch - NinetyDaysMillis)
|
||||||
|
|
||||||
getTransactionsAsync(GetTransactionsParameter(account, account.supportsFeature(AccountFeature.RetrieveBalance), ninetyDaysAgo, abortIfTanIsRequired = true), bank) { response ->
|
getTransactionsAsync(GetTransactionsParameter(account, account.supportsRetrievingBalance, ninetyDaysAgo, abortIfTanIsRequired = true), bank) { response ->
|
||||||
callback(response)
|
callback(response)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -416,7 +416,7 @@ open class FinTsClient(
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun mayGetBalance(parameter: GetTransactionsParameter, dialogContext: DialogContext, callback: (BankResponse) -> Unit) {
|
protected open fun mayGetBalance(parameter: GetTransactionsParameter, dialogContext: DialogContext, callback: (BankResponse) -> Unit) {
|
||||||
if (parameter.alsoRetrieveBalance && parameter.account.supportsFeature(AccountFeature.RetrieveBalance)) {
|
if (parameter.alsoRetrieveBalance && parameter.account.supportsRetrievingBalance) {
|
||||||
val message = messageBuilder.createGetBalanceMessage(parameter.account, dialogContext)
|
val message = messageBuilder.createGetBalanceMessage(parameter.account, dialogContext)
|
||||||
|
|
||||||
getAndHandleResponseForMessage(message, dialogContext) { response ->
|
getAndHandleResponseForMessage(message, dialogContext) { response ->
|
||||||
|
|
|
@ -124,10 +124,10 @@ open class fints4kModelMapper(protected val modelCreator: IModelCreator) {
|
||||||
account.productName = accountData.productName
|
account.productName = accountData.productName
|
||||||
account.accountLimit = accountData.accountLimit
|
account.accountLimit = accountData.accountLimit
|
||||||
|
|
||||||
account.supportsRetrievingBalance = accountData.supportsFeature(AccountFeature.RetrieveBalance)
|
account.supportsRetrievingBalance = accountData.supportsRetrievingBalance
|
||||||
account.supportsRetrievingAccountTransactions = accountData.supportsFeature(AccountFeature.RetrieveAccountTransactions)
|
account.supportsRetrievingAccountTransactions = accountData.supportsRetrievingAccountTransactions
|
||||||
account.supportsTransferringMoney = accountData.supportsFeature(AccountFeature.TransferMoney)
|
account.supportsTransferringMoney = accountData.supportsTransferringMoney
|
||||||
account.supportsInstantPaymentMoneyTransfer = accountData.supportsFeature(AccountFeature.InstantPayment)
|
account.supportsInstantPaymentMoneyTransfer = accountData.supportsInstantPaymentMoneyTransfer
|
||||||
}
|
}
|
||||||
|
|
||||||
open fun mapBankAccountType(type: AccountType?): BankAccountType {
|
open fun mapBankAccountType(type: AccountType?): BankAccountType {
|
||||||
|
|
Loading…
Reference in New Issue