From 5e57d2a49069239145c23f87395d32c5a3cf195c Mon Sep 17 00:00:00 2001 From: dankito Date: Sat, 16 May 2020 13:05:19 +0200 Subject: [PATCH] Added collecting additional information about TanProcedureParameter (to detect HHD version) and other TAN relevant information like setting SMS Abbuchungskonto or Auftraggeberkonto is required --- .../bankdetails/BanksFinTsDetailsRetriever.kt | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/fints4k/src/test/kotlin/net/dankito/fints/bankdetails/BanksFinTsDetailsRetriever.kt b/fints4k/src/test/kotlin/net/dankito/fints/bankdetails/BanksFinTsDetailsRetriever.kt index 8b43b14a..53c828fa 100644 --- a/fints4k/src/test/kotlin/net/dankito/fints/bankdetails/BanksFinTsDetailsRetriever.kt +++ b/fints4k/src/test/kotlin/net/dankito/fints/bankdetails/BanksFinTsDetailsRetriever.kt @@ -7,6 +7,9 @@ import net.dankito.fints.messages.MessageBuilder import net.dankito.fints.messages.MessageBuilderResult import net.dankito.fints.messages.Separators import net.dankito.fints.messages.datenelemente.implementierte.Dialogsprache +import net.dankito.fints.messages.datenelemente.implementierte.tan.AuftraggeberkontoErforderlich +import net.dankito.fints.messages.datenelemente.implementierte.tan.BezeichnungDesTanMediumsErforderlich +import net.dankito.fints.messages.datenelemente.implementierte.tan.SmsAbbuchungskontoErforderlich import net.dankito.fints.model.* import net.dankito.fints.model.mapper.BankDataMapper import net.dankito.fints.response.Response @@ -64,6 +67,16 @@ class BanksFinTsDetailsRetriever { private val tanProcedureParameter = mutableMapOf>() private val tanProcedureTypes = mutableMapOf>() + private val tanProcedureParameterTechnicalIdentification = mutableSetOf() + private val tanProcedureParameterVersionZkaTanProcedure = mutableSetOf() + + private val requiresSmsAbbuchungskonto = mutableListOf() + private val requiresAuftraggeberkonto = mutableListOf() + private val requiresChallengeClass = mutableListOf() + private val signatureStructured = mutableListOf() + private val requiresNameOfTanMedia = mutableListOf() + private val requiresHhdUcResponse = mutableListOf() + private val doesNotSupportHKTAN6 = mutableListOf() private val doesNotSupportHKSAL5or7 = mutableListOf() private val doesNotSupportHKKAZ5to7 = mutableListOf() @@ -193,6 +206,28 @@ class BanksFinTsDetailsRetriever { else { tanProcedureTypes[tanProcedureType]?.add(procedureParameter) } + + tanProcedureParameterTechnicalIdentification.add(procedureParameter.technicalTanProcedureIdentification) + tanProcedureParameterVersionZkaTanProcedure.add(procedureParameter.versionZkaTanProcedure) + + if (procedureParameter.smsDebitAccountRequired == SmsAbbuchungskontoErforderlich.SmsAbbuchungskontoMussAngegebenWerden) { + requiresSmsAbbuchungskonto.add(bankInfo) + } + if (procedureParameter.initiatorAccountRequired == AuftraggeberkontoErforderlich.AuftraggeberkontoMussAngegebenWerdenWennImGeschaeftsvorfallEnthalten) { + requiresAuftraggeberkonto.add(bankInfo) + } + if (procedureParameter.challengeClassRequired) { + requiresChallengeClass.add(bankInfo) + } + if (procedureParameter.signatureStructured) { + signatureStructured.add(bankInfo) + } + if (procedureParameter.nameOfTanMediaRequired == BezeichnungDesTanMediumsErforderlich.BezeichnungDesTanMediumsMussAngegebenWerden) { + requiresNameOfTanMedia.add(bankInfo) + } + if (procedureParameter.hhdUcResponseRequired) { + requiresHhdUcResponse.add(bankInfo) + } } if (supportsHKTAN6 == false) { @@ -239,6 +274,16 @@ class BanksFinTsDetailsRetriever { 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("TanProcedureParameters TechnicalIdentification:${tanProcedureParameterTechnicalIdentification.joinToString(", ") } \n\n") + log.info("TanProcedureParameters VersionZkaTanProcedure:${tanProcedureParameterVersionZkaTanProcedure.joinToString(", ") } \n\n") + + log.info("Requires SmsAbbuchungskonto ${printBanks(requiresSmsAbbuchungskonto)}") // no (only 2) + log.info("Requires Auftraggeberkonto ${printBanks(requiresAuftraggeberkonto)}") // yes, a lot of (12631) + log.info("Requires ChallengeClass ${printBanks(requiresChallengeClass)}") // no + log.info("Has structured signature ${printBanks(signatureStructured)}") // yes, a lot of (12651) + log.info("Requires NameOfTanMedia ${printBanks(requiresNameOfTanMedia)}") // yes, a lot of (912) + log.info("Requires HhdUcResponse ${printBanks(requiresHhdUcResponse)}") // no (only 2) + log.info("Banks supporting HHD 1.3 (${supportsHhd13.size}):${printBanks(supportsHhd13)}") log.info("Banks supporting HHD 1.4 (${supportsHhd14.size}):${printBanks(supportsHhd14)}")