diff --git a/fints4k/src/main/kotlin/net/dankito/fints/FinTsClient.kt b/fints4k/src/main/kotlin/net/dankito/fints/FinTsClient.kt index 72d7cffd..19de8ef8 100644 --- a/fints4k/src/main/kotlin/net/dankito/fints/FinTsClient.kt +++ b/fints4k/src/main/kotlin/net/dankito/fints/FinTsClient.kt @@ -938,7 +938,7 @@ open class FinTsClient @JvmOverloads constructor( } return TanProcedure(procedureName, parameters.securityFunction, - mapToTanProcedureType(parameters) ?: TanProcedureType.EnterTan) + mapToTanProcedureType(parameters) ?: TanProcedureType.EnterTan, mapHhdVersion(parameters)) } protected open fun mapToTanProcedureType(parameters: TanProcedureParameters): TanProcedureType? { @@ -987,6 +987,16 @@ open class FinTsClient @JvmOverloads constructor( } } + protected open fun mapHhdVersion(parameters: TanProcedureParameters): HHDVersion? { + return when { + technicalTanProcedureIdentificationContains(parameters, "HHD1.4") -> HHDVersion.HHD_1_4 + technicalTanProcedureIdentificationContains(parameters, "HHD1.3") -> HHDVersion.HHD_1_3 + parameters.versionZkaTanProcedure?.contains("1.4") == true -> HHDVersion.HHD_1_4 + parameters.versionZkaTanProcedure?.contains("1.3") == true -> HHDVersion.HHD_1_4 + else -> null + } + } + protected open fun tanProcedureNameContains(name: String, vararg namesToTest: String): Boolean { namesToTest.forEach { nameToTest -> if (name.contains(nameToTest.toLowerCase())) { @@ -1007,6 +1017,7 @@ open class FinTsClient @JvmOverloads constructor( return false } + protected open fun isJobSupported(account: AccountData, supportedJob: JobParameters): Boolean { for (allowedJobName in account.allowedJobNames) { if (allowedJobName == supportedJob.jobName) { diff --git a/fints4k/src/main/kotlin/net/dankito/fints/model/HHDVersion.kt b/fints4k/src/main/kotlin/net/dankito/fints/model/HHDVersion.kt new file mode 100644 index 00000000..287eb8ec --- /dev/null +++ b/fints4k/src/main/kotlin/net/dankito/fints/model/HHDVersion.kt @@ -0,0 +1,10 @@ +package net.dankito.fints.model + + +enum class HHDVersion { + + HHD_1_3, + + HHD_1_4 + +} \ No newline at end of file diff --git a/fints4k/src/main/kotlin/net/dankito/fints/model/TanProcedure.kt b/fints4k/src/main/kotlin/net/dankito/fints/model/TanProcedure.kt index d8901b14..9259c9f7 100644 --- a/fints4k/src/main/kotlin/net/dankito/fints/model/TanProcedure.kt +++ b/fints4k/src/main/kotlin/net/dankito/fints/model/TanProcedure.kt @@ -6,7 +6,8 @@ import net.dankito.fints.messages.datenelemente.implementierte.signatur.Sicherhe open class TanProcedure( val displayName: String, val securityFunction: Sicherheitsfunktion, - val type: TanProcedureType + val type: TanProcedureType, + val hhdVersion: HHDVersion? = null ) {