Added tanRequiredButWeWereToldToAbortIfSo to GetTransactionsResponse to not show an error message on UI if a TAN is required but we told client to abort if one is required
This commit is contained in:
parent
a8eb748f57
commit
d94dad345c
|
@ -12,6 +12,7 @@ open class GetTransactionsResponse(
|
||||||
val unbookedTransactions: Map<BankAccount, List<Any>> = mapOf(),
|
val unbookedTransactions: Map<BankAccount, List<Any>> = mapOf(),
|
||||||
val balances: Map<BankAccount, BigDecimal> = mapOf(),
|
val balances: Map<BankAccount, BigDecimal> = mapOf(),
|
||||||
error: Exception? = null,
|
error: Exception? = null,
|
||||||
userCancelledAction: Boolean = false
|
userCancelledAction: Boolean = false,
|
||||||
|
val tanRequiredButWeWereToldToAbortIfSo: Boolean = false
|
||||||
)
|
)
|
||||||
: BankingClientResponse(isSuccessful, errorToShowToUser, error, userCancelledAction)
|
: BankingClientResponse(isSuccessful, errorToShowToUser, error, userCancelledAction)
|
||||||
|
|
|
@ -278,7 +278,9 @@ open class BankingPresenter(
|
||||||
|
|
||||||
client.getTransactionsAsync(bankAccount, GetTransactionsParameter(true, fromDate, null, abortIfTanIsRequired, { receivedAccountsTransactionChunk(bankAccount, it) } )) { response ->
|
client.getTransactionsAsync(bankAccount, GetTransactionsParameter(true, fromDate, null, abortIfTanIsRequired, { receivedAccountsTransactionChunk(bankAccount, it) } )) { response ->
|
||||||
|
|
||||||
retrievedAccountTransactions(bankAccount, startDate, response)
|
if (response.tanRequiredButWeWereToldToAbortIfSo == false) { // don't call retrievedAccountTransactions() if aborted due to TAN required but we told client to abort if so
|
||||||
|
retrievedAccountTransactions(bankAccount, startDate, response)
|
||||||
|
}
|
||||||
|
|
||||||
callback(response)
|
callback(response)
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ open class fints4kModelMapper {
|
||||||
mapOf(bankAccount to mapTransactions(bankAccount, response.bookedTransactions)),
|
mapOf(bankAccount to mapTransactions(bankAccount, response.bookedTransactions)),
|
||||||
mapOf(), // TODO: map unbooked transactions
|
mapOf(), // TODO: map unbooked transactions
|
||||||
response.balance?.let { mapOf(bankAccount to it) } ?: mapOf(),
|
response.balance?.let { mapOf(bankAccount to it) } ?: mapOf(),
|
||||||
response.exception, response.userCancelledAction)
|
response.exception, response.userCancelledAction, response.tanRequiredButWeWereToldToAbortIfSo)
|
||||||
}
|
}
|
||||||
|
|
||||||
open fun mapErrorToShowToUser(response: FinTsClientResponse): String? {
|
open fun mapErrorToShowToUser(response: FinTsClientResponse): String? {
|
||||||
|
|
Loading…
Reference in New Issue