Beispiel #1
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);
        }
Beispiel #2
0
 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;
 }
Beispiel #3
0
 public SepaObject(string sTagName)
 {
     if (!SepaUtil.CheckTagName(sTagName))
     {
         throw new ArgumentException();
     }
     this.m_sTagName = sTagName;
 }