Removed -Async() methods with coroutines as methods now become (except on iOS) async through IWebClient

This commit is contained in:
dankito 2020-07-15 22:13:54 +02:00
parent a9b8848379
commit 3b3ada38ca
2 changed files with 1 additions and 36 deletions

View File

@ -205,13 +205,6 @@ open class FinTsClient(
open fun addAccountAsync(bank: BankData, customer: CustomerData, open fun addAccountAsync(bank: BankData, customer: CustomerData,
callback: (AddAccountResponse) -> Unit) { callback: (AddAccountResponse) -> Unit) {
GlobalScope.launch {
addAccount(bank, customer, callback)
}
}
open fun addAccount(bank: BankData, customer: CustomerData, callback: (AddAccountResponse) -> Unit) {
val originalAreWeThatGentleToCloseDialogs = areWeThatGentleToCloseDialogs val originalAreWeThatGentleToCloseDialogs = areWeThatGentleToCloseDialogs
areWeThatGentleToCloseDialogs = false areWeThatGentleToCloseDialogs = false
@ -307,7 +300,7 @@ open class FinTsClient(
val now = Date() val now = Date()
val ninetyDaysAgo = Date(now.millisSinceEpoch - NinetyDaysMillis) val ninetyDaysAgo = Date(now.millisSinceEpoch - NinetyDaysMillis)
getTransactions(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 account.triedToRetrieveTransactionsOfLast90DaysWithoutTan = true
if (response.isSuccessful) { if (response.isSuccessful) {
@ -324,14 +317,6 @@ open class FinTsClient(
open fun getTransactionsAsync(parameter: GetTransactionsParameter, bank: BankData, open fun getTransactionsAsync(parameter: GetTransactionsParameter, bank: BankData,
customer: CustomerData, account: AccountData, callback: (GetTransactionsResponse) -> Unit) { customer: CustomerData, account: AccountData, callback: (GetTransactionsResponse) -> Unit) {
GlobalScope.launch {
getTransactions(parameter, bank, customer, account, callback)
}
}
open fun getTransactions(parameter: GetTransactionsParameter, bank: BankData,
customer: CustomerData, account: AccountData, callback: (GetTransactionsResponse) -> Unit) {
val dialogContext = DialogContext(bank, customer, product) val dialogContext = DialogContext(bank, customer, product)
initDialog(dialogContext) { initDialogResponse -> initDialog(dialogContext) { initDialogResponse ->
@ -464,14 +449,6 @@ open class FinTsClient(
open fun doBankTransferAsync(bankTransferData: BankTransferData, bank: BankData, open fun doBankTransferAsync(bankTransferData: BankTransferData, bank: BankData,
customer: CustomerData, account: AccountData, callback: (FinTsClientResponse) -> Unit) { customer: CustomerData, account: AccountData, callback: (FinTsClientResponse) -> Unit) {
GlobalScope.launch {
doBankTransfer(bankTransferData, bank, customer, account, callback)
}
}
open fun doBankTransfer(bankTransferData: BankTransferData, bank: BankData,
customer: CustomerData, account: AccountData, callback: (FinTsClientResponse) -> Unit) {
sendMessageAndHandleResponse(bank, customer, true, { dialogContext -> sendMessageAndHandleResponse(bank, customer, true, { dialogContext ->
messageBuilder.createBankTransferMessage(bankTransferData, account, dialogContext) messageBuilder.createBankTransferMessage(bankTransferData, account, dialogContext)
}) { response -> }) { response ->

View File

@ -38,26 +38,14 @@ open class FinTsClientForCustomer(
client.addAccountAsync(bank, customer, callback) client.addAccountAsync(bank, customer, callback)
} }
open fun addAccount(callback: (AddAccountResponse) -> Unit) {
client.addAccount(bank, customer, callback)
}
open fun getTransactionsAsync(parameter: GetTransactionsParameter, account: AccountData, callback: (GetTransactionsResponse) -> Unit) { open fun getTransactionsAsync(parameter: GetTransactionsParameter, account: AccountData, callback: (GetTransactionsResponse) -> Unit) {
client.getTransactionsAsync(parameter, bank, customer, account, callback) client.getTransactionsAsync(parameter, bank, customer, account, callback)
} }
open fun getTransactions(parameter: GetTransactionsParameter, account: AccountData, callback: (GetTransactionsResponse) -> Unit) {
client.getTransactions(parameter, bank, customer, account, callback)
}
open fun doBankTransferAsync(bankTransferData: BankTransferData, account: AccountData, callback: (FinTsClientResponse) -> Unit) { open fun doBankTransferAsync(bankTransferData: BankTransferData, account: AccountData, callback: (FinTsClientResponse) -> Unit) {
client.doBankTransferAsync(bankTransferData, bank, customer, account, callback) client.doBankTransferAsync(bankTransferData, bank, customer, account, callback)
} }
open fun doBankTransfer(bankTransferData: BankTransferData, account: AccountData, callback: (FinTsClientResponse) -> Unit) {
client.doBankTransfer(bankTransferData, bank, customer, account, callback)
}
} }