Codebase list hbci4java / 043ed8d
New upstream version 3.1.60+dfsg Jochen Sprickerhof 1 year, 10 months ago
5 changed file(s) with 38 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
22 <modelVersion>4.0.0</modelVersion>
33 <groupId>com.github.hbci4j</groupId>
44 <artifactId>hbci4j-core</artifactId>
5 <version>3.1.59</version>
5 <version>3.1.60</version>
66 <packaging>jar</packaging>
77 <name>${project.artifactId}</name>
88 <description>HBCI4j - Home Banking Computer Interface for Java</description>
3030 <url>scm:git:git@github.com:hbci4j/hbci4java.git</url>
3131 <connection>scm:git:git@github.com:hbci4j/hbci4java.git</connection>
3232 <developerConnection>scm:git:git@github.com:hbci4j/hbci4java.git</developerConnection>
33 <tag>hbci4j-core-3.1.59</tag>
33 <tag>hbci4j-core-3.1.60</tag>
3434 </scm>
3535 <properties>
3636 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
102102 temp_number.equals(number))
103103 {
104104 if (StringUtil.hasText(iban))
105 upd.setProperty(temp_header+".KTV.iban", iban);
105 {
106 upd.setProperty(temp_header+".KTV.iban", iban);
107 upd.setProperty(temp_header+".iban", iban);
108 }
106109
107110 if (StringUtil.hasText(bic))
108111 upd.setProperty(temp_header+".KTV.bic", bic);
148148
149149 // uebernehmen wir nur, wenn wir eine haben
150150 if (StringUtil.hasText(iban))
151 upd.setProperty(h + ".KTV.iban", iban);
151 {
152 upd.setProperty(h + ".KTV.iban", iban);
153 upd.setProperty(h + ".iban", iban);
154 }
152155
153156 // uebernehmen wir nur, wenn wir eine haben
154157 if (StringUtil.hasText(bic))
2929 import java.util.List;
3030 import java.util.Map;
3131 import java.util.Objects;
32 import java.util.Optional;
3233 import java.util.Properties;
3334 import java.util.regex.Matcher;
3435 import java.util.regex.Pattern;
5152 import org.kapott.hbci.passport.HBCIPassport;
5253 import org.kapott.hbci.passport.HBCIPassportInternal;
5354 import org.kapott.hbci.status.HBCIMsgStatus;
55 import org.kapott.hbci.structures.Konto;
56 import org.kapott.hbci.tools.StringUtil;
5457
5558 /**
5659 * Kapselt die authentifizierten Initialisierungsdialoge. Also im Wesentlichen alles, was mit den UPD zu tun hat.
561564 // Manche Banken schicken in den UPDs scheinbar die Konto-Daten nicht mehr immer mit. Daher merken wird uns die vorherigen
562565 // Werte, wenn keine neuen uebertragen wurden
563566 if (upd != null && upd.size() > 0) {
564 final Pattern pattern = Pattern.compile("(KInfo(.*?)\\.KTV)\\.(bic|iban)");
565 for (final Object okey : upd.keySet()) {
567 Konto[] konten = passport.getAccounts();
568 final Pattern pattern = Pattern.compile("UPD\\.(KInfo(.*?)\\.KTV)\\.number");
569 for (final Object okey : result.keySet()) {
566570 final String key = okey.toString();
567571 final Matcher m = pattern.matcher(key);
568 if (m.matches() && !result.contains("UPD." + key)) {
572 if (m.matches()) {
569573 final String kinfo = m.group(1);
570 if (Objects.equals(result.getProperty("UPD." + kinfo + ".KIK.country"), upd.getProperty(kinfo + ".KIK.country"))
571 && Objects.equals(result.getProperty("UPD." + kinfo + ".KIK.blz"), upd.getProperty(kinfo + ".KIK.blz"))
572 && Objects.equals(result.getProperty("UPD." + kinfo + ".number"), upd.getProperty(kinfo + ".number"))) {
573 HBCIUtils.log(key + " is missing, using the previous UPD's value", HBCIUtils.LOG_DEBUG);
574 p.put(okey, upd.getProperty(key));
574 if (!p.contains(kinfo + ".bic") || !p.contains(kinfo + ".iban")) {
575 Optional<Konto> matchingKonto = Arrays.asList(konten).stream()
576 .filter(konto ->
577 Objects.equals(konto.number, result.get(okey)) &&
578 Objects.equals(konto.blz, result.get("UPD." + kinfo + ".KIK.blz")) &&
579 Objects.equals(konto.country, result.get("UPD." + kinfo + ".KIK.country")))
580 .findAny();
581 matchingKonto.ifPresent(konto -> {
582 if (StringUtil.hasText(konto.iban) && StringUtil.hasText(konto.bic)) {
583 HBCIUtils.log(kinfo + ".iban / .bic is missing, using the previous UPD's value",
584 HBCIUtils.LOG_DEBUG);
585 p.put(kinfo + ".bic", konto.bic);
586 p.put(kinfo + ".iban", konto.iban);
587 }
588 });
575589 }
576590 }
577591 }
245245 entry.name=upd.getProperty(header+".name1");
246246 entry.name2=upd.getProperty(header+".name2");
247247 entry.bic=upd.getProperty(header+".KTV.bic");
248
249 // Seit HIUPD Version 6 gibt es die IBAN zweimal - einmal im DEG KTV und dann nochmal
250 // direkt im HIUPD. Die Banken befüllen das unterschiedlich. Wir checken daher beide Stellen.
248251 entry.iban=upd.getProperty(header+".KTV.iban");
252 if (entry.iban == null || entry.iban.length() == 0)
253 entry.iban=upd.getProperty(header+".iban");
254
249255 entry.acctype=upd.getProperty(header+".acctype");
250256
251257 String st;