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 179fa7dd..1c2c70ea 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 @@ -184,7 +184,7 @@ open class ModelMapper( val methodName = parameters.methodName // we filter out iTAN and Einschritt-Verfahren as they are not permitted anymore according to PSD2 - if (methodName.toLowerCase() == "itan") { + if (methodName.lowercase() == "itan") { return null } @@ -196,7 +196,7 @@ open class ModelMapper( } protected open fun mapToTanMethodType(parameters: TanMethodParameters): TanMethodType? { - val name = parameters.methodName.toLowerCase() + val name = parameters.methodName.lowercase() return when { // names are like 'chipTAN (comfort) manuell', 'Smart(-)TAN plus (manuell)' and @@ -254,7 +254,7 @@ open class ModelMapper( protected open fun tanMethodNameContains(name: String, vararg namesToTest: String): Boolean { namesToTest.forEach { nameToTest -> - if (name.contains(nameToTest.toLowerCase())) { + if (name.contains(nameToTest.lowercase())) { return true } } diff --git a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/response/BankResponse.kt b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/response/BankResponse.kt index 52843345..65de8646 100644 --- a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/response/BankResponse.kt +++ b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/response/BankResponse.kt @@ -1,3 +1,5 @@ +@file:Suppress("UNCHECKED_CAST") + package net.codinux.banking.fints.response import net.codinux.banking.fints.messages.MessageBuilderResult diff --git a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/response/ResponseParser.kt b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/response/ResponseParser.kt index d3011ef5..8ef27dfc 100644 --- a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/response/ResponseParser.kt +++ b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/response/ResponseParser.kt @@ -498,7 +498,7 @@ open class ResponseParser( } try { - val lowerCaseMayDkTanMethod = mayDkTanMethod.toLowerCase() + val lowerCaseMayDkTanMethod = mayDkTanMethod.lowercase() if (lowerCaseMayDkTanMethod == "mobiletan" || lowerCaseMayDkTanMethod == "mtan") { return DkTanMethod.mobileTAN diff --git a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/tan/FlickerCodeDecoder.kt b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/tan/FlickerCodeDecoder.kt index 9abfa5ae..b5db757f 100644 --- a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/tan/FlickerCodeDecoder.kt +++ b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/tan/FlickerCodeDecoder.kt @@ -84,7 +84,7 @@ open class FlickerCodeDecoder { } if (encoding == FlickerCodeEncoding.ASCII) { - data = data.map { toHex(it.toInt(), 2) }.joinToString("") + data = data.map { toHex(it.code, 2) }.joinToString("") } if (encoding == FlickerCodeEncoding.BCD && data.length % 2 != 0) { @@ -193,7 +193,7 @@ open class FlickerCodeDecoder { protected open fun toHex(number: Int, minLength: Int): String { - var result = number.toString (16).toUpperCase() + var result = number.toString (16).uppercase() while (result.length < minLength) { result = '0' + result diff --git a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/util/Base64.kt b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/util/Base64.kt index c04d046f..2bc77146 100644 --- a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/util/Base64.kt +++ b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/util/Base64.kt @@ -37,9 +37,9 @@ open class Base64 { (string.indices step 3).forEach { index -> val number: Int = - (0xFF.and(string[index ].toInt()) shl 16) + - (0xFF.and(string[index + 1].toInt()) shl 8) + - 0xFF.and(string[index + 2].toInt()) + (0xFF.and(string[index ].code) shl 16) + + (0xFF.and(string[index + 1].code) shl 8) + + 0xFF.and(string[index + 2].code) encoded.append(Base64Chars[(number shr 18) and 0x3F]) encoded.append(Base64Chars[(number shr 12) and 0x3F])