Search in sources :

Example 1 with CustomerCreditTransferInitiationV03

use of iso.std.iso._20022.tech.xsd.pain_001_001.CustomerCreditTransferInitiationV03 in project estatio by estatio.

the class PaymentBatch method convertToXmlDocument.

// region > convertToXmlDocument
Document convertToXmlDocument() {
    final List<CreditTransfer> transfers = getTransfers();
    Document document = new Document();
    CustomerCreditTransferInitiationV03 cstmrCdtTrfInitn = new CustomerCreditTransferInitiationV03();
    document.setCstmrCdtTrfInitn(cstmrCdtTrfInitn);
    GroupHeader32 grpHdr = new GroupHeader32();
    cstmrCdtTrfInitn.setGrpHdr(grpHdr);
    grpHdr.setMsgId(msgId());
    grpHdr.setCreDtTm(newDateTime(getCreatedOn()));
    grpHdr.setNbOfTxs("" + transfers.size());
    grpHdr.setCtrlSum(ctrlSum());
    grpHdr.setInitgPty(newPartyIdentification32ForDebtorOwner());
    List<PaymentInstructionInformation3> pmtInfList = cstmrCdtTrfInitn.getPmtInves();
    PaymentInstructionInformation3 pmtInf = new PaymentInstructionInformation3();
    pmtInfList.add(pmtInf);
    pmtInf.setPmtInfId(getId());
    pmtInf.setPmtMtd(PaymentMethod3Code.TRF);
    pmtInf.setBtchBookg(false);
    pmtInf.setReqdExctnDt(newDateTime(getRequestedExecutionDate()));
    pmtInf.setDbtr(newPartyIdentification32ForDebtorOwner());
    pmtInf.setDbtrAcct(cashAccountFor(getDebtorBankAccount()));
    pmtInf.setDbtrAgt(agentFor(getDebtorBankAccount()));
    final List<CreditTransferTransactionInformation10> cdtTrfTxInfList = pmtInf.getCdtTrfTxInves();
    cdtTrfTxInfList.addAll(transfers.stream().map(CreditTransfer::asXml).collect(Collectors.toList()));
    return document;
}
Also used : GroupHeader32(iso.std.iso._20022.tech.xsd.pain_001_001.GroupHeader32) CreditTransferTransactionInformation10(iso.std.iso._20022.tech.xsd.pain_001_001.CreditTransferTransactionInformation10) PaymentInstructionInformation3(iso.std.iso._20022.tech.xsd.pain_001_001.PaymentInstructionInformation3) Document(iso.std.iso._20022.tech.xsd.pain_001_001.Document) CustomerCreditTransferInitiationV03(iso.std.iso._20022.tech.xsd.pain_001_001.CustomerCreditTransferInitiationV03)

Aggregations

CreditTransferTransactionInformation10 (iso.std.iso._20022.tech.xsd.pain_001_001.CreditTransferTransactionInformation10)1 CustomerCreditTransferInitiationV03 (iso.std.iso._20022.tech.xsd.pain_001_001.CustomerCreditTransferInitiationV03)1 Document (iso.std.iso._20022.tech.xsd.pain_001_001.Document)1 GroupHeader32 (iso.std.iso._20022.tech.xsd.pain_001_001.GroupHeader32)1 PaymentInstructionInformation3 (iso.std.iso._20022.tech.xsd.pain_001_001.PaymentInstructionInformation3)1