From 4d50ded3fa5b9ce1b1d1cf93756beb70de25cced Mon Sep 17 00:00:00 2001 From: dankito Date: Thu, 30 Apr 2020 16:45:17 +0200 Subject: [PATCH] Implemented collecting banks' TAN procedures --- fints4javaLib/bankData/TanProcedures.txt | 94 +++++++++++++++++++ .../bankdetails/BanksFinTsDetailsRetriever.kt | 28 ++++-- 2 files changed, 114 insertions(+), 8 deletions(-) create mode 100644 fints4javaLib/bankData/TanProcedures.txt diff --git a/fints4javaLib/bankData/TanProcedures.txt b/fints4javaLib/bankData/TanProcedures.txt new file mode 100644 index 00000000..3c911b99 --- /dev/null +++ b/fints4javaLib/bankData/TanProcedures.txt @@ -0,0 +1,94 @@ + + +462503 [main] INFO n.d.f.b.BanksFinTsDetailsRetriever - ZkaTanProcedures: HHDOPT1, HHD, BestSign, mobileTAN, HHDUSB1, Secoder_UC, ZkaTANMode, photoTAN, AppTAN, appTAN, mTAN, QRTAN, 1822TAN+ + + +462515 [main] INFO n.d.f.b.BanksFinTsDetailsRetriever - Mapped tanProcedureTypes: [ +ChipTanFlickercode: chipTAN optisch HHD1.3.2 HHDOPT1 HHD1.3.2OPT (Challenge), chipTAN optisch HHD1.4 HHDOPT1 HHD1.4OPT (Challenge), chipTAN comfort HHDOPT1 CR#5 - 1.4 (chipTAN comfort), +Smart-TAN plus optisch / USB HHDOPT1 HHD1.4OPT (Challenge), chipTAN optisch HHDOPT1 HHD1.3.2OPT (TAN-Nummer), SmartTAN optic HHDOPT1 HHD1.3.2OPT (Challenge), SmartTAN optic/USB HHD 1.4 HHDOPT1 HHD1.4OPT (Challenge), +chipTAN (Flicker) HHDOPT1 HHD1.4OPT (Flicker), chipTAN 1.4 HHDOPT1 HHD1.4OPT (Challenge), + +ChipTanManuell: chipTAN manuell HHD1.3.2 HHD HHD1.3.2 (Challenge), chipTAN manuell HHD1.4 HHD HHD1.4 (Challenge), chipTAN comfort manuell HHD CR#6 - 1.4 (chipTAN comfort manuell), +Smart-TAN plus manuell HHD HHD1.4 (Challenge), chipTAN manuell null HHD1.3.0 (TAN-Nummer), Smart-TAN plus HHD SM?@RTTANPLUS2 (Challenge), SmartTAN plus HHD HHD1.3.1 (Challenge), +SmartTAN plus HHD 1.4 HHD HHD1.4 (Challenge), chipTAN (Manuell) HHDOPT1 Manuell (Manuell), chipTAN 1.4 manuell HHD HHD1.4 (Challenge), + +AppTan: BestSign null BestSign (BestSign), BV AppTAN null CR#8 - MS1.0 (BV AppTAN), PhotoTAN null MS1.0.0 (PhotoTAN), photoTAN-Verfahren null MS1.0.0 (Freigabe durch photoTAN), SecureGo mobileTAN SECUREGO (TAN), +pushTAN null pushTAN (TAN-Nummer), flateXSecure null PPTAN (PPTAN), TAN2go null TAN2go (TAN-Nummer), SecureSIGN mobileTAN SECURESIGN (TAN), SecureApp null SecureApp (SecureApp), activeTAN-Verfahren null MS1.0.0 (TAN), +photoTAN appTAN MS1.0.0 (photoTAN), AppTAN appTAN CR#1 (AppTAN), PhotoTAN null CR#7 (PhotoTAN), photoTAN QRcode null photoTAN (TAN-Nummer), easyTAN solution null easyTAN (TAN-Nummer), apoTAN mobileTAN SECURESIGN (TAN), +App-basiertes Verfahren appTAN appTAN (Hinweis), appTAN appTAN appTAN (Challenge), QRTAN null MS1.0.0 (QRTAN), 1822TAN+ null 1822TAN+ (1822TAN+), SecurePlus appTAN MS1.0.0 (Secure Plus TAN), + +SmsTan: mobileTAN mobileTAN mobileTAN (mobileTAN), SMS-TAN null CR#1 (SMS-TAN), mobileTAN-Verfahren null 03 (Freigabe durch mobileTAN), Mobile TAN per SMS mobileTAN mTAN (Hinweis), mobile TAN mobileTAN MTAN2 (SMS), +smsTAN null smsTAN (TAN-Nummer), Mobile-TAN null MTAN (mobileTAN), mobileTAN-Verfahren null TechnicalId901 (Freigabe durch mobileTAN), mTAN null mTAN (mTAN (SMS)), mobileTAN mobileTAN mobileTAN (Uhrzeit), +mTAN-Verfahren null MTAN2 (mTAN), mobileTAN mobileTAN CR#2 (mobileTAN), mobile TAN mobileTAN mTAN (SMS), mTAN mobileTAN mTAN (mTAN), Mobile TAN per SMS mobileTAN smsTAN (Challenge), + +null: iTAN-Verfahren(indizierte TAN) null 01 (indizierte TAN), eTAN mit TAN-Generator null eTAN (Kontrollnummer), Indizierte TAN mit iTAN-Liste null iTAN (Index), iTAN null iTAN (TAN-Nummer), iTAN-Card null CR#3 (TAN), +Keine TAN mobileTAN Keine TAN (Uhrzeit), TAN-Liste null CR#0 (TAN), iTAN null iTAN (Challenge), Vorlagen und Informationen null noTAN (Challenge), iTAN null iTAN (iTAN), + +ChipTanPhotoTanMatrixCode: Smart-TAN photo null MS1.0.0 (Challenge), + +ChipTanUsb: chipTAN-USB null HHD1.3.2USB (TAN-Nummer), + +ChipTanQrCode: chipTAN-QR null Q1S (TAN-Nummer)] + + +462521 [main] INFO n.d.f.b.BanksFinTsDetailsRetriever - TanProcedureParameters:[ +chipTAN optisch HHD1.3.2: 910 HHDOPT1 HHD1.3.2OPT (Challenge), +chipTAN manuell HHD1.3.2: 911 HHD HHD1.3.2 (Challenge), +chipTAN optisch HHD1.4: 912 HHDOPT1 HHD1.4OPT (Challenge), +chipTAN manuell HHD1.4: 913 HHD HHD1.4 (Challenge), +BestSign: 920 null BestSign (BestSign), +mobileTAN: 930 mobileTAN mobileTAN (mobileTAN), 996 mobileTAN mobileTAN (Uhrzeit), 903 mobileTAN CR#2 (mobileTAN), +SMS-TAN: 901 null CR#1 (SMS-TAN), +chipTAN comfort: 904 HHDOPT1 CR#5 - 1.4 (chipTAN comfort), +chipTAN comfort manuell: 905 HHD CR#6 - 1.4 (chipTAN comfort manuell), +BV AppTAN: 906 null CR#8 - MS1.0 (BV AppTAN), +PhotoTAN: 907 null MS1.0.0 (PhotoTAN), 907 null CR#7 (PhotoTAN), +iTAN-Verfahren(indizierte TAN): 900 null 01 (indizierte TAN), +mobileTAN-Verfahren: 903 null 03 (Freigabe durch mobileTAN), 901 null TechnicalId901 (Freigabe durch mobileTAN), +photoTAN-Verfahren: 905 null MS1.0.0 (Freigabe durch photoTAN), 902 null MS1.0.0 (Freigabe durch photoTAN), +eTAN mit TAN-Generator: 900 null eTAN (Kontrollnummer), +Indizierte TAN mit iTAN-Liste: 901 null iTAN (Index), +Mobile TAN per SMS: 902 mobileTAN mTAN (Hinweis), 930 mobileTAN smsTAN (Challenge), +mobile TAN: 942 mobileTAN MTAN2 (SMS), 901 mobileTAN mTAN (SMS), +SecureGo: 944 mobileTAN SECUREGO (TAN), +Smart-TAN plus manuell: 962 HHD HHD1.4 (Challenge), +Smart-TAN plus optisch / USB: 972 HHDOPT1 HHD1.4OPT (Challenge), +Smart-TAN photo: 982 null MS1.0.0 (Challenge), +chipTAN manuell: 910 null HHD1.3.0 (TAN-Nummer), +chipTAN optisch: 911 HHDOPT1 HHD1.3.2OPT (TAN-Nummer), +chipTAN-USB: 912 null HHD1.3.2USB (TAN-Nummer), +chipTAN-QR: 913 null Q1S (TAN-Nummer), +smsTAN: 920 null smsTAN (TAN-Nummer), 921 null smsTAN (TAN-Nummer), +pushTAN: 921 null pushTAN (TAN-Nummer), +iTAN: 900 null iTAN (TAN-Nummer), 900 null iTAN (Challenge), 900 null iTAN (iTAN), +Mobile-TAN: 901 null MTAN (mobileTAN), +iTAN-Card: 906 null CR#3 (TAN), +flateXSecure: 907 null PPTAN (PPTAN), +TAN2go: 921 null TAN2go (TAN-Nummer), +Smart-TAN plus: 922 HHD SM?@RTTANPLUS2 (Challenge), +SmartTAN plus: 932 HHD HHD1.3.1 (Challenge), +SecureSIGN: 944 mobileTAN SECURESIGN (TAN), +SmartTAN optic: 952 HHDOPT1 HHD1.3.2OPT (Challenge), +SmartTAN plus HHD 1.4: 962 HHD HHD1.4 (Challenge), +SmartTAN optic/USB HHD 1.4: 972 HHDOPT1 HHD1.4OPT (Challenge), +mTAN: 901 null mTAN (mTAN (SMS)), 901 mobileTAN mTAN (mTAN), +SecureApp: 902 null SecureApp (SecureApp), +Keine TAN: 997 mobileTAN Keine TAN (Uhrzeit), +chipTAN (Flicker): 995 HHDOPT1 HHD1.4OPT (Flicker), +chipTAN (Manuell): 994 HHDOPT1 Manuell (Manuell), +mTAN-Verfahren: 901 null MTAN2 (mTAN), +activeTAN-Verfahren: 902 null MS1.0.0 (TAN), +TAN-Liste: 900 null CR#0 (TAN), +photoTAN: 901 appTAN MS1.0.0 (photoTAN), +AppTAN: 902 appTAN CR#1 (AppTAN), +photoTAN QRcode: 922 null photoTAN (TAN-Nummer), +easyTAN solution: 923 null easyTAN (TAN-Nummer), +apoTAN: 944 mobileTAN SECURESIGN (TAN), +App-basiertes Verfahren: 906 appTAN appTAN (Hinweis), +chipTAN 1.4: 907 HHDOPT1 HHD1.4OPT (Challenge), +chipTAN 1.4 manuell: 908 HHD HHD1.4 (Challenge), +Vorlagen und Informationen: 909 null noTAN (Challenge), +appTAN: 906 appTAN appTAN (Challenge), +QRTAN: 902 null MS1.0.0 (QRTAN), +1822TAN+: 903 null 1822TAN+ (1822TAN+), +SecurePlus: 900 appTAN MS1.0.0 (Secure Plus TAN)] \ No newline at end of file diff --git a/fints4javaLib/src/test/kotlin/net/dankito/fints/bankdetails/BanksFinTsDetailsRetriever.kt b/fints4javaLib/src/test/kotlin/net/dankito/fints/bankdetails/BanksFinTsDetailsRetriever.kt index 5e8919d3..39db0547 100644 --- a/fints4javaLib/src/test/kotlin/net/dankito/fints/bankdetails/BanksFinTsDetailsRetriever.kt +++ b/fints4javaLib/src/test/kotlin/net/dankito/fints/bankdetails/BanksFinTsDetailsRetriever.kt @@ -6,10 +6,7 @@ import net.dankito.fints.callback.NoOpFinTsClientCallback import net.dankito.fints.messages.MessageBuilder import net.dankito.fints.messages.Separators import net.dankito.fints.messages.datenelemente.implementierte.Dialogsprache -import net.dankito.fints.model.BankData -import net.dankito.fints.model.BankInfo -import net.dankito.fints.model.DialogData -import net.dankito.fints.model.ProductData +import net.dankito.fints.model.* import net.dankito.fints.model.mapper.BankDataMapper import net.dankito.fints.response.Response import net.dankito.fints.response.ResponseParser @@ -55,12 +52,17 @@ class BanksFinTsDetailsRetriever { fun updateBankDataPublic(bank: BankData, response: Response) { super.updateBankData(bank, response) } + + fun mapToTanProcedureTypePublic(parameters: TanProcedureParameters): TanProcedureType? { + return super.mapToTanProcedureType(parameters) + } } private val requestNotSuccessful = mutableListOf() private val tanProcedureParameter = mutableMapOf>() + private val tanProcedureTypes = mutableMapOf>() private val doesNotSupportHKTAN6 = mutableListOf() private val doesNotSupportHKSAL5or7 = mutableListOf() @@ -140,7 +142,8 @@ class BanksFinTsDetailsRetriever { val supportsHKCCS1 = supportsJobInVersion(bank, "HKCCS", 1) val tanInfo = anonymousBankInfoResponse.receivedSegments.filterIsInstance(TanInfo::class.java) - val supportedTanProcedures = tanInfo.flatMap { it.tanProcedureParameters.procedureParameters }.map { it.technicalTanProcedureIdentification } + val tanProcedureParameters = tanInfo.flatMap { it.tanProcedureParameters.procedureParameters } + val supportedTanProcedures = tanProcedureParameters.map { it.technicalTanProcedureIdentification } val hhd13Supported = supportedTanProcedures.firstOrNull { it.startsWith("hhd1.3", true) } != null val hhd14Supported = supportedTanProcedures.firstOrNull { it.startsWith("hhd1.4", true) } != null @@ -175,13 +178,21 @@ class BanksFinTsDetailsRetriever { bank.supportedJobs.joinToString(", ") { it.jobName + " " + it.segmentVersion } ) - tanInfo.flatMap { it.tanProcedureParameters.procedureParameters }.forEach { procedureParameter -> + tanProcedureParameters.forEach { procedureParameter -> if (tanProcedureParameter.containsKey(procedureParameter.procedureName) == false) { tanProcedureParameter.put(procedureParameter.procedureName, mutableSetOf(procedureParameter)) } else { tanProcedureParameter[procedureParameter.procedureName]?.add(procedureParameter) } + + val tanProcedureType = finTsClient.mapToTanProcedureTypePublic(procedureParameter) + if (tanProcedureTypes.containsKey(tanProcedureType) == false) { + tanProcedureTypes.put(tanProcedureType, mutableSetOf(procedureParameter)) + } + else { + tanProcedureTypes[tanProcedureType]?.add(procedureParameter) + } } if (supportsHKTAN6 == false) { @@ -225,8 +236,9 @@ class BanksFinTsDetailsRetriever { private fun printStatistics() { log.info("Did not receive response from Banks ${printBanks(requestNotSuccessful)}") - log.info("ZkaTanProcedures: ${ResponseParser.ZkaTanProcedures.joinToString()}") - log.info("TanProcedureParameters:${tanProcedureParameter.map { System.lineSeparator() + it.key + ": " + it.value.joinToString(", ") { it.securityFunction.code + " " + it.zkaTanProcedure + " " + it.technicalTanProcedureIdentification } } }") + log.info("ZkaTanProcedures: ${ResponseParser.ZkaTanProcedures.joinToString()}\n\n") + log.info("Mapped tanProcedureTypes: ${tanProcedureTypes.map { System.lineSeparator() + it.key + ": " + it.value.map { it.procedureName + " " + it.zkaTanProcedure + " " + it.technicalTanProcedureIdentification + " (" + it.descriptionToShowToUser + ")" }.toSet().joinToString(", ") }}\n\n") + log.info("TanProcedureParameters:${tanProcedureParameter.map { System.lineSeparator() + it.key + ": " + it.value.map { it.securityFunction.code + " " + it.zkaTanProcedure + " " + it.technicalTanProcedureIdentification + " (" + it.descriptionToShowToUser + ")" }.toSet().joinToString(", ") } }\n\n") log.info("Banks supporting HHD 1.3 (${supportsHhd13.size}):${printBanks(supportsHhd13)}") log.info("Banks supporting HHD 1.4 (${supportsHhd14.size}):${printBanks(supportsHhd14)}")