Handling that Deutsche Bank returns erroneous HIUPD segments

This commit is contained in:
dankito 2024-08-14 14:05:14 +02:00
parent 2eaf33a25f
commit e039af44e3
1 changed files with 10 additions and 1 deletions

View File

@ -240,9 +240,18 @@ open class ResponseParser(
return UserParameters(customerId, updVersion, areListedJobsBlocked, username, extension, segment) return UserParameters(customerId, updVersion, areListedJobsBlocked, username, extension, segment)
} }
protected open fun parseAccountInfo(segment: String, dataElementGroups: List<String>): AccountInfo { protected open fun parseAccountInfo(segment: String, dataElementGroups: List<String>): AccountInfo? {
// this is parsing a Kontoverbindung. May extract a method for it. // this is parsing a Kontoverbindung. May extract a method for it.
val accountDetails = getDataElements(dataElementGroups[1]) val accountDetails = getDataElements(dataElementGroups[1])
if (accountDetails.isEmpty()) {
// yes, by standard the Kontoinformation can be missing:
// N: bei Geschäftsvorfällen ohne Kontenbezug
// M: sonst
// But in my eyes Deutsche Bank uses it wrong and adds a second HIUPD for the same account but with most information missing:
// HIUPD:7:6:4+++2200672485+++Christian+Dankl, Christian+++HKTAN:1+HKPRO:1+HKVVB:1+HKFRD:1+DKPSP:1+HKPSP:1'
return null
}
val accountNumber = parseString(accountDetails[0]) val accountNumber = parseString(accountDetails[0])
val subAccountAttribute = parseStringToNullIfEmpty(accountDetails[1]) val subAccountAttribute = parseStringToNullIfEmpty(accountDetails[1])
val bankCountryCode = parseInt(accountDetails[2]) val bankCountryCode = parseInt(accountDetails[2])