From 4588fb4d207846383bdf06c5d718ef6d1f562d3f Mon Sep 17 00:00:00 2001 From: dankito Date: Sun, 18 Aug 2024 04:04:32 +0200 Subject: [PATCH] Trimming white spaces at end of name as e.g. Baader Bank adds them to account holder name --- .../net/dankito/banking/fints/model/mapper/ModelMapper.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/mapper/ModelMapper.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/mapper/ModelMapper.kt index 79770a02..5fa3992d 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/mapper/ModelMapper.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/mapper/ModelMapper.kt @@ -81,10 +81,9 @@ open class ModelMapper( } response.getSegmentsById(InstituteSegmentId.AccountInfo).forEach { accountInfo -> - var accountHolderName = accountInfo.accountHolderName1 - accountInfo.accountHolderName2?.let { - accountHolderName += it // TODO: add a whitespace in between? - } + val accountHolderName = if (accountInfo.accountHolderName2.isNullOrBlank()) accountInfo.accountHolderName1.trim() // Baader Bank adds a lot of white spaces at end + else accountInfo.accountHolderName1.trim() + " " + accountInfo.accountHolderName2.trim() + bank.customerName = accountHolderName findExistingAccount(bank, accountInfo)?.let { account ->