Re-added TAN procedure types photoTan and QrCode as we need to display their images (TODO: how to decode their images?)

This commit is contained in:
dankito 2020-05-04 13:33:18 +02:00
parent 35572a0906
commit bf6d7b9896
6 changed files with 24 additions and 6 deletions

View File

@ -17,5 +17,10 @@ enum class TanProcedureType {
SmsTan,
AppTan
AppTan,
photoTan,
QrCode
}

View File

@ -30,7 +30,8 @@ import javax.inject.Inject
open class EnterTanDialog : DialogFragment() {
companion object {
val OpticalTanProcedures = listOf(TanProcedureType.ChipTanFlickercode, TanProcedureType.ChipTanQrCode, TanProcedureType.ChipTanPhotoTanMatrixCode)
val OpticalTanProcedures = listOf(TanProcedureType.ChipTanFlickercode, TanProcedureType.ChipTanQrCode,
TanProcedureType.ChipTanPhotoTanMatrixCode, TanProcedureType.photoTan, TanProcedureType.QrCode)
const val DialogTag = "EnterTanDialog"
}

View File

@ -223,6 +223,8 @@ open class fints4javaModelMapper {
net.dankito.fints.model.TanProcedureType.ChipTanPhotoTanMatrixCode -> TanProcedureType.ChipTanPhotoTanMatrixCode
net.dankito.fints.model.TanProcedureType.SmsTan -> TanProcedureType.SmsTan
net.dankito.fints.model.TanProcedureType.AppTan -> TanProcedureType.AppTan
net.dankito.fints.model.TanProcedureType.photoTan -> TanProcedureType.photoTan
net.dankito.fints.model.TanProcedureType.QrCode -> TanProcedureType.QrCode
}
}
@ -332,6 +334,8 @@ open class fints4javaModelMapper {
TanProcedureType.ChipTanPhotoTanMatrixCode -> net.dankito.fints.model.TanProcedureType.ChipTanPhotoTanMatrixCode
TanProcedureType.SmsTan -> net.dankito.fints.model.TanProcedureType.SmsTan
TanProcedureType.AppTan -> net.dankito.fints.model.TanProcedureType.AppTan
TanProcedureType.photoTan -> net.dankito.fints.model.TanProcedureType.photoTan
TanProcedureType.QrCode -> net.dankito.fints.model.TanProcedureType.QrCode
}
}

View File

@ -695,12 +695,15 @@ open class FinTsClient @JvmOverloads constructor(
val tanProcedure = customer.selectedTanProcedure
return when (tanProcedure.type) {
TanProcedureType.ChipTanFlickercode, TanProcedureType.ChipTanManuell ->
TanProcedureType.ChipTanFlickercode, TanProcedureType.ChipTanManuell, TanProcedureType.ChipTanUsb ->
FlickerCodeTanChallenge(FlickerCodeDecoder().decodeChallenge(challenge), messageToShowToUser, challenge, tanProcedure, tanResponse.tanMediaIdentifier)
TanProcedureType.ChipTanQrCode, TanProcedureType.ChipTanPhotoTanMatrixCode ->
ImageTanChallenge(TanImageDecoder().decodeChallenge(challenge), messageToShowToUser, challenge, tanProcedure, tanResponse.tanMediaIdentifier)
TanProcedureType.QrCode, TanProcedureType.photoTan -> // TODO: how do these TAN procedures work? i don't think they use the HHD format
ImageTanChallenge(TanImageDecoder().decodeChallenge(challenge), messageToShowToUser, challenge, tanProcedure, tanResponse.tanMediaIdentifier)
else -> TanChallenge(messageToShowToUser, challenge, tanProcedure, tanResponse.tanMediaIdentifier)
}
}
@ -935,7 +938,7 @@ open class FinTsClient @JvmOverloads constructor(
// QRTAN+ from 1822 direct has nothing to do with chipTAN QR.
name.contains("qr") -> {
if (tanProcedureNameContains(name, "chipTAN", "Smart")) TanProcedureType.ChipTanQrCode
else TanProcedureType.AppTan
else TanProcedureType.QrCode
}
// photoTAN from Commerzbank (comdirect), Deutsche Bank, norisbank has nothing to do with chipTAN photo
@ -943,7 +946,7 @@ open class FinTsClient @JvmOverloads constructor(
// e.g. 'Smart-TAN photo' / description 'Challenge'
if (tanProcedureNameContains(name, "chipTAN", "Smart")) TanProcedureType.ChipTanPhotoTanMatrixCode
// e.g. 'photoTAN-Verfahren', description 'Freigabe durch photoTAN'
else TanProcedureType.AppTan
else TanProcedureType.photoTan
}
tanProcedureNameContains(name, "SMS", "mobile", "mTAN") -> TanProcedureType.SmsTan

View File

@ -17,6 +17,10 @@ enum class TanProcedureType {
SmsTan,
AppTan
AppTan,
photoTan,
QrCode
}

View File

@ -83,6 +83,7 @@ open class hbci4jModelMapper {
val displayNameLowerCase = displayName.toLowerCase()
return when {
// TODO: implement all TAN procedures
displayNameLowerCase.contains("chiptan") -> {
if (displayNameLowerCase.contains("qr")) {
net.dankito.banking.ui.model.tan.TanProcedure(displayName, TanProcedureType.ChipTanQrCode, code)