Implemented that () returns if a TAN method got selected
This commit is contained in:
parent
eee073fe3b
commit
df4c8c4a1a
|
@ -183,7 +183,8 @@ open class FinTsClient(
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bank.tanMethodsAvailableForUser = bank.tanMethodSupportedByBank
|
bank.tanMethodsAvailableForUser = bank.tanMethodSupportedByBank
|
||||||
getUsersTanMethod(bank) {
|
getUsersTanMethod(bank) { didSelectTanMethod ->
|
||||||
|
if (didSelectTanMethod) {
|
||||||
val dialogContext = DialogContext(bank, product)
|
val dialogContext = DialogContext(bank, product)
|
||||||
|
|
||||||
initDialogWithStrongCustomerAuthenticationAfterSuccessfulPreconditionChecks(dialogContext) { initDialogResponse ->
|
initDialogWithStrongCustomerAuthenticationAfterSuccessfulPreconditionChecks(dialogContext) { initDialogResponse ->
|
||||||
|
@ -192,6 +193,10 @@ open class FinTsClient(
|
||||||
callback(initDialogResponse)
|
callback(initDialogResponse)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
callback(BankResponse(false))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -255,7 +260,12 @@ open class FinTsClient(
|
||||||
return@getUsersTanMethodsInternal
|
return@getUsersTanMethodsInternal
|
||||||
}
|
}
|
||||||
|
|
||||||
getUsersTanMethod(bank) {
|
getUsersTanMethod(bank) { didSelectTanMethod ->
|
||||||
|
|
||||||
|
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 */
|
/* Second dialog: some banks require that in order to initialize a dialog with strong customer authorization TAN media is required */
|
||||||
|
|
||||||
|
@ -641,17 +651,20 @@ open class FinTsClient(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun getUsersTanMethod(bank: BankData, done: () -> Unit) {
|
protected open fun getUsersTanMethod(bank: BankData, done: (Boolean) -> Unit) {
|
||||||
if (bank.tanMethodsAvailableForUser.size == 1) { // user has only one TAN method -> set it and we're done
|
if (bank.tanMethodsAvailableForUser.size == 1) { // user has only one TAN method -> set it and we're done
|
||||||
bank.selectedTanMethod = bank.tanMethodsAvailableForUser.first()
|
bank.selectedTanMethod = bank.tanMethodsAvailableForUser.first()
|
||||||
done()
|
done(true)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// we know user's supported tan methods, now ask user which one to select
|
// we know user's supported tan methods, now ask user which one to select
|
||||||
callback.askUserForTanMethod(bank.tanMethodsAvailableForUser, selectSuggestedTanMethod(bank)) { selectedTanMethod ->
|
callback.askUserForTanMethod(bank.tanMethodsAvailableForUser, selectSuggestedTanMethod(bank)) { selectedTanMethod ->
|
||||||
selectedTanMethod?.let {
|
if (selectedTanMethod != null) {
|
||||||
bank.selectedTanMethod = selectedTanMethod
|
bank.selectedTanMethod = selectedTanMethod
|
||||||
done()
|
done(true)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
done(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue