Removed unused supportsRetrievingTransactionsOfLast90DaysWithoutTan and triedToRetrieveTransactionsOfLast90DaysWithoutTan
This commit is contained in:
parent
5277438009
commit
49d34f1733
|
@ -297,7 +297,7 @@ open class FinTsClient(
|
||||||
}
|
}
|
||||||
|
|
||||||
accountSupportingRetrievingTransactions.forEach { account ->
|
accountSupportingRetrievingTransactions.forEach { account ->
|
||||||
tryGetTransactionsOfLast90DaysWithoutTan(bank, customer, account, false) { response ->
|
tryGetTransactionsOfLast90DaysWithoutTan(bank, customer, account) { response ->
|
||||||
transactionsOfLast90DaysResponses.add(response)
|
transactionsOfLast90DaysResponses.add(response)
|
||||||
response.balance?.let { balances.put(account, it) }
|
response.balance?.let { balances.put(account, it) }
|
||||||
|
|
||||||
|
@ -336,25 +336,11 @@ open class FinTsClient(
|
||||||
* Check if bank supports this.
|
* Check if bank supports this.
|
||||||
*/
|
*/
|
||||||
open fun tryGetTransactionsOfLast90DaysWithoutTan(bank: BankData, customer: CustomerData, account: AccountData, callback: (GetTransactionsResponse) -> Unit) {
|
open fun tryGetTransactionsOfLast90DaysWithoutTan(bank: BankData, customer: CustomerData, account: AccountData, callback: (GetTransactionsResponse) -> Unit) {
|
||||||
tryGetTransactionsOfLast90DaysWithoutTan(bank, customer, account, false, callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
protected open fun tryGetTransactionsOfLast90DaysWithoutTan(bank: BankData, customer: CustomerData, account: AccountData,
|
|
||||||
hasRetrievedTransactionsWithTanJustBefore: Boolean, callback: (GetTransactionsResponse) -> Unit) {
|
|
||||||
|
|
||||||
val now = Date()
|
val now = Date()
|
||||||
val ninetyDaysAgo = Date(now.millisSinceEpoch - NinetyDaysMillis)
|
val ninetyDaysAgo = Date(now.millisSinceEpoch - NinetyDaysMillis)
|
||||||
|
|
||||||
getTransactionsAsync(GetTransactionsParameter(account.supportsFeature(AccountFeature.RetrieveBalance), ninetyDaysAgo, abortIfTanIsRequired = true), bank, customer, account) { response ->
|
getTransactionsAsync(GetTransactionsParameter(account.supportsFeature(AccountFeature.RetrieveBalance), ninetyDaysAgo, abortIfTanIsRequired = true), bank, customer, account) { response ->
|
||||||
account.triedToRetrieveTransactionsOfLast90DaysWithoutTan = true
|
|
||||||
|
|
||||||
if (response.isSuccessful) {
|
|
||||||
if (response.isStrongAuthenticationRequired == false || hasRetrievedTransactionsWithTanJustBefore) {
|
|
||||||
// TODO: make use of supportsRetrievingTransactionsOfLast90DaysWithoutTan in UI e.g. in updateAccountsTransactionsIfNoTanIsRequiredAsync()
|
|
||||||
account.supportsRetrievingTransactionsOfLast90DaysWithoutTan = !!! response.isStrongAuthenticationRequired
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
callback(response)
|
callback(response)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -410,13 +396,6 @@ open class FinTsClient(
|
||||||
getAndHandleResponseForMessage(message, dialogContext) { response ->
|
getAndHandleResponseForMessage(message, dialogContext) { response ->
|
||||||
closeDialog(dialogContext)
|
closeDialog(dialogContext)
|
||||||
|
|
||||||
|
|
||||||
// just retrieved all transactions -> check if retrieving that ones of last 90 days is possible without entering TAN
|
|
||||||
if (account.supportsRetrievingTransactionsOfLast90DaysWithoutTan == null &&
|
|
||||||
response.successful && bookedTransactions.isNotEmpty() && parameter.fromDate == null) {
|
|
||||||
tryGetTransactionsOfLast90DaysWithoutTan(dialogContext.bank, dialogContext.customer, account, true) { }
|
|
||||||
}
|
|
||||||
|
|
||||||
callback(GetTransactionsResponse(
|
callback(GetTransactionsResponse(
|
||||||
response,
|
response,
|
||||||
bookedTransactions,
|
bookedTransactions,
|
||||||
|
|
|
@ -18,9 +18,7 @@ open class AccountData(
|
||||||
val productName: String?,
|
val productName: String?,
|
||||||
val accountLimit: String?,
|
val accountLimit: String?,
|
||||||
val allowedJobNames: List<String>,
|
val allowedJobNames: List<String>,
|
||||||
var allowedJobs: List<JobParameters> = listOf(),
|
var allowedJobs: List<JobParameters> = listOf()
|
||||||
var supportsRetrievingTransactionsOfLast90DaysWithoutTan: Boolean? = null,
|
|
||||||
var triedToRetrieveTransactionsOfLast90DaysWithoutTan: Boolean = false
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
internal constructor() : this("", null, Laenderkennzeichen.Germany, "", null, "", null, null, "", null, null, listOf()) // for object deserializers
|
internal constructor() : this("", null, Laenderkennzeichen.Germany, "", null, "", null, null, "", null, null, listOf()) // for object deserializers
|
||||||
|
|
Loading…
Reference in New Issue