private void AddPayment(decimal amount, string creditorName, IBANBIC creditorAccount, string uniqueCreditTransferID, RemittanceInformation5 remittanceInformation = null) { creditTransfers.Add(new CreditTransferTransactionInformation10 { PmtId = new PaymentIdentification1 { EndToEndId = Truncate(uniqueCreditTransferID, maxLengthID), }, Amt = new AmountType3Choice { Item = new ActiveOrHistoricCurrencyAndAmount { Value = amount, Ccy = "EUR", }, }, Cdtr = new PartyIdentification32 { Nm = Truncate(creditorName, maxLengthName), }, CdtrAcct = new CashAccount16 { Id = new AccountIdentification4Choice { Item = creditorAccount.IBAN, }, }, RmtInf = remittanceInformation, }); }
public void AddPayment(decimal amount, string creditorName, IBANBIC creditorAccount, string uniqueCreditTransferID, string unstructuredInformation = null) { AddPayment(amount, creditorName, creditorAccount, uniqueCreditTransferID, unstructuredInformation == null ? null : new RemittanceInformation5 { Ustrd = new[] { unstructuredInformation }, }); }
public static SEPABatchPayment CreateForOnePaymentBlock(string debtorName, IBANBIC debtorAccount, string messageID, string paymentBlockID, DateTime?paymentExecutionDate = null) { if (debtorAccount.NoBICprovided) { throw new ArgumentException("No BIC provided for debtor account", "debtorAccount"); } var b = new SEPABatchPayment(); b.document.CstmrCdtTrfInitn.GrpHdr.MsgId = Truncate(messageID, maxLengthID); b.document.CstmrCdtTrfInitn.GrpHdr.InitgPty = new PartyIdentification32 { Nm = Truncate(debtorName, maxLengthName), }; var pi = new PaymentInstructionInformation3 { PmtInfId = Truncate(paymentBlockID, maxLengthID), PmtMtd = PaymentMethod3Code.TRF, BtchBookg = false, ReqdExctnDt = paymentExecutionDate ?? DateTime.Now, Dbtr = new PartyIdentification32 { Nm = Truncate(debtorName, maxLengthName), // only debtorname is enough }, DbtrAcct = new CashAccount16 { Id = new AccountIdentification4Choice { Item = debtorAccount.IBAN, } }, DbtrAgt = new BranchAndFinancialInstitutionIdentification4 { FinInstnId = new FinancialInstitutionIdentification7 { BIC = debtorAccount.BIC.ToString(), } }, }; b.document.CstmrCdtTrfInitn.PmtInf = new[] { pi }; return(b); }
public void AddPayment(decimal amount, string creditorName, IBANBIC creditorAccount, string uniqueCreditTransferID, BelgianStructuredCommunicationReference remittanceInformation) { var ri = new RemittanceInformation5 { Strd = new[] { new StructuredRemittanceInformation7 { CdtrRefInf = new CreditorReferenceInformation2 { Tp = new CreditorReferenceType2 { CdOrPrtry = new CreditorReferenceType1Choice { Item = DocumentType3Code.SCOR }, Issr = "BBA", }, Ref = remittanceInformation.ToString(), } } } }; AddPayment(amount, creditorName, creditorAccount, uniqueCreditTransferID, ri); }