Fixed mapping multiple HITANS segments in a message

This commit is contained in:
dankito 2024-09-02 03:23:19 +02:00
parent 952fa9c13a
commit fb70bcd443
1 changed files with 3 additions and 2 deletions

View File

@ -37,8 +37,9 @@ open class ModelMapper(
bank.pinInfo = pinInfo bank.pinInfo = pinInfo
} }
response.getFirstSegmentById<TanInfo>(InstituteSegmentId.TanInfo)?.let { tanInfo -> val tanInfos = response.getSegmentsById<TanInfo>(InstituteSegmentId.TanInfo)
bank.tanMethodsSupportedByBank = mapToTanMethods(tanInfo) if (tanInfos.isNotEmpty()) {
bank.tanMethodsSupportedByBank = tanInfos.flatMap { tanInfo -> mapToTanMethods(tanInfo) }
} }
response.getFirstSegmentById<CommunicationInfo>(InstituteSegmentId.CommunicationInfo)?.let { communicationInfo -> response.getFirstSegmentById<CommunicationInfo>(InstituteSegmentId.CommunicationInfo)?.let { communicationInfo ->