protected override void OnWriteXml(XmlWriter aXmlWriter, SepaMessageInfo aMessageInfo) { if (aMessageInfo.MessageType != SepaMessageType.DirectDebitPaymentInitiation) { throw new ArgumentException(); } base.WritePmtInfIdXml(aXmlWriter); base.WritePmtMtdXml(aXmlWriter); if (aMessageInfo.Version >= 2) { base.WriteBtchBookg(aXmlWriter); base.WriteNbOfTxs(aXmlWriter); base.WriteCtrlSum(aXmlWriter); } aXmlWriter.WriteStartElement("PmtTpInf"); aXmlWriter.WriteStartElement("SvcLvl"); aXmlWriter.WriteElementString("Cd", "SEPA"); aXmlWriter.WriteEndElement(); if (aMessageInfo.XmlNamespace != "urn:sepade:xsd:pain.008.001.01") { aXmlWriter.WriteStartElement("LclInstrm"); aXmlWriter.WriteElementString("Cd", this.m_sLclInstrmCd); aXmlWriter.WriteEndElement(); } aXmlWriter.WriteElementString("SeqTp", this.m_sSeqTp); if (aMessageInfo.XmlNamespace != "urn:sepade:xsd:pain.008.001.01") { base.WriteCtgyPurp(aXmlWriter, aMessageInfo.Version >= 2); } aXmlWriter.WriteEndElement(); SepaUtil.WriteDtXml(aXmlWriter, "ReqdColltnDt", this.m_dtReqdColltnDt); this.m_aCdtr.WriteXml(aXmlWriter, aMessageInfo); string sCcy = (aMessageInfo.XmlNamespace != "urn:sepade:xsd:pain.008.001.01") ? this.m_sCdtrAcctCcy : null; SepaUtil.WriteAcctXml(aXmlWriter, "CdtrAcct", this.m_tCdtrAcctIBAN, sCcy); SepaUtil.WriteAgtBIC(aXmlWriter, "CdtrAgt", this.m_tCdtrAgtBIC); if (!this.m_aUltmtCdtr.IsEmpty()) { this.m_aUltmtCdtr.WriteXml(aXmlWriter, aMessageInfo); } aXmlWriter.WriteElementString("ChrgBr", "SLEV"); if (aMessageInfo.Version >= 2) { SepaUtil.WriteCdtrSchmeIdXml(aXmlWriter, this.m_sCdtrSchmeId, false); } base.WriteTxInfs(aXmlWriter, aMessageInfo); }
protected override void OnWriteXml(XmlWriter aXmlWriter, SepaMessageInfo aMessageInfo) { if (aMessageInfo.MessageType != SepaMessageType.CreditTransferPaymentInitiation) { throw new ArgumentException(); } base.WritePmtInfIdXml(aXmlWriter); base.WritePmtMtdXml(aXmlWriter); if (aMessageInfo.Version >= 3) { base.WriteBtchBookg(aXmlWriter); base.WriteNbOfTxs(aXmlWriter); base.WriteCtrlSum(aXmlWriter); } aXmlWriter.WriteStartElement("PmtTpInf"); if (((aMessageInfo.XmlNamespace != "urn:sepade:xsd:pain.001.001.02") && (this.m_sInstrPrty != null)) && (this.m_sInstrPrty != "")) { aXmlWriter.WriteElementString("InstrPrty", this.m_sInstrPrty); } aXmlWriter.WriteStartElement("SvcLvl"); aXmlWriter.WriteElementString("Cd", this.m_sSvcLvlCd); aXmlWriter.WriteEndElement(); if (aMessageInfo.XmlNamespace != "urn:sepade:xsd:pain.001.001.02") { base.WriteCtgyPurp(aXmlWriter, aMessageInfo.Version >= 3); } aXmlWriter.WriteEndElement(); SepaUtil.WriteDtXml(aXmlWriter, "ReqdExctnDt", this.m_dtReqdExctnDt); this.m_aDbtr.WriteXml(aXmlWriter, aMessageInfo); string sCcy = (aMessageInfo.XmlNamespace != "urn:sepade:xsd:pain.001.001.02") ? this.m_sDbtrAcctCcy : null; SepaUtil.WriteAcctXml(aXmlWriter, "DbtrAcct", this.m_tDbtrAcctIBAN, sCcy); SepaUtil.WriteAgtBIC(aXmlWriter, "DbtrAgt", this.m_tDbtrAgtBIC); if (!this.m_aUltmtDbtr.IsEmpty()) { this.m_aUltmtDbtr.WriteXml(aXmlWriter, aMessageInfo); } aXmlWriter.WriteElementString("ChrgBr", "SLEV"); base.WriteTxInfs(aXmlWriter, aMessageInfo); }
protected override void OnWriteXml(XmlWriter aXmlWriter, SepaMessageInfo aMessageInfo) { if (aMessageInfo.MessageType != SepaMessageType.CreditTransferPaymentInitiation) { throw new ArgumentException(); } base.WritePmtIdXml(aXmlWriter); aXmlWriter.WriteStartElement("Amt"); base.WriteInstdAmtXml(aXmlWriter); aXmlWriter.WriteEndElement(); if (!this.m_tCdtrAgtBIC.IsNull) { SepaUtil.WriteAgtBIC(aXmlWriter, "CdtrAgt", this.m_tCdtrAgtBIC); } this.m_aCdtr.WriteXml(aXmlWriter, aMessageInfo); SepaUtil.WriteAcctXml(aXmlWriter, "CdtrAcct", this.m_tCdtrAcctIBAN, null); if (aMessageInfo.XmlNamespace != "urn:sepade:xsd:pain.001.001.02") { base.WritePurpXml(aXmlWriter); } base.WriteRmtInfXml(aXmlWriter); }
protected override void OnWriteXml(XmlWriter aXmlWriter, SepaMessageInfo aMessageInfo) { if (aMessageInfo.MessageType != SepaMessageType.DirectDebitPaymentInitiation) { throw new ArgumentException(); } base.WritePmtIdXml(aXmlWriter); base.WriteInstdAmtXml(aXmlWriter); aXmlWriter.WriteStartElement("DrctDbtTx"); aXmlWriter.WriteStartElement("MndtRltdInf"); aXmlWriter.WriteElementString("MndtId", this.m_sMndtId); SepaUtil.WriteDtXml(aXmlWriter, "DtOfSgntr", this.m_dtMndtDtOfSgntr); if ((((this.m_sOrgnlMndtId != null) && (this.m_sOrgnlMndtId != "")) || ((this.m_sOrgnlCdtrNm != null) && (this.m_sOrgnlCdtrNm != ""))) || (((this.m_sOrgnlCdtrSchmeId != null) && (this.m_sOrgnlCdtrSchmeId != "")) || (!this.m_tOrgnlDbtrAcctIBAN.IsNull || this.m_fSMNDA))) { aXmlWriter.WriteElementString("AmdmntInd", "true"); aXmlWriter.WriteStartElement("AmdmntInfDtls"); if ((this.m_sOrgnlMndtId != null) && (this.m_sOrgnlMndtId != "")) { aXmlWriter.WriteElementString("OrgnlMndtId", this.m_sOrgnlMndtId); } if (((this.m_sOrgnlCdtrNm != null) && (this.m_sOrgnlCdtrNm != "")) || ((this.m_sOrgnlCdtrSchmeId != null) && (this.m_sOrgnlCdtrSchmeId != ""))) { aXmlWriter.WriteStartElement("OrgnlCdtrSchmeId"); if ((this.m_sOrgnlCdtrNm != null) && (this.m_sOrgnlCdtrNm != "")) { aXmlWriter.WriteElementString("Nm", this.m_sOrgnlCdtrNm); } if ((this.m_sOrgnlCdtrSchmeId != null) && (this.m_sOrgnlCdtrSchmeId != "")) { SepaUtil.WriteSepaIdXml(aXmlWriter, this.m_sOrgnlCdtrSchmeId, aMessageInfo.Version == 1); } aXmlWriter.WriteEndElement(); } if (!this.m_tOrgnlDbtrAcctIBAN.IsNull) { SepaUtil.WriteAcctXml(aXmlWriter, "OrgnlDbtrAcct", this.m_tOrgnlDbtrAcctIBAN, null); } if (this.m_fSMNDA) { aXmlWriter.WriteStartElement("OrgnlDbtrAgt"); aXmlWriter.WriteStartElement("FinInstnId"); aXmlWriter.WriteStartElement("Othr"); aXmlWriter.WriteElementString("Id", "SMNDA"); aXmlWriter.WriteEndElement(); aXmlWriter.WriteEndElement(); aXmlWriter.WriteEndElement(); } aXmlWriter.WriteEndElement(); } else { aXmlWriter.WriteElementString("AmdmntInd", "false"); } aXmlWriter.WriteEndElement(); if (aMessageInfo.Version == 1) { SepaDirectDebitPaymentInformation paymentInformation = (SepaDirectDebitPaymentInformation)base.PaymentInformation; if (paymentInformation == null) { throw new InvalidOperationException(); } string creditorSchemeIdentification = paymentInformation.CreditorSchemeIdentification; switch (creditorSchemeIdentification) { case null: case "": throw new InvalidOperationException(); } SepaUtil.WriteCdtrSchmeIdXml(aXmlWriter, creditorSchemeIdentification, true); } aXmlWriter.WriteEndElement(); SepaUtil.WriteAgtBIC(aXmlWriter, "DbtrAgt", this.m_tDbtrAgtBIC); this.m_aDbtr.WriteXml(aXmlWriter, aMessageInfo); SepaUtil.WriteAcctXml(aXmlWriter, "DbtrAcct", this.m_tDbtrAcctIBAN, null); if (!this.m_aUltmtDbtr.IsEmpty()) { this.m_aUltmtDbtr.WriteXml(aXmlWriter, aMessageInfo); } if (aMessageInfo.XmlNamespace != "urn:sepade:xsd:pain.008.001.01") { base.WritePurpXml(aXmlWriter); } base.WriteRmtInfXml(aXmlWriter); }
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(); }