use of iso.std.iso._20022.tech.xsd.pain_001_001.RemittanceInformation5 in project estatio by estatio.
the class CreditTransfer method asXml.
@Programmatic
public CreditTransferTransactionInformation10 asXml() {
CreditTransferTransactionInformation10 cdtTrfTxInf = new CreditTransferTransactionInformation10();
PaymentIdentification1 pmtId = new PaymentIdentification1();
cdtTrfTxInf.setPmtId(pmtId);
pmtId.setEndToEndId(getEndToEndId());
AmountType3Choice amt = new AmountType3Choice();
cdtTrfTxInf.setAmt(amt);
ActiveOrHistoricCurrencyAndAmount instdAmt = new ActiveOrHistoricCurrencyAndAmount();
amt.setInstdAmt(instdAmt);
instdAmt.setCcy(getCurrency().getReference().trim());
instdAmt.setValue(getAmount());
BankAccount creditorBankAccount = this.getSellerBankAccount();
cdtTrfTxInf.setCdtrAgt(PaymentBatch.agentFor(creditorBankAccount));
cdtTrfTxInf.setCdtrAcct(PaymentBatch.cashAccountFor(creditorBankAccount));
PartyIdentification32 cdtr = new PartyIdentification32();
cdtTrfTxInf.setCdtr(cdtr);
cdtr.setNm(getSeller().getName());
PostalAddress6 pstlAdr = new PostalAddress6();
cdtr.setPstlAdr(pstlAdr);
pstlAdr.setCtry(PaymentBatch.ctryFor(getSeller()));
RemittanceInformation5 rmtInf = new RemittanceInformation5();
cdtTrfTxInf.setRmtInf(rmtInf);
List<String> ustrdList = rmtInf.getUstrds();
ustrdList.add(getRemittanceInformation());
return cdtTrfTxInf;
}
Aggregations