diff --git a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/model/BankData.kt b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/model/BankData.kt index cc91c66e..6e91166e 100644 --- a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/model/BankData.kt +++ b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/model/BankData.kt @@ -43,7 +43,8 @@ open class BankData( open var countMaxJobsPerMessage: Int = 0, open var supportedHbciVersions: List = listOf(), - open var supportedJobs: List = listOf() + open var supportedJobs: List = listOf(), + open var jobsRequiringTan: Set = emptySet() ) { companion object { @@ -61,6 +62,8 @@ open class BankData( internal constructor() : this("", "", "", "", "") // for object deserializers + open var pinInfo: PinInfo? = null + protected open val _accounts = mutableListOf() @@ -81,10 +84,6 @@ open class BankData( } - open var jobsRequiringTan: Set = emptySet() - -// open var pinInfo: PinInfo? = null - open fun doesJobRequireTan(segmentId: ISegmentId): Boolean = doesJobRequireTan(segmentId.id) open fun doesJobRequireTan(segmentId: String): Boolean = diff --git a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/model/PinInfo.kt b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/model/PinInfo.kt new file mode 100644 index 00000000..a6fb9e81 --- /dev/null +++ b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/model/PinInfo.kt @@ -0,0 +1,12 @@ +package net.codinux.banking.fints.model + +import kotlinx.serialization.Serializable + +@Serializable +open class PinInfo( + val minPinLength: Int?, + val maxPinLength: Int?, + val minTanLength: Int?, + val userIdHint: String?, + val customerIdHint: String? +) \ No newline at end of file diff --git a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/model/mapper/ModelMapper.kt b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/model/mapper/ModelMapper.kt index 48f0c633..4cb37dfe 100644 --- a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/model/mapper/ModelMapper.kt +++ b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/model/mapper/ModelMapper.kt @@ -11,6 +11,7 @@ import net.codinux.banking.fints.model.* import net.codinux.banking.fints.response.BankResponse import net.codinux.banking.fints.response.InstituteSegmentId import net.codinux.banking.fints.response.segments.* +import net.codinux.banking.fints.response.segments.PinInfo open class ModelMapper( @@ -34,7 +35,7 @@ open class ModelMapper( } response.getFirstSegmentById(InstituteSegmentId.PinInfo)?.let { pinInfo -> - // TODO: save min/maxPinLength, minTanLength, user/customerIdHint on BankData (or in BankFinderResult object?) + bank.pinInfo = net.codinux.banking.fints.model.PinInfo(pinInfo.minPinLength, pinInfo.maxPinLength, pinInfo.minTanLength, pinInfo.userIdHint, pinInfo.customerIdHint) bank.jobsRequiringTan = pinInfo.jobTanConfiguration.filter { it.tanRequired }.map { it.segmentId }.toHashSet() }