Added getUsersTanMethod() to retrieveBasicDataLikeUsersTanMethods() so that it's callers don't have to do this
This commit is contained in:
parent
4d3c1aece3
commit
cb25a2294a
|
@ -74,22 +74,14 @@ open class FinTsClient(
|
|||
return@retrieveBasicDataLikeUsersTanMethods
|
||||
}
|
||||
|
||||
jobExecutor.getUsersTanMethod(bank) { didSelectTanMethod ->
|
||||
/* Second dialog: some banks require that in order to initialize a dialog with strong customer authorization TAN media is required */
|
||||
|
||||
if (didSelectTanMethod == false) {
|
||||
callback(AddAccountResponse(BankResponse(false), bank))
|
||||
return@getUsersTanMethod
|
||||
}
|
||||
|
||||
/* Second dialog: some banks require that in order to initialize a dialog with strong customer authorization TAN media is required */
|
||||
|
||||
if (jobExecutor.isJobSupported(bank, CustomerSegmentId.TanMediaList)) {
|
||||
getTanMediaList(bank, TanMedienArtVersion.Alle, TanMediumKlasse.AlleMedien) {
|
||||
addAccountGetAccountsAndTransactions(parameter, bank, callback)
|
||||
}
|
||||
} else {
|
||||
if (jobExecutor.isJobSupported(bank, CustomerSegmentId.TanMediaList)) {
|
||||
getTanMediaList(bank, TanMedienArtVersion.Alle, TanMediumKlasse.AlleMedien) {
|
||||
addAccountGetAccountsAndTransactions(parameter, bank, callback)
|
||||
}
|
||||
} else {
|
||||
addAccountGetAccountsAndTransactions(parameter, bank, callback)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -110,7 +110,15 @@ open class FinTsJobExecutor(
|
|||
getAndHandleResponseForMessage(message, dialogContext) { response ->
|
||||
closeDialog(dialogContext)
|
||||
|
||||
handleGetUsersTanMethodsResponse(response, dialogContext, callback)
|
||||
handleGetUsersTanMethodsResponse(response, dialogContext) { getTanMethodsResponse ->
|
||||
if (bank.tanMethodsAvailableForUser.isEmpty()) { // could not retrieve supported tan methods for user
|
||||
callback(BankResponse(false, noTanMethodSelected = true))
|
||||
} else {
|
||||
getUsersTanMethod(bank) {
|
||||
callback(BankResponse(bank.isTanMethodSelected, noTanMethodSelected = !!!bank.isTanMethodSelected))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -632,15 +640,8 @@ open class FinTsJobExecutor(
|
|||
protected open fun ensureTanMethodIsSelected(bank: BankData, callback: (BankResponse) -> Unit) {
|
||||
if (bank.isTanMethodSelected == false) {
|
||||
if (bank.tanMethodsAvailableForUser.isEmpty()) {
|
||||
retrieveBasicDataLikeUsersTanMethods(bank) {
|
||||
if (bank.tanMethodsAvailableForUser.isEmpty()) { // could not retrieve supported tan methods for user
|
||||
callback(BankResponse(false, noTanMethodSelected = true))
|
||||
}
|
||||
else {
|
||||
getUsersTanMethod(bank) {
|
||||
callback(BankResponse(bank.isTanMethodSelected, noTanMethodSelected = !!!bank.isTanMethodSelected))
|
||||
}
|
||||
}
|
||||
retrieveBasicDataLikeUsersTanMethods(bank) { retrieveBasicDataResponse ->
|
||||
callback(retrieveBasicDataResponse)
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in New Issue