From 69f058b753cffa157c772716c1853c10ee93353d Mon Sep 17 00:00:00 2001 From: dankl Date: Sun, 19 Jan 2020 17:02:09 +0100 Subject: [PATCH] Implemented that all accounts from message get added to CustomerData --- .../src/main/kotlin/net/dankito/fints/FinTsClient.kt | 6 ++++-- 1 file changed, 4 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 acfc6c2b..6ee2f669 100644 --- a/fints4javaLib/src/main/kotlin/net/dankito/fints/FinTsClient.kt +++ b/fints4javaLib/src/main/kotlin/net/dankito/fints/FinTsClient.kt @@ -790,8 +790,10 @@ open class FinTsClient @JvmOverloads constructor( } } - response.getFirstSegmentById(InstituteSegmentId.AccountInfo)?.let { accountInfo -> - customer.iban = accountInfo.iban // TODO: remove and use that one from AccountData + response.getSegmentsById(InstituteSegmentId.AccountInfo).forEach { accountInfo -> + if (customer.iban == null && accountInfo.iban != null) { + customer.iban = accountInfo.iban // TODO: remove and use that one from AccountData + } var accountHolderName = accountInfo.accountHolderName1 accountInfo.accountHolderName2?.let {