示例#1
0
 protected override void OnWriteXml(XmlWriter aXmlWriter, SepaMessageInfo aMessageInfo)
 {
     if ((this.m_sNtryRef != null) && (this.m_sNtryRef != ""))
     {
         aXmlWriter.WriteElementString("NtryRef", this.m_sNtryRef);
     }
     this.m_aAmt.WriteXml(aXmlWriter, "Amt");
     if (this.m_fRvslInd)
     {
         aXmlWriter.WriteElementString("RvslInd", XmlConvert.ToString(this.m_fRvslInd));
     }
     aXmlWriter.WriteElementString("Sts", this.m_sSts);
     if (this.m_dtBookgDt > DateTime.MinValue)
     {
         aXmlWriter.WriteStartElement("BookgDt");
         SepaUtil.WriteDtXml(aXmlWriter, "Dt", this.m_dtBookgDt);
         aXmlWriter.WriteEndElement();
     }
     if (this.m_dtValDt > DateTime.MinValue)
     {
         aXmlWriter.WriteStartElement("ValDt");
         SepaUtil.WriteDtXml(aXmlWriter, "Dt", this.m_dtValDt);
         aXmlWriter.WriteEndElement();
     }
     if ((this.m_sAcctSvcrRef != null) && (this.m_sAcctSvcrRef != ""))
     {
         aXmlWriter.WriteElementString("AcctSvcrRef", this.m_sAcctSvcrRef);
     }
     SepaUtil.WriteBkTxCd(aXmlWriter, this.m_sBkTxCd, this.m_sBkTxCdIssr);
     if (((this.m_sAddtlInfIndMsgNmId != null) && (this.m_sAddtlInfIndMsgNmId != "")) || ((this.m_sAddtlInfIndMsgId != null) && (this.m_sAddtlInfIndMsgId != "")))
     {
         aXmlWriter.WriteStartElement("AddtlInfInd");
         if ((this.m_sAddtlInfIndMsgNmId != null) && (this.m_sAddtlInfIndMsgNmId != ""))
         {
             aXmlWriter.WriteElementString("MsgNmId", this.m_sAddtlInfIndMsgNmId);
         }
         if ((this.m_sAddtlInfIndMsgId != null) && (this.m_sAddtlInfIndMsgId != ""))
         {
             aXmlWriter.WriteElementString("MsgId", this.m_sAddtlInfIndMsgId);
         }
         aXmlWriter.WriteEndElement();
     }
     if (this.m_vTxDtls.Count > 0)
     {
         aXmlWriter.WriteStartElement("NtryDtls");
         if ((this.m_sBtchPmtInfId != null) && (this.m_sBtchPmtInfId != ""))
         {
             aXmlWriter.WriteStartElement("Btch");
             aXmlWriter.WriteElementString("PmtInfId", this.m_sBtchPmtInfId);
             aXmlWriter.WriteEndElement();
         }
         this.m_vTxDtls.WriteXml(aXmlWriter, aMessageInfo);
         aXmlWriter.WriteEndElement();
     }
     if ((this.m_sAddtlNtryInf != null) && (this.m_sAddtlNtryInf != ""))
     {
         aXmlWriter.WriteElementString("AddtlNtryInf", this.m_sAddtlNtryInf);
     }
 }
示例#2
0
 protected override void OnWriteXml(XmlWriter aXmlWriter, SepaMessageInfo aMessageInfo)
 {
     aXmlWriter.WriteStartElement("Tp");
     aXmlWriter.WriteStartElement("CdOrPrtry");
     aXmlWriter.WriteElementString("Cd", this.m_sTpCd);
     aXmlWriter.WriteEndElement();
     aXmlWriter.WriteEndElement();
     this.m_aAmt.WriteXml(aXmlWriter, "Amt");
     aXmlWriter.WriteStartElement("Dt");
     SepaUtil.WriteDtXml(aXmlWriter, "Dt", this.m_dtDt);
     aXmlWriter.WriteEndElement();
 }
示例#3
0
        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.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);
 }
示例#6
0
        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();
        }