From 114836e066fc6caa106e7e54411536da92d64cf2 Mon Sep 17 00:00:00 2001 From: dankl Date: Sun, 13 Oct 2019 12:49:53 +0200 Subject: [PATCH] Implemented setting customer name also by accountHolderName2 and userParameters.username --- .../src/main/kotlin/net/dankito/fints/FinTsClient.kt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/fints4javaLib/src/main/kotlin/net/dankito/fints/FinTsClient.kt b/fints4javaLib/src/main/kotlin/net/dankito/fints/FinTsClient.kt index f3d80bb7..f2f79c50 100644 --- a/fints4javaLib/src/main/kotlin/net/dankito/fints/FinTsClient.kt +++ b/fints4javaLib/src/main/kotlin/net/dankito/fints/FinTsClient.kt @@ -221,13 +221,15 @@ open class FinTsClient( customer.customerSystemStatus = KundensystemStatusWerte.Benoetigt // TODO: didn't find out for sure yet, but i think i read somewhere, that this has to be set when customerSystemId is set } - - // TODO: may also save securityReferenceNumbers } response.getFirstSegmentById(InstituteSegmentId.AccountInfo)?.let { accountInfo -> customer.iban = accountInfo.iban + customer.name = accountInfo.accountHolderName1 + accountInfo.accountHolderName2?.let { + customer.name = customer.name + it // TODO: add a whitespace in between? + } // TODO: may also make use of other info } @@ -235,6 +237,12 @@ open class FinTsClient( response.getFirstSegmentById(InstituteSegmentId.UserParameters)?.let { userParameters -> customer.updVersion = userParameters.updVersion + if (customer.name.isEmpty()) { + userParameters.username?.let { + customer.name = it + } + } + // TODO: may also make use of other info } }