Made callback settable (required for fints4kRest
This commit is contained in:
parent
bc7733f618
commit
356b0f7823
|
@ -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<MessageLogEntry>
|
||||
get() = jobExecutor.messageLogWithoutSensitiveData
|
||||
|
||||
open fun setCallback(callback: FinTsClientCallback) {
|
||||
jobExecutor.callback = callback
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves information about bank (e.g. supported HBCI versions, FinTS server address,
|
||||
|
|
|
@ -36,6 +36,10 @@ open class FinTsClientForCustomer(
|
|||
open val messageLogWithoutSensitiveData: List<MessageLogEntry>
|
||||
get() = client.messageLogWithoutSensitiveData
|
||||
|
||||
open fun setCallback(callback: FinTsClientCallback) {
|
||||
client.setCallback(callback)
|
||||
}
|
||||
|
||||
|
||||
open fun addAccountAsync(callback: (AddAccountResponse) -> Unit) {
|
||||
addAccountAsync(bank.toAddAccountParameter(), callback)
|
||||
|
|
|
@ -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(),
|
||||
|
|
Loading…
Reference in New Issue