Added case insensitive detection of appTAN and mobileTAN; added detection for 'mTAN' as mobileTAN; logging if a ZkaTanProcedure couldn't get mapped; not trying to map empty values

This commit is contained in:
dankito 2020-04-30 02:25:06 +02:00
parent 1105dfbed0
commit db129863e6
1 changed files with 20 additions and 1 deletions

View File

@ -379,9 +379,28 @@ open class ResponseParser @JvmOverloads constructor(
}
protected open fun tryToParseZkaTanProcedure(mayZkaTanProcedure: String): ZkaTanProcedure? {
if (mayZkaTanProcedure.isBlank()) {
return null
}
try {
val lowerCaseMayZkaTanProcedure = mayZkaTanProcedure.toLowerCase()
if (lowerCaseMayZkaTanProcedure == "mobiletan" || lowerCaseMayZkaTanProcedure == "mtan") {
return ZkaTanProcedure.mobileTAN
}
if (lowerCaseMayZkaTanProcedure == "apptan") {
return ZkaTanProcedure.appTAN
}
// TODO: what about these values, all returned by banks in anonymous dialog initialization:
// BestSign, HHDUSB1, Secoder_UC, ZkaTANMode, photoTAN, QRTAN, 1822TAN+
return ZkaTanProcedure.valueOf(mayZkaTanProcedure)
} catch (ignored: Exception) { }
} catch (e: Exception) {
log.warn("'$mayZkaTanProcedure' could not be mapped to ZkaTanProcedure")
}
return null
}