this.marshal(of.createDocument(doc), os, validate);
}
private CreditTransferTransactionInformation2 createCreditTransferTransactionInformation2(Properties sepaParams, Integer index)
{
CreditTransferTransactionInformation2 cdtTrxTxInf = new CreditTransferTransactionInformation2();
//Payment Information - Credit Transfer Transaction Information - Payment Identification
cdtTrxTxInf.setPmtId(new PaymentIdentification1());
cdtTrxTxInf.getPmtId().setEndToEndId(SepaUtil.getProperty(sepaParams,SepaUtil.insertIndex("endtoendid", index),AbstractSEPAGV.ENDTOEND_ID_NOTPROVIDED)); // sicherstellen, dass "NOTPROVIDED" eingetragen wird, wenn keine ID angegeben ist
//Payment Information - Credit Transfer Transaction Information - Creditor
cdtTrxTxInf.setCdtr(new PartyIdentification21());
cdtTrxTxInf.getCdtr().setNm(sepaParams.getProperty(SepaUtil.insertIndex("dst.name", index)));
//Payment Information - Credit Transfer Transaction Information - Creditor Account
cdtTrxTxInf.setCdtrAcct(new CashAccount8());
cdtTrxTxInf.getCdtrAcct().setId(new AccountIdentification2());
cdtTrxTxInf.getCdtrAcct().getId().setIBAN(sepaParams.getProperty(SepaUtil.insertIndex("dst.iban", index)));
//Payment Information - Credit Transfer Transaction Information - Creditor Agent
cdtTrxTxInf.setCdtrAgt(new FinancialInstitution2());
cdtTrxTxInf.getCdtrAgt().setFinInstnId(new FinancialInstitutionIdentification4());
cdtTrxTxInf.getCdtrAgt().getFinInstnId().setBIC(sepaParams.getProperty(SepaUtil.insertIndex("dst.bic", index)));
//Payment Information - Credit Transfer Transaction Information - Amount
cdtTrxTxInf.setAmt(new AmountType3());
cdtTrxTxInf.getAmt().setInstdAmt(new EuroMax9Amount());
cdtTrxTxInf.getAmt().getInstdAmt().setValue(new BigDecimal(sepaParams.getProperty(SepaUtil.insertIndex("btg.value", index))));
cdtTrxTxInf.getAmt().getInstdAmt().setCcy("EUR");
//Payment Information - Credit Transfer Transaction Information - Usage
String usage = sepaParams.getProperty(SepaUtil.insertIndex("usage", index));
if (usage != null && usage.length() > 0)
{
cdtTrxTxInf.setRmtInf(new RemittanceInformation3());
cdtTrxTxInf.getRmtInf().setUstrd(usage);
}
return cdtTrxTxInf;
}