diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt index 0589e34d..0c6dcfc0 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt @@ -17,7 +17,7 @@ import net.dankito.utils.multiplatform.Date * [addAccountAsync] gets user's TAN methods, user's TAN media, user's bank accounts and may even current balance and account transactions of last 90 days. */ open class FinTsClient( - protected open val jobExecutor: FinTsJobExecutor + protected open val jobExecutor: FinTsJobExecutor // TODO: recreate when callback is set to avoid multithreading issues - but use its configured instances like RequestExecutor ) { companion object { @@ -31,6 +31,10 @@ open class FinTsClient( open val messageLogWithoutSensitiveData: List get() = jobExecutor.messageLogWithoutSensitiveData + open fun setCallback(callback: FinTsClientCallback) { + jobExecutor.callback = callback + } + /** * Retrieves information about bank (e.g. supported HBCI versions, FinTS server address, diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClientForCustomer.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClientForCustomer.kt index ff252059..d235cc23 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClientForCustomer.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClientForCustomer.kt @@ -36,6 +36,10 @@ open class FinTsClientForCustomer( open val messageLogWithoutSensitiveData: List get() = client.messageLogWithoutSensitiveData + open fun setCallback(callback: FinTsClientCallback) { + client.setCallback(callback) + } + open fun addAccountAsync(callback: (AddAccountResponse) -> Unit) { addAccountAsync(bank.toAddAccountParameter(), callback) diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsJobExecutor.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsJobExecutor.kt index 202b220f..1cd27e7f 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsJobExecutor.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsJobExecutor.kt @@ -31,7 +31,7 @@ import net.dankito.utils.multiplatform.ObjectReference * In almost all cases you want to use [FinTsClient] which wraps these business transactions to a higher level API. */ open class FinTsJobExecutor( - protected open val callback: FinTsClientCallback, + open var callback: FinTsClientCallback, protected open val requestExecutor: RequestExecutor = RequestExecutor(), protected open val messageBuilder: MessageBuilder = MessageBuilder(), protected open val mt940Parser: IAccountTransactionsParser = Mt940AccountTransactionsParser(),