Made GetTransactionsResponse callback optional

This commit is contained in:
dankito 2020-09-13 02:26:33 +02:00
parent e7d665f588
commit 49db711296
1 changed files with 4 additions and 4 deletions

View File

@ -268,7 +268,7 @@ open class BankingPresenter constructor(
open fun fetchAllAccountTransactionsAsync(customer: TypedCustomer, open fun fetchAllAccountTransactionsAsync(customer: TypedCustomer,
callback: (GetTransactionsResponse) -> Unit) { callback: ((GetTransactionsResponse) -> Unit)? = null) {
customer.accounts.forEach { bankAccount -> customer.accounts.forEach { bankAccount ->
if (bankAccount.supportsRetrievingAccountTransactions) { if (bankAccount.supportsRetrievingAccountTransactions) {
@ -278,13 +278,13 @@ open class BankingPresenter constructor(
} }
open fun fetchAllAccountTransactionsAsync(bankAccount: TypedBankAccount, open fun fetchAllAccountTransactionsAsync(bankAccount: TypedBankAccount,
callback: (GetTransactionsResponse) -> Unit) { callback: ((GetTransactionsResponse) -> Unit)? = null) {
fetchAccountTransactionsAsync(bankAccount, null, false, callback) fetchAccountTransactionsAsync(bankAccount, null, false, callback)
} }
open fun fetchAccountTransactionsAsync(bankAccount: TypedBankAccount, fromDate: Date?, abortIfTanIsRequired: Boolean = false, open fun fetchAccountTransactionsAsync(bankAccount: TypedBankAccount, fromDate: Date?, abortIfTanIsRequired: Boolean = false,
callback: (GetTransactionsResponse) -> Unit) { callback: ((GetTransactionsResponse) -> Unit)? = null) {
getBankingClientForAccount(bankAccount.customer)?.let { client -> getBankingClientForAccount(bankAccount.customer)?.let { client ->
val startDate = Date() val startDate = Date()
@ -295,7 +295,7 @@ open class BankingPresenter constructor(
retrievedAccountTransactions(response, startDate, fromDate == null) retrievedAccountTransactions(response, startDate, fromDate == null)
} }
callback(response) callback?.invoke(response)
} }
} }
} }