Ejemplo n.º 1
0
 protected override void OnReadXml(XmlReader aXmlReader, SepaMessageInfo aMessageInfo)
 {
     if (aXmlReader.IsStartElement("BIC"))
     {
         this.m_tBIC = new SepaBIC(aXmlReader.ReadElementString("BIC"));
     }
     if (aXmlReader.IsStartElement("ClrSysMmbId"))
     {
         aXmlReader.ReadStartElement();
         if (aXmlReader.IsStartElement("ClrSysId"))
         {
             aXmlReader.Skip();
         }
         this.m_sClrSysMmbId = aXmlReader.ReadElementString("MmbId");
         aXmlReader.ReadEndElement();
     }
     if (aXmlReader.IsStartElement("Nm"))
     {
         this.m_sNm = aXmlReader.ReadElementString();
     }
     if (aXmlReader.IsStartElement("PstlAdr"))
     {
         aXmlReader.Skip();
     }
     if (aXmlReader.IsStartElement("Othr"))
     {
         this.m_sVatId = SepaUtil.ReadOthrId(aXmlReader, "UmsStId");
     }
 }
Ejemplo n.º 2
0
 protected override void OnWriteXml(XmlWriter aXmlWriter, SepaMessageInfo aMessageInfo)
 {
     aXmlWriter.WriteElementString("Id", this.m_sId);
     if (this.m_nElctrncSeqNb > 0)
     {
         aXmlWriter.WriteElementString("ElctrncSeqNb", XmlConvert.ToString(this.m_nElctrncSeqNb));
     }
     if (this.m_nLglSeqNb > 0)
     {
         aXmlWriter.WriteElementString("LglSeqNb", XmlConvert.ToString(this.m_nLglSeqNb));
     }
     aXmlWriter.WriteElementString("CreDtTm", XmlConvert.ToString(this.m_dtCreDtTm, XmlDateTimeSerializationMode.Local));
     if (this.m_dtFrDtTm != DateTime.MinValue)
     {
         aXmlWriter.WriteStartElement("FrToDt");
         aXmlWriter.WriteElementString("FrDtTm", XmlConvert.ToString(this.m_dtFrDtTm, XmlDateTimeSerializationMode.Local));
         aXmlWriter.WriteElementString("ToDtTm", XmlConvert.ToString(this.m_dtToDtTm, XmlDateTimeSerializationMode.Local));
         aXmlWriter.WriteEndElement();
     }
     this.m_aAcct.WriteXml(aXmlWriter, aMessageInfo);
     this.m_vBals.WriteXml(aXmlWriter, aMessageInfo);
     this.m_vNtrys.WriteXml(aXmlWriter, aMessageInfo);
     if ((this.m_sAddtlInf != null) && (this.m_sAddtlInf != ""))
     {
         aXmlWriter.WriteElementString(this._GetAddtlInfTagName(), this.m_sAddtlInf);
     }
 }
        protected override void OnWriteXml(XmlWriter aXmlWriter, SepaMessageInfo aMessageInfo)
        {
            if (base.MessageType != aMessageInfo.MessageType)
            {
                throw new ArgumentException();
            }
            aXmlWriter.WriteStartElement("GrpHdr");
            base.WriteGroupHeaderFields(aXmlWriter, aMessageInfo);
            switch (this.m_nOriginalMessageType)
            {
            case SepaMessageType.CreditTransferPaymentInitiation:
                SepaUtil.WriteAgtBIC(aXmlWriter, "DbtrAgt", this.m_tAgtBIC);
                break;

            case SepaMessageType.DirectDebitPaymentInitiation:
                SepaUtil.WriteAgtBIC(aXmlWriter, "CdtrAgt", this.m_tAgtBIC);
                break;
            }
            aXmlWriter.WriteEndElement();
            aXmlWriter.WriteStartElement("OrgnlGrpInfAndSts");
            aXmlWriter.WriteElementString("OrgnlMsgId", this.m_sOrgnlMsgId);
            aXmlWriter.WriteElementString("OrgnlMsgNmId", this.OriginalMessageNameIdentification);
            aXmlWriter.WriteEndElement();
            this.m_vOrgnlPmtInfs.WriteXml(aXmlWriter, aMessageInfo);
        }
Ejemplo n.º 4
0
 protected override void OnReadXml(XmlReader aXmlReader, SepaMessageInfo aMessageInfo)
 {
     this.m_sOrgnlPmtInfId = aXmlReader.ReadElementString("OrgnlPmtInfId");
     if (aXmlReader.IsStartElement("OrgnlNbOfTxs"))
     {
         aXmlReader.Skip();
     }
     if (aXmlReader.IsStartElement("OrgnlCtrlSum"))
     {
         aXmlReader.Skip();
     }
     if (aXmlReader.IsStartElement("PmtInfSts"))
     {
         if (aXmlReader.ReadElementString() != "RJCT")
         {
             throw new XmlException("Unsupported PmtInfSts");
         }
         while (aXmlReader.IsStartElement("StsRsnInf"))
         {
             SepaStatusReasonInformation item = new SepaStatusReasonInformation();
             item.ReadXml(aXmlReader, aMessageInfo);
             this.m_vStsRsnInfs.Add(item);
         }
     }
     while (aXmlReader.IsStartElement("TxInfAndSts"))
     {
         SepaOriginalTransactionInformation information2 = new SepaOriginalTransactionInformation();
         information2.ReadXml(aXmlReader, aMessageInfo);
         this.m_vTxInfAndSts.Add(information2);
     }
 }
Ejemplo n.º 5
0
        private void _WriteGroupHeader(XmlWriter aXmlWriter, SepaMessageInfo aMessageInfo)
        {
            aXmlWriter.WriteStartElement("GrpHdr");
            base.WriteGroupHeaderFields(aXmlWriter, aMessageInfo);
            if (this.GroupHeader_HasBtchBookg(aMessageInfo))
            {
                SepaTriState state = this._GetBatchBooking();
                if (state == SepaTriState.Mixed)
                {
                    throw new ApplicationException("Mixed BtchBookg indicators!");
                }
                if (state != SepaTriState.Default)
                {
                    aXmlWriter.WriteElementString("BtchBookg", XmlConvert.ToString(state != SepaTriState.False));
                }
            }
            aXmlWriter.WriteElementString("NbOfTxs", XmlConvert.ToString(this.NumberOfTransactions));
            aXmlWriter.WriteElementString("CtrlSum", XmlConvert.ToString(this.ControlSum));
            string str = this.GroupHeader_GetGrpg(aMessageInfo);

            if (str != null)
            {
                aXmlWriter.WriteElementString("Grpg", str);
            }
            this.m_aInitgPty.WriteXml(aXmlWriter, aMessageInfo);
            aXmlWriter.WriteEndElement();
        }
Ejemplo n.º 6
0
 internal void WriteXml(XmlWriter aXmlWriter, SepaMessageInfo aMessageInfo)
 {
     foreach (TSepaObject local in this)
     {
         local.WriteXml(aXmlWriter, aMessageInfo);
     }
 }
Ejemplo n.º 7
0
        public static SepaMessageInfo Create(string sMessageTag, string sXmlNamespace)
        {
            if (sMessageTag == null)
            {
                throw new ArgumentNullException();
            }
            if (!SepaUtil.CheckTagName(sMessageTag))
            {
                throw new ArgumentException();
            }
            SepaMessageInfo info = null;

            switch (sMessageTag)
            {
            case "CstmrCdtTrfInitn":
                info = new SepaMessageInfo(SepaMessageType.CreditTransferPaymentInitiation, _ExtractVersion(sXmlNamespace, "pain.001", 3));
                break;

            case "CstmrDrctDbtInitn":
                info = new SepaMessageInfo(SepaMessageType.DirectDebitPaymentInitiation, _ExtractVersion(sXmlNamespace, "pain.008", 2));
                break;

            case "pain.001.001.02":
                info = new SepaMessageInfo(SepaMessageType.CreditTransferPaymentInitiation, 2);
                break;

            case "pain.008.001.01":
                info = new SepaMessageInfo(SepaMessageType.DirectDebitPaymentInitiation, 1);
                break;

            case "pain.008.001.02":
                info = new SepaMessageInfo(SepaMessageType.DirectDebitPaymentInitiation, 2);
                break;

            case "pain.008.003.02":
                info = new SepaMessageInfo(SepaMessageType.DirectDebitPaymentInitiation, 2);
                break;

            case "CstmrPmtStsRpt":
                info = new SepaMessageInfo(SepaMessageType.PaymentStatusReport, _ExtractVersion(sXmlNamespace, "pain.002", 3));
                break;

            case "BkToCstmrAcctRpt":
                info = new SepaMessageInfo(SepaMessageType.BankToCustomerAccountReport, _ExtractVersion(sXmlNamespace, "camt.052", 2));
                break;

            case "BkToCstmrStmt":
                info = new SepaMessageInfo(SepaMessageType.BankToCustomerStatement, _ExtractVersion(sXmlNamespace, "camt.053", 2));
                break;

            case "BkToCstmrDbtCdtNtfctn":
                info = new SepaMessageInfo(SepaMessageType.BankToCustomerDebitCreditNotification, _ExtractVersion(sXmlNamespace, "camt.054", 2));
                break;

            default:
                return(null);
            }
            info.XmlNamespace = sXmlNamespace;
            return(info);
        }
Ejemplo n.º 8
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);
     }
 }
Ejemplo n.º 9
0
        public static SepaMessageInfo Create(SepaWellKnownMessageInfos nWellKnownMessage)
        {
            SepaMessageInfo info = null;

            switch (nWellKnownMessage)
            {
            case SepaWellKnownMessageInfos.Pain_001_001_02:
            case SepaWellKnownMessageInfos.ZKA_Pain_001_001_02:
            case SepaWellKnownMessageInfos.ZKA_Pain_001_002_02:
            case SepaWellKnownMessageInfos.AT_Pain_001_001_02:
                info = new SepaMessageInfo(SepaMessageType.CreditTransferPaymentInitiation, 2);
                break;

            case SepaWellKnownMessageInfos.Pain_001_001_03:
            case SepaWellKnownMessageInfos.ZKA_Pain_001_002_03:
            case SepaWellKnownMessageInfos.ZKA_Pain_001_003_03:
            case SepaWellKnownMessageInfos.AT_Pain_001_001_03:
                info = new SepaMessageInfo(SepaMessageType.CreditTransferPaymentInitiation, 3);
                break;

            case SepaWellKnownMessageInfos.Pain_008_001_01:
            case SepaWellKnownMessageInfos.ZKA_Pain_008_001_01:
            case SepaWellKnownMessageInfos.ZKA_Pain_008_002_01:
            case SepaWellKnownMessageInfos.AT_Pain_008_001_01:
                info = new SepaMessageInfo(SepaMessageType.DirectDebitPaymentInitiation, 1);
                break;

            case SepaWellKnownMessageInfos.Pain_008_001_02:
            case SepaWellKnownMessageInfos.ZKA_Pain_008_002_02:
            case SepaWellKnownMessageInfos.ZKA_Pain_008_003_02:
            case SepaWellKnownMessageInfos.AT_Pain_008_001_02:
            case SepaWellKnownMessageInfos.Pain_008_003_02:
                info = new SepaMessageInfo(SepaMessageType.DirectDebitPaymentInitiation, 2);
                break;

            case SepaWellKnownMessageInfos.ZKA_Pain_002_002_03:
            case SepaWellKnownMessageInfos.ZKA_Pain_002_003_03:
                info = new SepaMessageInfo(SepaMessageType.PaymentStatusReport, 3);
                break;

            case SepaWellKnownMessageInfos.ZKA_Camt_052_001_02:
                info = new SepaMessageInfo(SepaMessageType.BankToCustomerAccountReport, 2);
                break;

            case SepaWellKnownMessageInfos.ZKA_Camt_053_001_02:
                info = new SepaMessageInfo(SepaMessageType.BankToCustomerStatement, 2);
                break;

            case SepaWellKnownMessageInfos.ZKA_Camt_054_001_02:
                info = new SepaMessageInfo(SepaMessageType.BankToCustomerDebitCreditNotification, 2);
                break;

            default:
                throw new ArgumentException();
            }
            info.m_sXmlNamespace      = GetNamespace(nWellKnownMessage);
            info.m_sXmlSchemaLocation = GetSchemaLocation(nWellKnownMessage);
            return(info);
        }
Ejemplo n.º 10
0
 protected override void OnWriteXml(XmlWriter aXmlWriter, SepaMessageInfo aMessageInfo)
 {
     if (base.MessageType != aMessageInfo.MessageType)
     {
         throw new ArgumentException();
     }
     this._WriteGroupHeader(aXmlWriter, aMessageInfo);
     this.m_vPmtInfs.WriteXml(aXmlWriter, aMessageInfo);
 }
Ejemplo n.º 11
0
 protected override void OnReadXml(XmlReader aXmlReader, SepaMessageInfo aMessageInfo)
 {
     this.m_sId = aXmlReader.ReadElementString("Id");
     if (aXmlReader.IsStartElement("ElctrncSeqNb"))
     {
         this.m_nElctrncSeqNb = XmlConvert.ToInt32(aXmlReader.ReadElementString());
     }
     if (aXmlReader.IsStartElement("LglSeqNb"))
     {
         this.m_nLglSeqNb = XmlConvert.ToInt32(aXmlReader.ReadElementString());
     }
     this.m_dtCreDtTm = SepaUtil.ToLocalDateTime(aXmlReader.ReadElementString("CreDtTm"));
     if (aXmlReader.IsStartElement("FrToDt"))
     {
         aXmlReader.ReadStartElement();
         this.m_dtFrDtTm = SepaUtil.ToLocalDateTime(aXmlReader.ReadElementString("FrDtTm"));
         this.m_dtToDtTm = SepaUtil.ToLocalDateTime(aXmlReader.ReadElementString("ToDtTm"));
         aXmlReader.ReadEndElement();
     }
     if (aXmlReader.IsStartElement("CpyDplctInd"))
     {
         aXmlReader.Skip();
     }
     if (aXmlReader.IsStartElement("RptgSrc"))
     {
         aXmlReader.Skip();
     }
     this.m_aAcct.ReadXml(aXmlReader, aMessageInfo);
     if (aXmlReader.IsStartElement("RltdAcct"))
     {
         aXmlReader.Skip();
     }
     while (aXmlReader.IsStartElement("Intrst"))
     {
         aXmlReader.Skip();
     }
     while (aXmlReader.IsStartElement("Bal"))
     {
         SepaBalance item = new SepaBalance();
         item.ReadXml(aXmlReader, aMessageInfo);
         this.m_vBals.Add(item);
     }
     while (aXmlReader.IsStartElement("TxsSummry"))
     {
         aXmlReader.Skip();
     }
     while (aXmlReader.IsStartElement("Ntry"))
     {
         SepaStatementEntry entry = new SepaStatementEntry();
         entry.ReadXml(aXmlReader, aMessageInfo);
         this.m_vNtrys.Add(entry);
     }
     if (aXmlReader.IsStartElement(this._GetAddtlInfTagName()))
     {
         this.m_sAddtlInf = aXmlReader.ReadElementString();
     }
 }
Ejemplo n.º 12
0
 protected override void OnWriteXml(XmlWriter aXmlWriter, SepaMessageInfo aMessageInfo)
 {
     aXmlWriter.WriteElementString("OrgnlPmtInfId", this.m_sOrgnlPmtInfId);
     if (this.m_vStsRsnInfs.Count > 0)
     {
         aXmlWriter.WriteElementString("PmtInfSts", "RJCT");
         this.m_vStsRsnInfs.WriteXml(aXmlWriter, aMessageInfo);
     }
     this.m_vTxInfAndSts.WriteXml(aXmlWriter, aMessageInfo);
 }
Ejemplo n.º 13
0
 public SepaDocument(SepaMessageInfo aMessageInfo, SepaMessage aMessage)
 {
     this.m_aXmlEncoding = new UTF8Encoding(false);
     if (aMessageInfo == null)
     {
         throw new ArgumentNullException();
     }
     this.m_aMessageInfo = aMessageInfo;
     this.Message        = aMessage;
 }
Ejemplo n.º 14
0
 protected override void OnAfterXmlRead(SepaMessageInfo aMessageInfo)
 {
     if ((this.m_dCtrlSumRead != 0M) && (this.m_dCtrlSumRead != this.ControlSum))
     {
         throw new InvalidOperationException("Read CtrlSum differs from calculated CtrlSum.");
     }
     if ((this.m_nNbOfTxsRead != 0) && (this.m_nNbOfTxsRead != this.NumberOfTransactions))
     {
         throw new InvalidOperationException("Read NbOfTxs differs from calculated NbOfTxs.");
     }
 }
Ejemplo n.º 15
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();
 }
Ejemplo n.º 16
0
 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 (aXmlReader.IsStartElement("Orgtr"))
     {
         this.m_aOrgtr.ReadXml(aXmlReader, aMessageInfo);
     }
     if (aXmlReader.IsStartElement("Rsn"))
     {
         aXmlReader.ReadStartElement();
         this.m_sRsnCd = aXmlReader.ReadElementString("Cd");
         aXmlReader.ReadEndElement();
     }
 }
 protected override void OnWriteXml(XmlWriter aXmlWriter, SepaMessageInfo aMessageInfo)
 {
     if (!this.m_aOrgtr.IsEmpty())
     {
         this.m_aOrgtr.WriteXml(aXmlWriter, aMessageInfo);
     }
     if (this.m_sRsnCd != null)
     {
         aXmlWriter.WriteStartElement("Rsn");
         aXmlWriter.WriteElementString("Cd", this.m_sRsnCd);
         aXmlWriter.WriteEndElement();
     }
 }
        protected override void OnWriteXml(XmlWriter aXmlWriter, SepaMessageInfo aMessageInfo)
        {
            bool flag  = false;
            bool flag2 = false;

            if (base.TagName == "InitgPty")
            {
                flag  = (((aMessageInfo.XmlNamespace == "APC:STUZZA:payments:ISO:pain:001:001:02:austrian:002") || (aMessageInfo.XmlNamespace == "ISO:pain.001.001.03:APC:STUZZA:payments:001")) || (aMessageInfo.XmlNamespace == "APC:STUZZA:payments:ISO:pain:008:001:01:austrian:002")) || (aMessageInfo.XmlNamespace == "ISO:pain.008.001.02:APC:STUZZA:payments:001");
                flag2 = !flag;
            }
            bool flag3 = ((((this.m_nSupportedFields & Fields.Name) != Fields.None) && (this.m_sNm != null)) && (this.m_sNm != "")) && !flag;
            bool flag4 = (((this.m_nSupportedFields & Fields.BIC) != Fields.None) && !this.m_tBIC.IsNull) && !flag2;
            bool flag5 = (((this.m_nSupportedFields & Fields.EBICS) != Fields.None) && (this.m_sEBICSPartnerId != null)) && (this.m_sEBICSPartnerId != "");
            bool flag6 = (((this.m_nSupportedFields & Fields.CdtrId) != Fields.None) && (this.m_sCdtrSchmeId != null)) && (this.m_sCdtrSchmeId != "");

            if (flag3)
            {
                aXmlWriter.WriteElementString("Nm", this.m_sNm);
            }
            if ((flag4 || flag5) || flag6)
            {
                aXmlWriter.WriteStartElement("Id");
                if (flag4 || flag5)
                {
                    aXmlWriter.WriteStartElement("OrgId");
                    if (flag4)
                    {
                        if (flag)
                        {
                            aXmlWriter.WriteElementString("BkPtyId", this.m_tBIC.BIC);
                        }
                        else
                        {
                            aXmlWriter.WriteElementString("BICOrBEI", this.m_tBIC.BIC);
                        }
                    }
                    if (flag5)
                    {
                        SepaUtil.WriteOthrId(aXmlWriter, this.m_sEBICSPartnerId, "EBICS");
                    }
                    aXmlWriter.WriteEndElement();
                }
                if (flag6)
                {
                    aXmlWriter.WriteStartElement("PrvtId");
                    SepaUtil.WriteOthrId(aXmlWriter, this.m_sCdtrSchmeId, null);
                    aXmlWriter.WriteEndElement();
                }
                aXmlWriter.WriteEndElement();
            }
        }
Ejemplo n.º 20
0
 public void WriteXml(XmlWriter aXmlWriter, SepaMessageInfo aMessageInfo)
 {
     if ((aXmlWriter == null) || (aMessageInfo == null))
     {
         throw new ArgumentNullException();
     }
     if (!this.IsValid())
     {
         throw new InvalidOperationException();
     }
     aXmlWriter.WriteStartElement(this.TagName);
     this.OnWriteXml(aXmlWriter, aMessageInfo);
     aXmlWriter.WriteEndElement();
 }
Ejemplo n.º 21
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);
        }
Ejemplo n.º 22
0
        public void ReadXml(XmlReader aXmlReader, SepaMessageInfo aMessageInfo)
        {
            if ((aXmlReader == null) || (aMessageInfo == null))
            {
                throw new ArgumentNullException();
            }
            this.Clear();
            bool isEmptyElement = aXmlReader.IsEmptyElement;

            aXmlReader.ReadStartElement(this.TagName);
            if (!isEmptyElement)
            {
                this.OnReadXml(aXmlReader, aMessageInfo);
                aXmlReader.ReadEndElement();
            }
            this.OnAfterXmlRead(aMessageInfo);
        }
        internal override string GroupHeader_GetGrpg(SepaMessageInfo aMessageInfo)
        {
            switch (aMessageInfo.XmlNamespace)
            {
            case "urn:sepade:xsd:pain.001.001.02":
                return("GRPD");

            case "urn:swift:xsd:$pain.001.002.02":
            case "APC:STUZZA:payments:ISO:pain:001:001:02:austrian:002":
                return("MIXD");
            }
            if (aMessageInfo.Version >= 3)
            {
                return(null);
            }
            return(base.GetDefaultGroupingCode());
        }
Ejemplo n.º 24
0
 protected override void OnWriteXml(XmlWriter aXmlWriter, SepaMessageInfo aMessageInfo)
 {
     aXmlWriter.WriteStartElement("Id");
     if (!this.m_tIBAN.IsNull)
     {
         aXmlWriter.WriteElementString("IBAN", this.m_tIBAN.IBAN);
     }
     else
     {
         aXmlWriter.WriteStartElement("Othr");
         aXmlWriter.WriteElementString("Id", this.m_sOthrId);
         if ((this.m_sOthrSchmeNmCd != null) && (this.m_sOthrSchmeNmCd != ""))
         {
             aXmlWriter.WriteStartElement("SchmeNm");
             aXmlWriter.WriteElementString("Cd", this.m_sOthrSchmeNmCd);
             aXmlWriter.WriteEndElement();
         }
         aXmlWriter.WriteEndElement();
     }
     aXmlWriter.WriteEndElement();
     if ((this.m_sTpCd != null) && (this.m_sTpCd != ""))
     {
         aXmlWriter.WriteStartElement("Tp");
         aXmlWriter.WriteElementString("Cd", this.m_sTpCd);
         aXmlWriter.WriteEndElement();
     }
     if ((this.m_sCcy != null) && (this.m_sCcy != ""))
     {
         aXmlWriter.WriteElementString("Ccy", this.m_sCcy);
     }
     if ((this.m_sNm != null) && (this.m_sNm != ""))
     {
         aXmlWriter.WriteElementString("Nm", this.m_sNm);
     }
     if (!this.m_aOwnr.IsEmpty())
     {
         this.m_aOwnr.WriteXml(aXmlWriter, aMessageInfo);
     }
     if (!this.m_aSvcr.IsEmpty())
     {
         aXmlWriter.WriteStartElement("Svcr");
         this.m_aSvcr.WriteXml(aXmlWriter, aMessageInfo);
         aXmlWriter.WriteEndElement();
     }
 }
Ejemplo n.º 25
0
 protected override void OnReadXml(XmlReader aXmlReader, SepaMessageInfo aMessageInfo)
 {
     if (base.MessageType != aMessageInfo.MessageType)
     {
         throw new ArgumentException();
     }
     this._ReadGroupHeader(aXmlReader, aMessageInfo);
     while (aXmlReader.IsStartElement("PmtInf"))
     {
         SepaPaymentInformation item = this.NewPaymentInformation();
         item.ReadXml(aXmlReader, aMessageInfo);
         if (this.m_nBtchBookgRead != SepaTriState.Default)
         {
             item.BatchBooking = this.m_nBtchBookgRead;
         }
         this.m_vPmtInfs.Add(item);
     }
 }
Ejemplo n.º 26
0
        public static SepaDocument NewDocumentXml(XmlReader aXmlReader)
        {
            if (aXmlReader == null)
            {
                throw new ArgumentNullException();
            }
            aXmlReader.MoveToContent();
            if (aXmlReader.Name != "Document")
            {
                throw new XmlException("No SEPA Document", null);
            }
            string namespaceURI = aXmlReader.NamespaceURI;
            string s            = null;

            if ((namespaceURI != null) && (namespaceURI != ""))
            {
                s = aXmlReader.GetAttribute("schemaLocation", "http://www.w3.org/2001/XMLSchema-instance");
                if ((s != null) && (s != ""))
                {
                    string[] strArray = _Split(s);
                    for (int i = 1; i < strArray.Length; i++)
                    {
                        if (strArray[i - 1] == namespaceURI)
                        {
                            s = strArray[i];
                            break;
                        }
                    }
                }
            }
            aXmlReader.ReadStartElement("Document");
            SepaMessageInfo aMessageInfo = SepaMessageInfo.Create(aXmlReader.LocalName, namespaceURI);

            if (aMessageInfo == null)
            {
                throw new NotSupportedException();
            }
            aMessageInfo.XmlSchemaLocation = s;
            SepaMessage aMessage = aMessageInfo.NewMessage();

            aMessage.ReadXml(aXmlReader, aMessageInfo);
            aXmlReader.ReadEndElement();
            return(new SepaDocument(aMessageInfo, aMessage));
        }
 protected override void OnReadXml(XmlReader aXmlReader, SepaMessageInfo aMessageInfo)
 {
     if (aMessageInfo.MessageType != SepaMessageType.CreditTransferPaymentInitiation)
     {
         throw new ArgumentException();
     }
     base.ReadPmtInfIdXml(aXmlReader);
     base.ReadPmtMtdXml(aXmlReader);
     if (aMessageInfo.Version >= 3)
     {
         base.ReadBtchBookg(aXmlReader);
         base.ReadNbOfTxs(aXmlReader);
         base.ReadCtrlSum(aXmlReader);
     }
     aXmlReader.ReadStartElement("PmtTpInf");
     if (aXmlReader.IsStartElement("InstrPrty"))
     {
         this.m_sInstrPrty = aXmlReader.ReadElementString();
     }
     aXmlReader.ReadStartElement("SvcLvl");
     this.m_sSvcLvlCd = aXmlReader.ReadElementString("Cd");
     aXmlReader.ReadEndElement();
     base.ReadCtgyPurp(aXmlReader, aMessageInfo.Version >= 3);
     aXmlReader.ReadEndElement();
     this.m_dtReqdExctnDt = SepaUtil.ReadDtXml(aXmlReader, "ReqdExctnDt");
     this.m_aDbtr.ReadXml(aXmlReader, aMessageInfo);
     this.m_tDbtrAcctIBAN = SepaUtil.ReadAcctXml(aXmlReader, "DbtrAcct", out this.m_sDbtrAcctCcy);
     this.m_tDbtrAgtBIC   = SepaUtil.ReadAgtBIC(aXmlReader, "DbtrAgt");
     if (aXmlReader.IsStartElement("UltmtDbtr"))
     {
         this.m_aUltmtDbtr.ReadXml(aXmlReader, aMessageInfo);
     }
     if (aXmlReader.IsStartElement("ChrgBr"))
     {
         aXmlReader.ReadElementString();
     }
     while (aXmlReader.IsStartElement("CdtTrfTxInf"))
     {
         SepaCreditTransferTransactionInformation item = (SepaCreditTransferTransactionInformation)this.NewTransactionInformation();
         item.ReadXml(aXmlReader, aMessageInfo);
         base.TransactionInformations.Add(item);
     }
 }
Ejemplo n.º 28
0
        protected void WriteGroupHeaderFields(XmlWriter aXmlWriter, SepaMessageInfo aMessageInfo)
        {
            string str;

            aXmlWriter.WriteElementString("MsgId", this.m_sMsgId);
            if (((aMessageInfo.XmlNamespace == "APC:STUZZA:payments:ISO:pain:001:001:02:austrian:002") || (aMessageInfo.XmlNamespace == "ISO:pain.001.001.03:APC:STUZZA:payments:001")) || ((aMessageInfo.XmlNamespace == "APC:STUZZA:payments:ISO:pain:008:001:01:austrian:002") || (aMessageInfo.XmlNamespace == "ISO:pain.008.001.02:APC:STUZZA:payments:001")))
            {
                str = XmlConvert.ToString(this.m_dtCreDtTm, "yyyy-MM-ddTHH:mm:ss");
            }
            else if (((aMessageInfo.MessageType == SepaMessageType.CreditTransferPaymentInitiation) || (aMessageInfo.MessageType == SepaMessageType.DirectDebitPaymentInitiation)) || (aMessageInfo.MessageType == SepaMessageType.PaymentStatusReport))
            {
                str = XmlConvert.ToString(this.m_dtCreDtTm, XmlDateTimeSerializationMode.Utc);
            }
            else
            {
                str = XmlConvert.ToString(this.m_dtCreDtTm, XmlDateTimeSerializationMode.Local);
            }
            aXmlWriter.WriteElementString("CreDtTm", str);
        }
Ejemplo n.º 29
0
        protected override void OnReadXml(XmlReader aXmlReader, SepaMessageInfo aMessageInfo)
        {
            string str;

            if (aMessageInfo.MessageType != SepaMessageType.CreditTransferPaymentInitiation)
            {
                throw new ArgumentException();
            }
            base.ReadPmtIdXml(aXmlReader);
            if (aXmlReader.IsStartElement("PmtTpInf"))
            {
                aXmlReader.Skip();
            }
            aXmlReader.ReadStartElement("Amt");
            base.ReadInstdAmtXml(aXmlReader);
            aXmlReader.ReadEndElement();
            if (aXmlReader.IsStartElement("ChrgBr"))
            {
                aXmlReader.Skip();
            }
            if (aXmlReader.IsStartElement("UltmtDbtr"))
            {
                aXmlReader.Skip();
            }
            if (aXmlReader.IsStartElement("CdtrAgt"))
            {
                this.m_tCdtrAgtBIC = SepaUtil.ReadAgtBIC(aXmlReader, "CdtrAgt");
            }
            this.m_aCdtr.ReadXml(aXmlReader, aMessageInfo);
            this.m_tCdtrAcctIBAN = SepaUtil.ReadAcctXml(aXmlReader, "CdtrAcct", out str);
            if (aXmlReader.IsStartElement("UltmtCdtr"))
            {
                aXmlReader.Skip();
            }
            while (aXmlReader.IsStartElement("InstrForCdtrAgt"))
            {
                aXmlReader.Skip();
            }
            base.ReadPurpXml(aXmlReader);
            base.ReadRmtInfXml(aXmlReader);
        }
Ejemplo n.º 30
0
 private void _ReadGroupHeader(XmlReader aXmlReader, SepaMessageInfo aMessageInfo)
 {
     aXmlReader.ReadStartElement("GrpHdr");
     base.ReadGroupHeaderFields(aXmlReader, aMessageInfo);
     if (aXmlReader.IsStartElement("BtchBookg"))
     {
         bool flag = XmlConvert.ToBoolean(aXmlReader.ReadElementString());
         this.m_nBtchBookgRead = flag ? SepaTriState.True : SepaTriState.False;
     }
     this.m_nNbOfTxsRead = XmlConvert.ToInt32(aXmlReader.ReadElementString("NbOfTxs"));
     if (aXmlReader.IsStartElement("CtrlSum"))
     {
         this.m_dCtrlSumRead = XmlConvert.ToDecimal(aXmlReader.ReadElementString());
     }
     if (aXmlReader.IsStartElement("Grpg"))
     {
         aXmlReader.ReadElementString();
     }
     this.m_aInitgPty.ReadXml(aXmlReader, aMessageInfo);
     aXmlReader.ReadEndElement();
 }