From e5c1fa2b50746639a2df91e07a96df11d036ca00 Mon Sep 17 00:00:00 2001 From: dankito Date: Fri, 20 Nov 2020 00:50:27 +0100 Subject: [PATCH] Fixed retrieving medium name (had to take remainingDataElements not dataElements) --- .../net/dankito/banking/fints/response/ResponseParser.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/ResponseParser.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/ResponseParser.kt index 353a1881..583b469b 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/ResponseParser.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/ResponseParser.kt @@ -546,12 +546,13 @@ open class ResponseParser( } val status = parseCodeEnum(dataElements[1], TanMediumStatus.values()) - val mediumName = if (hitabVersion < 2) null else parseStringToNullIfEmpty(dataElements[10]) // TODO: may also parse 'Letzte Benutzung' (second last element) and 'Freigeschaltet am' (last element) val remainingDataElements = dataElements.subList(2, dataElements.size) + val mediumName = if (hitabVersion < 2) null else parseStringToNullIfEmpty(remainingDataElements[10]) + return when (mediumClass) { TanMediumKlasse.TanGenerator -> parseTanGeneratorTanMedium(mediumClass, status, mediumName, hitabVersion, remainingDataElements) TanMediumKlasse.MobiltelefonMitMobileTan -> parseMobilePhoneTanMedium(mediumClass, status, mediumName, hitabVersion, remainingDataElements)