This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Property "cannationalacc" aus HISPAS wird jetzt ausgewertet und Beim …

…Befuellen der Job-Properties bei SEPA-Auftraegen auch verwendet. Zum Hintergrund siehe http://www.onlinebanking-forum.de/forum/topic.php?p=99015#real99015 sowie der Kommentar in AbstractSEPAGV#cannationalAcc().
  • Loading branch information...
willuhn committed Jan 1, 2014
1 parent 88ceecb commit 1117898c8a5fc9fe203860046ce7021fd7c1ce05
@@ -59,6 +59,14 @@ public AbstractGVLastSEPA(HBCIHandler handler, String lowlevelName, AbstractGVRL
addConstraint("src.bic", "My.bic", null, LogFilter.FILTER_MOST);
addConstraint("src.iban", "My.iban", null, LogFilter.FILTER_IDS);
if (this.canNationalAcc(handler)) // nationale Bankverbindung mitschicken, wenn erlaubt
{
addConstraint("src.country", "My.KIK.country", "", LogFilter.FILTER_NONE);
addConstraint("src.blz", "My.KIK.blz", "", LogFilter.FILTER_MOST);
addConstraint("src.number", "My.number", "", LogFilter.FILTER_IDS);
addConstraint("src.subnumber","My.subnumber", "", LogFilter.FILTER_MOST);
}
addConstraint("_sepadescriptor", "sepadescr", this.getPainVersion().getURN(), LogFilter.FILTER_NONE);
addConstraint("_sepapain", "sepapain", null, LogFilter.FILTER_IDS);
@@ -8,7 +8,6 @@
import java.util.Enumeration;
import java.util.List;
import java.util.Properties;
import java.util.Set;
import org.kapott.hbci.GV.generators.ISEPAGenerator;
import org.kapott.hbci.GV.generators.SEPAGeneratorFactory;
@@ -17,6 +16,8 @@
import org.kapott.hbci.manager.HBCIHandler;
import org.kapott.hbci.manager.HBCIUtils;
import org.kapott.hbci.manager.HBCIUtilsInternal;
import org.kapott.hbci.passport.HBCIPassport;
import org.kapott.hbci.passport.HBCIPassportInternal;
import org.kapott.hbci.sepa.PainVersion;
import org.kapott.hbci.sepa.PainVersion.Type;
@@ -73,6 +74,59 @@ public AbstractSEPAGV(HBCIHandler handler, String name, HBCIJobResultImpl jobRes
this.pain = this.determinePainVersion(handler);
}
/**
* Durchsucht das BPD-Segment "HISPAS" nach dem Property "cannationalacc"
* um herauszufinden, ob beim Versand eines SEPA-Auftrages die nationale Bankverbindung
* angegeben sein darf.
*
* Siehe FinTS_3.0_Messages_Geschaeftsvorfaelle_2013-05-28_final_version.pdf - Kapitel B.3.2
*
* @param handler
* @return true, wenn der BPD-Parameter von der Bank mit "J" befuellt ist und die
* nationale Bankverbindung angegeben sein darf.
*/
protected boolean canNationalAcc(HBCIHandler handler)
{
// Checken, ob das Flag im Passport durch die Anwendung hart codiert ist.
// Dort kann die Entscheidung ueberschrieben werden, ob die nationale Kontoverbindung
// mitgeschickt wird oder nicht.
// Das wird voraussichtlich u.a. fuer die Postbank benoetigt, weil die in HISPAS
// zwar mitteilt, dass die nationale Kontoverbindung NICHT angegeben werden soll.
// Beim anschliessenden Einreichen einer SEPA-Ueberweisung beschwert sie sich aber,
// wenn man sie nicht mitgesendet hat. Die verbieten also erst das Senden der
// nationalen Kontoverbindung, verlangen sie anschliessend aber. Ein Fehler der
// Bank. Siehe http://www.onlinebanking-forum.de/forum/topic.php?p=86444#real86444
HBCIPassport passport = handler.getPassport();
if (passport instanceof HBCIPassportInternal)
{
HBCIPassportInternal pi = (HBCIPassportInternal) passport;
Object o = pi.getPersistentData("cannationalacc");
if (o != null)
{
String s = o.toString();
HBCIUtils.log("value of \"cannationalacc\" overwritten in passport, value: " + s,HBCIUtils.LOG_INFO);
return s.equalsIgnoreCase("J");
}
}
HBCIUtils.log("searching for value of \"cannationalacc\" in HISPAS",HBCIUtils.LOG_INFO);
// Ansonsten suchen wir in HISPAS - aber nur, wenn wir die Daten schon haben
if (handler.getSupportedLowlevelJobs().getProperty("SEPAInfo") == null)
{
HBCIUtils.log("no HISPAS data found",HBCIUtils.LOG_INFO);
return false; // Ne, noch nicht. Dann lassen wir das erstmal weg
}
// SEPAInfo laden und darüber iterieren
Properties props = handler.getLowlevelJobRestrictions("SEPAInfo");
String value = props.getProperty("cannationalacc");
HBCIUtils.log("cannationalacc=" + value,HBCIUtils.LOG_INFO);
return value != null && value.equalsIgnoreCase("J");
}
/**
* Diese Methode schaut in den BPD nach den unterstützen pain Versionen
* (bei LastSEPA pain.008.xxx.xx) und vergleicht diese mit den von HBCI4Java
@@ -5,7 +5,6 @@
import java.util.Properties;
import org.kapott.hbci.GV_Result.GVRDauerEdit;
import org.kapott.hbci.GV_Result.GVRDauerNew;
import org.kapott.hbci.exceptions.InvalidUserDataException;
import org.kapott.hbci.manager.HBCIHandler;
import org.kapott.hbci.manager.HBCIUtilsInternal;
@@ -50,6 +49,15 @@ public GVDauerSEPADel(HBCIHandler handler) {
addConstraint("src.bic", "My.bic", null, LogFilter.FILTER_MOST);
addConstraint("src.iban", "My.iban", null, LogFilter.FILTER_IDS);
if (this.canNationalAcc(handler)) // nationale Bankverbindung mitschicken, wenn erlaubt
{
addConstraint("src.country", "My.KIK.country", "", LogFilter.FILTER_NONE);
addConstraint("src.blz", "My.KIK.blz", "", LogFilter.FILTER_MOST);
addConstraint("src.number", "My.number", "", LogFilter.FILTER_IDS);
addConstraint("src.subnumber","My.subnumber", "", LogFilter.FILTER_MOST);
}
addConstraint("_sepadescriptor", "sepadescr", this.getPainVersion().getURN(), LogFilter.FILTER_NONE);
addConstraint("_sepapain", "sepapain", null, LogFilter.FILTER_IDS);
addConstraint("orderid","orderid",null, LogFilter.FILTER_NONE);
@@ -5,7 +5,6 @@
import java.util.Properties;
import org.kapott.hbci.GV_Result.GVRDauerEdit;
import org.kapott.hbci.GV_Result.GVRDauerNew;
import org.kapott.hbci.exceptions.InvalidUserDataException;
import org.kapott.hbci.manager.HBCIHandler;
import org.kapott.hbci.manager.HBCIUtilsInternal;
@@ -50,6 +49,15 @@ public GVDauerSEPAEdit(HBCIHandler handler) {
addConstraint("src.bic", "My.bic", null, LogFilter.FILTER_MOST);
addConstraint("src.iban", "My.iban", null, LogFilter.FILTER_IDS);
if (this.canNationalAcc(handler)) // nationale Bankverbindung mitschicken, wenn erlaubt
{
addConstraint("src.country", "My.KIK.country", "", LogFilter.FILTER_NONE);
addConstraint("src.blz", "My.KIK.blz", "", LogFilter.FILTER_MOST);
addConstraint("src.number", "My.number", "", LogFilter.FILTER_IDS);
addConstraint("src.subnumber","My.subnumber", "", LogFilter.FILTER_MOST);
}
addConstraint("_sepadescriptor", "sepadescr", this.getPainVersion().getURN(), LogFilter.FILTER_NONE);
addConstraint("_sepapain", "sepapain", null, LogFilter.FILTER_IDS);
addConstraint("orderid","orderid",null, LogFilter.FILTER_NONE);
@@ -23,25 +23,21 @@
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Properties;
import org.kapott.hbci.GV.parsers.ISEPAParser;
import org.kapott.hbci.GV.parsers.SEPAParserFactory;
import org.kapott.hbci.GV_Result.GVRDauerList;
import org.kapott.hbci.manager.HBCIHandler;
import org.kapott.hbci.manager.HBCIUtils;
import org.kapott.hbci.manager.HBCIUtilsInternal;
import org.kapott.hbci.manager.LogFilter;
import org.kapott.hbci.sepa.PainVersion;
import org.kapott.hbci.sepa.PainVersion.Type;
import org.kapott.hbci.status.HBCIMsgStatus;
import org.kapott.hbci.structures.Konto;
import org.kapott.hbci.structures.Value;
import org.kapott.hbci.GV.AbstractSEPAGV;
import org.kapott.hbci.GV.parsers.ISEPAParser;
import org.kapott.hbci.GV.parsers.ParsePain00100203;
import org.kapott.hbci.GV.parsers.SEPAParserFactory;
public final class GVDauerSEPAList extends AbstractSEPAGV
{
@@ -76,6 +72,15 @@ public GVDauerSEPAList(HBCIHandler handler)
addConstraint("src.bic", "My.bic", null, LogFilter.FILTER_MOST);
addConstraint("src.iban", "My.iban", null, LogFilter.FILTER_IDS);
if (this.canNationalAcc(handler)) // nationale Bankverbindung mitschicken, wenn erlaubt
{
addConstraint("src.country", "My.KIK.country", "", LogFilter.FILTER_NONE);
addConstraint("src.blz", "My.KIK.blz", "", LogFilter.FILTER_MOST);
addConstraint("src.number", "My.number", "", LogFilter.FILTER_IDS);
addConstraint("src.subnumber","My.subnumber", "", LogFilter.FILTER_MOST);
}
addConstraint("_sepadescriptor", "sepadescr", this.getPainVersion().getURN(), LogFilter.FILTER_NONE);
addConstraint("orderid","orderid","", LogFilter.FILTER_NONE);
addConstraint("maxentries","maxentries","", LogFilter.FILTER_NONE);
@@ -49,6 +49,15 @@ public GVDauerSEPANew(HBCIHandler handler) {
addConstraint("src.bic", "My.bic", null, LogFilter.FILTER_MOST);
addConstraint("src.iban", "My.iban", null, LogFilter.FILTER_IDS);
if (this.canNationalAcc(handler)) // nationale Bankverbindung mitschicken, wenn erlaubt
{
addConstraint("src.country", "My.KIK.country", "", LogFilter.FILTER_NONE);
addConstraint("src.blz", "My.KIK.blz", "", LogFilter.FILTER_MOST);
addConstraint("src.number", "My.number", "", LogFilter.FILTER_IDS);
addConstraint("src.subnumber","My.subnumber", "", LogFilter.FILTER_MOST);
}
addConstraint("_sepadescriptor", "sepadescr", this.getPainVersion().getURN(), LogFilter.FILTER_NONE);
addConstraint("_sepapain", "sepapain", null, LogFilter.FILTER_IDS);
@@ -76,12 +76,13 @@ public GVTermUebSEPA(HBCIHandler handler)
addConstraint("src.bic", "My.bic", null, LogFilter.FILTER_MOST);
addConstraint("src.iban", "My.iban", null, LogFilter.FILTER_IDS);
/*
addConstraint("src.country", "My.KIK.country", "", LogFilter.FILTER_NONE);
addConstraint("src.blz", "My.KIK.blz", "", LogFilter.FILTER_MOST);
addConstraint("src.number", "My.number", "", LogFilter.FILTER_IDS);
addConstraint("src.subnumber","My.subnumber", "", LogFilter.FILTER_MOST);
*/
if (this.canNationalAcc(handler)) // nationale Bankverbindung mitschicken, wenn erlaubt
{
addConstraint("src.country", "My.KIK.country", "", LogFilter.FILTER_NONE);
addConstraint("src.blz", "My.KIK.blz", "", LogFilter.FILTER_MOST);
addConstraint("src.number", "My.number", "", LogFilter.FILTER_IDS);
addConstraint("src.subnumber","My.subnumber", "", LogFilter.FILTER_MOST);
}
addConstraint("_sepadescriptor", "sepadescr", this.getPainVersion().getURN(), LogFilter.FILTER_NONE);
addConstraint("_sepapain", "sepapain", null, LogFilter.FILTER_IDS);
@@ -50,6 +50,15 @@ public GVTermUebSEPADel(HBCIHandler handler)
addConstraint("src.bic", "My.bic", null, LogFilter.FILTER_MOST);
addConstraint("src.iban", "My.iban", null, LogFilter.FILTER_IDS);
if (this.canNationalAcc(handler)) // nationale Bankverbindung mitschicken, wenn erlaubt
{
addConstraint("src.country", "My.KIK.country", "", LogFilter.FILTER_NONE);
addConstraint("src.blz", "My.KIK.blz", "", LogFilter.FILTER_MOST);
addConstraint("src.number", "My.number", "", LogFilter.FILTER_IDS);
addConstraint("src.subnumber","My.subnumber", "", LogFilter.FILTER_MOST);
}
addConstraint("orderid", "orderid", null, LogFilter.FILTER_NONE);
addConstraint("_sepadescriptor", "sepadescr", this.getPainVersion().getURN(), LogFilter.FILTER_NONE);
@@ -23,26 +23,21 @@
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Properties;
import org.kapott.hbci.GV_Result.GVRDauerList;
import org.kapott.hbci.GV.parsers.ISEPAParser;
import org.kapott.hbci.GV.parsers.SEPAParserFactory;
import org.kapott.hbci.GV_Result.GVRTermUebList;
import org.kapott.hbci.manager.HBCIHandler;
import org.kapott.hbci.manager.HBCIUtils;
import org.kapott.hbci.manager.HBCIUtilsInternal;
import org.kapott.hbci.manager.LogFilter;
import org.kapott.hbci.sepa.PainVersion;
import org.kapott.hbci.sepa.PainVersion.Type;
import org.kapott.hbci.status.HBCIMsgStatus;
import org.kapott.hbci.structures.Konto;
import org.kapott.hbci.structures.Value;
import org.kapott.hbci.GV.AbstractSEPAGV;
import org.kapott.hbci.GV.parsers.ISEPAParser;
import org.kapott.hbci.GV.parsers.ParsePain00100203;
import org.kapott.hbci.GV.parsers.SEPAParserFactory;
public final class GVTermUebSEPAList extends AbstractSEPAGV
{
@@ -77,6 +72,15 @@ public GVTermUebSEPAList(HBCIHandler handler)
addConstraint("src.bic", "My.bic", null, LogFilter.FILTER_MOST);
addConstraint("src.iban", "My.iban", null, LogFilter.FILTER_IDS);
if (this.canNationalAcc(handler)) // nationale Bankverbindung mitschicken, wenn erlaubt
{
addConstraint("src.country", "My.KIK.country", "", LogFilter.FILTER_NONE);
addConstraint("src.blz", "My.KIK.blz", "", LogFilter.FILTER_MOST);
addConstraint("src.number", "My.number", "", LogFilter.FILTER_IDS);
addConstraint("src.subnumber","My.subnumber", "", LogFilter.FILTER_MOST);
}
addConstraint("_sepadescriptor", "sepadescr", this.getPainVersion().getURN(), LogFilter.FILTER_NONE);
addConstraint("startdate","startdate","", LogFilter.FILTER_NONE);
addConstraint("enddate","enddate","", LogFilter.FILTER_NONE);
@@ -80,13 +80,14 @@ public GVUebSEPA(HBCIHandler handler, String name)
addConstraint("src.bic", "My.bic", null, LogFilter.FILTER_MOST);
addConstraint("src.iban", "My.iban", null, LogFilter.FILTER_IDS);
/*
addConstraint("src.country", "My.KIK.country", "", LogFilter.FILTER_NONE);
addConstraint("src.blz", "My.KIK.blz", "", LogFilter.FILTER_MOST);
addConstraint("src.number", "My.number", "", LogFilter.FILTER_IDS);
addConstraint("src.subnumber","My.subnumber", "", LogFilter.FILTER_MOST);
*/
if (this.canNationalAcc(handler)) // nationale Bankverbindung mitschicken, wenn erlaubt
{
addConstraint("src.country", "My.KIK.country", "", LogFilter.FILTER_NONE);
addConstraint("src.blz", "My.KIK.blz", "", LogFilter.FILTER_MOST);
addConstraint("src.number", "My.number", "", LogFilter.FILTER_IDS);
addConstraint("src.subnumber","My.subnumber", "", LogFilter.FILTER_MOST);
}
addConstraint("_sepadescriptor", "sepadescr", this.getPainVersion().getURN(), LogFilter.FILTER_NONE);
addConstraint("_sepapain", "sepapain", null, LogFilter.FILTER_IDS);

0 comments on commit 1117898

Please sign in to comment.