libeufin

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

commit 5755d338765d73e3e3ee08d5fda894b8bddd7f9d
parent 210f2cb5e61fcd796262d84a0dc1306605d76c70
Author: Antoine A <>
Date:   Wed,  9 Apr 2025 14:09:55 +0200

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 || iban.length == 8)) { + if (country == Country.DE && iban.length != 22) { // 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")