public override bool IsValid() { if (!this.m_vStsRsnInfs.IsValid()) { return(false); } if (!this.m_aDbtr.IsValid() || !this.m_aCdtr.IsValid()) { return(false); } SepaMessageType originalMessageType = this.OriginalPaymentInformation.PaymentStatusReport.OriginalMessageType; if (originalMessageType == SepaMessageType.CreditTransferPaymentInitiation) { if (((this.m_sCdtrSchmeId != null) || (this.m_sLclInstrmCd != null)) || (((this.m_sSeqTp != null) || (this.m_sMndtId != null)) || (this.m_dtMndtDtOfSgntr > DateTime.MinValue))) { return(false); } } else if ((originalMessageType == SepaMessageType.DirectDebitPaymentInitiation) && (this.m_sInstrPrty != null)) { return(false); } return(true); }
public SepaMessageInfo(SepaMessageType nMessageType, int nVersion, string sMessageTag, string sXmlNamespace, string sXmlSchemaLocation) { if (sMessageTag == null) { throw new ArgumentNullException(); } if (!SepaUtil.CheckTagName(sMessageTag)) { throw new ArgumentException(); } if (nVersion <= 0) { throw new ArgumentException(); } if (sXmlNamespace == "") { sXmlNamespace = null; } if (sXmlSchemaLocation == "") { sXmlSchemaLocation = null; } this.m_nMessageType = nMessageType; this.m_nVersion = nVersion; this.m_sMessageTag = sMessageTag; this.m_sXmlNamespace = sXmlNamespace; this.m_sXmlSchemaLocation = sXmlSchemaLocation; }
public override void Clear() { base.Clear(); this.m_nOriginalMessageType = SepaMessageType.Null; this.m_sOrgnlMsgId = null; this.m_tAgtBIC = SepaBIC.NullBIC; this.m_vOrgnlPmtInfs.Clear(); }
public SepaMessageInfo(SepaMessageInfo aMessageInfo) { if (aMessageInfo == null) { throw new ArgumentNullException(); } this.m_nMessageType = aMessageInfo.MessageType; this.m_nVersion = aMessageInfo.Version; this.m_sMessageTag = aMessageInfo.MessageTag; this.XmlNamespace = aMessageInfo.XmlNamespace; this.XmlSchemaLocation = aMessageInfo.XmlSchemaLocation; }
protected override void OnReadXml(XmlReader aXmlReader, SepaMessageInfo aMessageInfo) { if (base.MessageType != aMessageInfo.MessageType) { throw new ArgumentException(); } aXmlReader.ReadStartElement("GrpHdr"); base.ReadGroupHeaderFields(aXmlReader, aMessageInfo); if (aXmlReader.IsStartElement("DbtrAgt")) { this.m_tAgtBIC = SepaUtil.ReadAgtBIC(aXmlReader, "DbtrAgt"); this.m_nOriginalMessageType = SepaMessageType.CreditTransferPaymentInitiation; } else { this.m_tAgtBIC = SepaUtil.ReadAgtBIC(aXmlReader, "CdtrAgt"); this.m_nOriginalMessageType = SepaMessageType.DirectDebitPaymentInitiation; } aXmlReader.ReadEndElement(); aXmlReader.ReadStartElement("OrgnlGrpInfAndSts"); this.m_sOrgnlMsgId = aXmlReader.ReadElementString("OrgnlMsgId"); if (aXmlReader.ReadElementString("OrgnlMsgNmId") != this.OriginalMessageNameIdentification) { throw new XmlException("Inconsistent OrgnlMsgNmId"); } while (aXmlReader.NodeType != XmlNodeType.EndElement) { aXmlReader.Skip(); } aXmlReader.ReadEndElement(); while (aXmlReader.IsStartElement("OrgnlPmtInfAndSts")) { SepaOriginalPaymentInformation item = new SepaOriginalPaymentInformation(); item.ReadXml(aXmlReader, aMessageInfo); this.m_vOrgnlPmtInfs.Add(item); } }
public SepaPaymentInitiation(string sPainTag, SepaMessageType nMessageType) : base(sPainTag, nMessageType) { this.m_aInitgPty = new SepaPartyIdentification("InitgPty", SepaPartyIdentification.Fields.BIC | SepaPartyIdentification.Fields.Name, SepaPartyIdentification.Fields.None); this.m_vPmtInfs = new SepaPaymentInformations(this); }
protected SepaMessage(string sMessageTagName, SepaMessageType nMessageType) : base(sMessageTagName) { this.m_nMessageType = nMessageType; this.m_sMsgId = SepaUtil.GenerateIdentification("M"); this.m_dtCreDtTm = DateTime.Now; }
protected override void OnWriteXml(XmlWriter aXmlWriter, SepaMessageInfo aMessageInfo) { SepaMessageType originalMessageType = this.OriginalPaymentInformation.PaymentStatusReport.OriginalMessageType; if (this.m_sStsId != null) { aXmlWriter.WriteElementString("StsId", this.m_sStsId); } if (this.m_sOrgnlInstrId != null) { aXmlWriter.WriteElementString("OrgnlInstrId", this.m_sOrgnlInstrId); } if (this.m_sOrgnlEndToEndId != null) { aXmlWriter.WriteElementString("OrgnlEndToEndId", this.m_sOrgnlEndToEndId); } if (this.m_vStsRsnInfs.Count > 0) { aXmlWriter.WriteElementString("TxSts", "RJCT"); this.m_vStsRsnInfs.WriteXml(aXmlWriter, aMessageInfo); } aXmlWriter.WriteStartElement("OrgnlTxRef"); if (this.m_aAmt.Amount > 0M) { aXmlWriter.WriteStartElement("Amt"); this.m_aAmt.WriteXml(aXmlWriter, "InstdAmt"); aXmlWriter.WriteEndElement(); } if (this.m_dtReqdDt > DateTime.MinValue) { switch (originalMessageType) { case SepaMessageType.CreditTransferPaymentInitiation: SepaUtil.WriteDtXml(aXmlWriter, "ReqdExctnDt", this.m_dtReqdDt); break; case SepaMessageType.DirectDebitPaymentInitiation: SepaUtil.WriteDtXml(aXmlWriter, "ReqdColltnDt", this.m_dtReqdDt); break; } } if (this.m_sCdtrSchmeId != null) { SepaUtil.WriteCdtrSchmeIdXml(aXmlWriter, this.m_sCdtrSchmeId, false); } if (((this.m_sInstrPrty != null) || (this.m_sLclInstrmCd != null)) || ((this.m_sSeqTp != null) || (this.m_sCtgyPurp != null))) { aXmlWriter.WriteStartElement("PmtTpInf"); if (this.m_sInstrPrty != null) { aXmlWriter.WriteElementString("InstrPrty", this.m_sInstrPrty); } aXmlWriter.WriteStartElement("SvcLvl"); aXmlWriter.WriteElementString("Cd", "SEPA"); aXmlWriter.WriteEndElement(); if (this.m_sLclInstrmCd != null) { aXmlWriter.WriteStartElement("LclInstrm"); aXmlWriter.WriteElementString("Cd", this.m_sLclInstrmCd); aXmlWriter.WriteEndElement(); } if (this.m_sSeqTp != null) { aXmlWriter.WriteElementString("SeqTp", this.m_sSeqTp); } if (this.m_sCtgyPurp != null) { aXmlWriter.WriteStartElement("CtgyPurp"); aXmlWriter.WriteElementString("Cd", this.m_sCtgyPurp); aXmlWriter.WriteEndElement(); } aXmlWriter.WriteEndElement(); } if ((this.m_sMndtId != null) || (this.m_dtMndtDtOfSgntr > DateTime.MinValue)) { aXmlWriter.WriteStartElement("MndtRltdInf"); if (this.m_sMndtId != null) { aXmlWriter.WriteElementString("MndtId", this.m_sMndtId); } if (this.m_dtMndtDtOfSgntr > DateTime.MinValue) { SepaUtil.WriteDtXml(aXmlWriter, "DtOfSgntr", this.m_dtMndtDtOfSgntr); } aXmlWriter.WriteEndElement(); } if (this.m_sRmtInf != null) { aXmlWriter.WriteStartElement("RmtInf"); if (this.m_fRmtInfStrd) { aXmlWriter.WriteStartElement("Strd"); aXmlWriter.WriteRaw(this.m_sRmtInf); aXmlWriter.WriteEndElement(); } else { aXmlWriter.WriteElementString("Ustrd", this.m_sRmtInf); } aXmlWriter.WriteEndElement(); } if (!this.m_aDbtr.IsEmpty()) { this.m_aDbtr.WriteXml(aXmlWriter, aMessageInfo); } if (!this.m_tDbtrAcctIBAN.IsNull) { SepaUtil.WriteAcctXml(aXmlWriter, "DbtrAcct", this.m_tDbtrAcctIBAN, this.m_sDbtrAcctCcy); } if (!this.m_tDbtrAgtBIC.IsNull) { SepaUtil.WriteAgtBIC(aXmlWriter, "DbtrAgt", this.m_tDbtrAgtBIC); } if (!this.m_tCdtrAgtBIC.IsNull) { SepaUtil.WriteAgtBIC(aXmlWriter, "CdtrAgt", this.m_tCdtrAgtBIC); } if (!this.m_aCdtr.IsEmpty()) { this.m_aCdtr.WriteXml(aXmlWriter, aMessageInfo); } if (!this.m_tCdtrAcctIBAN.IsNull) { SepaUtil.WriteAcctXml(aXmlWriter, "CdtrAcct", this.m_tCdtrAcctIBAN, this.m_sCdtrAcctCcy); } aXmlWriter.WriteEndElement(); }
public SepaBankToCustomerMessage(string sMessageTagName, SepaMessageType nMessageType) : base(sMessageTagName, nMessageType) { this.m_aMsgRcpt = new SepaPartyIdentification("MsgRcpt", SepaPartyIdentification.Fields.EBICS | SepaPartyIdentification.Fields.BIC | SepaPartyIdentification.Fields.Name, SepaPartyIdentification.Fields.None); this.m_aStmt = new SepaStatement(this._GetContentTag()); }
public SepaMessageInfo(SepaMessageType nMessageType, int nVersion) { if (nVersion <= 0) { throw new ArgumentException(); } this.m_nMessageType = nMessageType; this.m_nVersion = nVersion; switch (nMessageType) { case SepaMessageType.CreditTransferPaymentInitiation: if (nVersion < 2) { throw new NotSupportedException(); } if (nVersion == 2) { this.m_sMessageTag = "pain.001.001.02"; return; } this.m_sMessageTag = "CstmrCdtTrfInitn"; return; case SepaMessageType.PaymentStatusReport: if (nVersion < 3) { throw new NotSupportedException(); } this.m_sMessageTag = "CstmrPmtStsRpt"; return; case SepaMessageType.DirectDebitPaymentInitiation: if (nVersion == 1) { this.m_sMessageTag = "pain.008.001.01"; return; } if (nVersion == 2) { // this.m_sMessageTag = "pain.008.001.02"; this.m_sMessageTag = "pain.008.003.02"; return; } this.m_sMessageTag = "CstmrDrctDbtInitn"; return; case SepaMessageType.BankToCustomerAccountReport: if (nVersion < 2) { throw new NotSupportedException(); } this.m_sMessageTag = "BkToCstmrAcctRpt"; return; case SepaMessageType.BankToCustomerStatement: if (nVersion < 2) { throw new NotSupportedException(); } this.m_sMessageTag = "BkToCstmrStmt"; return; case SepaMessageType.BankToCustomerDebitCreditNotification: if (nVersion < 2) { throw new NotSupportedException(); } this.m_sMessageTag = "BkToCstmrDbtCdtNtfctn"; return; } throw new ArgumentException(); }