libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit 271f35b34bfb1d6d5576e589788d785eebf3c84f
parent 74ac18e0fe91acda97b190b3f12cb7e6584363d0
Author: Antoine A <>
Date:   Thu, 20 Mar 2025 17:50:39 +0100

common: improve IBAN validation retrocompatibility

Diffstat:
Mcommon/src/main/kotlin/iban.kt | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/src/main/kotlin/iban.kt b/common/src/main/kotlin/iban.kt @@ -54,7 +54,7 @@ value class IBAN private constructor(val value: String) { } catch (e: IllegalArgumentException) { throw CommonError.Payto("malformed IBAN, unknown country $countryCode") } - if (country == Country.DE && iban.length == 15) { + if (country == Country.DE && (iban.length == 15 || iban.length == 8)) { // This is allowed for retrocompatibility with libeufin-bank malformed DE IBAN } else if (!country.bbanRegex.matches(iban.substring(4))) { throw CommonError.Payto("malformed IBAN, invalid char")