Implemented setting customer name also by accountHolderName2 and userParameters.username

This commit is contained in:
dankl 2019-10-13 12:49:53 +02:00 committed by dankito
parent 3167665f67
commit 114836e066
1 changed files with 10 additions and 2 deletions

View File

@ -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 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<AccountInfo>(InstituteSegmentId.AccountInfo)?.let { accountInfo -> response.getFirstSegmentById<AccountInfo>(InstituteSegmentId.AccountInfo)?.let { accountInfo ->
customer.iban = accountInfo.iban customer.iban = accountInfo.iban
customer.name = accountInfo.accountHolderName1 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 // TODO: may also make use of other info
} }
@ -235,6 +237,12 @@ open class FinTsClient(
response.getFirstSegmentById<UserParameters>(InstituteSegmentId.UserParameters)?.let { userParameters -> response.getFirstSegmentById<UserParameters>(InstituteSegmentId.UserParameters)?.let { userParameters ->
customer.updVersion = userParameters.updVersion customer.updVersion = userParameters.updVersion
if (customer.name.isEmpty()) {
userParameters.username?.let {
customer.name = it
}
}
// TODO: may also make use of other info // TODO: may also make use of other info
} }
} }