Fixed selectSuggestedTanProcedure() so that SmsTan(costs money) or ChipTanUSB (not supported) don't get selected by default

This commit is contained in:
dankito 2020-06-08 23:39:09 +02:00
parent 2afeaa9073
commit 2f4bac9fbf
1 changed files with 4 additions and 2 deletions

View File

@ -527,8 +527,10 @@ open class FinTsClient(
} }
protected open fun selectSuggestedTanProcedure(customer: CustomerData): TanProcedure? { protected open fun selectSuggestedTanProcedure(customer: CustomerData): TanProcedure? {
return customer.supportedTanProcedures.firstOrNull { it.displayName.contains("manuell", true) == false } return customer.supportedTanProcedures.firstOrNull { it.type != TanProcedureType.ChipTanUsb && it.type != TanProcedureType.SmsTan && it.type != TanProcedureType.ChipTanManuell }
?: customer.supportedTanProcedures.firstOrNull() ?: customer.supportedTanProcedures.firstOrNull { it.type != TanProcedureType.ChipTanUsb && it.type != TanProcedureType.SmsTan }
?: customer.supportedTanProcedures.firstOrNull { it.type != TanProcedureType.ChipTanUsb }
?: customer.supportedTanProcedures.firstOrNull()
} }