Class SepaMessageInfo
Describes the details of a particular SEPA message variant.
Inheritance
Inherited Members
Namespace: Subsembly.Sepa
Assembly: Subsembly.Sepa.dll
Syntax
public sealed class SepaMessageInfo
Remarks
At a minimum there are the properties MessageType, Version, and MessageTag which generically describe the message type. These basic properties are set in the object constructor and cannot be changed thereafter.
For special variants of SEPA messages, the optional properties XmlNamespace and XmlSchemaLocation provide further information about the variant. These properties can be changed after the object has been created.
Constructors
SepaMessageInfo(SepaMessageInfo)
Creates a new SepaMessageInfo object as a copy of another one.
Declaration
public SepaMessageInfo(SepaMessageInfo aMessageInfo)
Parameters
Type | Name | Description |
---|---|---|
SepaMessageInfo | aMessageInfo | SepaMessageInfo to copy. Must not be |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The aMessageInfo parameter was |
SepaMessageInfo(SepaMessageType, Int32)
Creates a new generic SepaMessageInfo object for a given message type and version.
Declaration
public SepaMessageInfo(SepaMessageType nMessageType, int nVersion)
Parameters
Type | Name | Description |
---|---|---|
SepaMessageType | nMessageType | The fundamental SEPA message type. |
System.Int32 | nVersion | The SEPA message version number. This usually corresponds with the last two digits of a payment initiation name. For example, given the message specification "pain.001.002.03", the version number would be 3. The value must not be 0 or negative. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | The parameter nVersion was less than 1 or the parameter nMessageType was invalid. |
SepaMessageInfo(SepaMessageType, Int32, String, String, String)
Creates a fully specified new SepaMessageInfo object.
Declaration
public SepaMessageInfo(SepaMessageType nMessageType, int nVersion, string sMessageTag, string sXmlNamespace, string sXmlSchemaLocation)
Parameters
Type | Name | Description |
---|---|---|
SepaMessageType | nMessageType | The fundamental SEPA message type. |
System.Int32 | nVersion | The SEPA message version number. This usually corresponds with the last two digits of a payment initiataion name. For example, given the message specification "pain.001.002.03", the version number would be 3. The value must not be 0 or negative. |
System.String | sMessageTag | The mandatory SEPA message (XML) tag. Note that the correct message tag that must be used is usually predetermined by the message type and version. |
System.String | sXmlNamespace | The optional XML namespace. This may be an empty string in order to signify the
unnamed default namespace. This may be |
System.String | sXmlSchemaLocation | The optional XML schema location. This may be |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The sMessageTag parameter was |
System.ArgumentException | The parameter nVersion was less than 1, or the parameter sMessageTag was not a valid XML tag name. |
Properties
MessageTag
The SEPA message XML tag.
Declaration
public string MessageTag { get; }
Property Value
Type | Description |
---|---|
System.String |
MessageType
The fundamental SEPA message type.
Declaration
public SepaMessageType MessageType { get; }
Property Value
Type | Description |
---|---|
SepaMessageType |
PainIdentifier
The SEPA message identifier.
Declaration
public string PainIdentifier { get; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
This returns a string in the format "pain.000.000.00" which identifies the SEPA message type and version. If a XmlNamespace was set, then it is used in an attempt to determine the exact message variant.
If this message info does not describe a Pain message, then null
is
returned.
Version
The SEPA message version.
Declaration
public int Version { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
This usually corresponds with the last two digits of a payment initiataion name. For example, given the message specification "pain.001.002.03", the version number would be 3. The value must not be 0 or negative.
WellKnownMessage
If created via Create(SepaWellKnownMessageInfos), then this is the SepaWellKnownMessageInfos value that used for creating this instance.
Declaration
public SepaWellKnownMessageInfos WellKnownMessage { get; }
Property Value
Type | Description |
---|---|
SepaWellKnownMessageInfos |
XmlNamespace
The SEPA message XML namespace URN.
Declaration
public string XmlNamespace { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
This may be an empty string to signify the unnamed default namespace.
This may be null
for a generic SEPA message information.
XmlSchemaLocation
The SEPA message XML schema location.
Declaration
public string XmlSchemaLocation { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
This may be null
if the schema location was not included in a parsed
message, or should not be included in a generated message.
Methods
Clone()
Creates a copy of this SepaMessageInfo object.
Declaration
public SepaMessageInfo Clone()
Returns
Type | Description |
---|---|
SepaMessageInfo | A copy of this SepaMessageInfo object. |
Create(SepaWellKnownMessageInfos)
Creates a SepaMessageInfo object for a well known message variant.
Declaration
public static SepaMessageInfo Create(SepaWellKnownMessageInfos nWellKnownMessage)
Parameters
Type | Name | Description |
---|---|---|
SepaWellKnownMessageInfos | nWellKnownMessage | The well known message variant for which to create a new SepaMessageInfo object. |
Returns
Type | Description |
---|---|
SepaMessageInfo |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | The given parameter nWellKnownMessage had an unknown value. |
Create(String, String)
Creates a SepaMessageInfo object for a particular SEPA message tag.
Declaration
public static SepaMessageInfo Create(string sMessageTag, string sXmlNamespace)
Parameters
Type | Name | Description |
---|---|---|
System.String | sMessageTag | The XML message tag for which a SepaMessageInfo object shall be created.
Currently this must be one of "CstmrCdtTrfInitn", "CstmrDrctDbtInitn",
"CstmrPmtStsRpt", "BkToCstmrAcctRpt", "BkToCstmrStmt", or
"BkToCstmrDbtCdtNtfctn". For any unknown message tag this method
will return |
System.String | sXmlNamespace | The XML namespace URN from the XML document. |
Returns
Type | Description |
---|---|
SepaMessageInfo | A new SepaMessageInfo object which describes a SEPA message with the given message
tag or |
GetAllWellKnownMessageInfos(SepaMessageType)
Get the SepaMessageInfo for all SepaWellKnownMessageInfos that are supported by this implementation.
Declaration
public static SepaMessageInfo[] GetAllWellKnownMessageInfos(SepaMessageType nMessageType)
Parameters
Type | Name | Description |
---|---|---|
SepaMessageType | nMessageType |
Returns
Type | Description |
---|---|
SepaMessageInfo[] |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | The given |
GetAllWellKnownMessageInfos(SepaMessageType, String)
Get the SepaMessageInfo for all SepaWellKnownMessageInfos for a particular country that are supported by this implementation.
Declaration
public static SepaMessageInfo[] GetAllWellKnownMessageInfos(SepaMessageType nMessageType, string sCountryCode)
Parameters
Type | Name | Description |
---|---|---|
SepaMessageType | nMessageType | |
System.String | sCountryCode | Optional country code which limits the returned message infos to only those that
have been specified by that specific country. If this is |
Returns
Type | Description |
---|---|
SepaMessageInfo[] | Always returns a non-null array of newly created SepaMessageInfo
instances. The returned array may be empty, if a |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | The given |
GetAustrianWellKnownMessageInfo(String)
Declaration
public static SepaWellKnownMessageInfos GetAustrianWellKnownMessageInfo(string sMessageFormat)
Parameters
Type | Name | Description |
---|---|---|
System.String | sMessageFormat |
Returns
Type | Description |
---|---|
SepaWellKnownMessageInfos |
GetCountryCode(SepaWellKnownMessageInfos)
Declaration
public static string GetCountryCode(SepaWellKnownMessageInfos nWellKnownMessage)
Parameters
Type | Name | Description |
---|---|---|
SepaWellKnownMessageInfos | nWellKnownMessage |
Returns
Type | Description |
---|---|
System.String | Returns the country code of the country that specified the particular well known
message info, or |
GetMessageTag(SepaMessageType)
Get the XML message tag that shall be used for the given message type.
Declaration
public static string GetMessageTag(SepaMessageType nMessageType)
Parameters
Type | Name | Description |
---|---|---|
SepaMessageType | nMessageType |
Returns
Type | Description |
---|---|
System.String |
Remarks
This method only returns the current message tags. It never returns the obsolete "pain.001.001.02" or "pain.008.001.01" message tags.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | The given |
GetNamespace(SepaWellKnownMessageInfos)
Gets the XML namespace URN for a particular well known SEPA message variant.
Declaration
public static string GetNamespace(SepaWellKnownMessageInfos nWellKnownMessage)
Parameters
Type | Name | Description |
---|---|---|
SepaWellKnownMessageInfos | nWellKnownMessage | The SEPA message variant for which to get the XML namespace URN. |
Returns
Type | Description |
---|---|
System.String | Returns the XML namespace URN, or an empty string if it is a generic message
variant, or |
GetSchemaLocation(SepaWellKnownMessageInfos)
Gets the XML schema location for a particular well known SEPA message variant.
Declaration
public static string GetSchemaLocation(SepaWellKnownMessageInfos nWellKnownMessage)
Parameters
Type | Name | Description |
---|---|---|
SepaWellKnownMessageInfos | nWellKnownMessage | The SEPA message variant for which to get the XML schema location. |
Returns
Type | Description |
---|---|
System.String | Returns the XML schema location, or |
GetSwissWellKnownMessageInfo(String)
Declaration
public static SepaWellKnownMessageInfos GetSwissWellKnownMessageInfo(string sMessageFormat)
Parameters
Type | Name | Description |
---|---|---|
System.String | sMessageFormat |
Returns
Type | Description |
---|---|
SepaWellKnownMessageInfos |
GetZkaWellKnownMessageInfo(String)
Returns the ZKA defined message for a given message format.
Declaration
public static SepaWellKnownMessageInfos GetZkaWellKnownMessageInfo(string sMessageFormat)
Parameters
Type | Name | Description |
---|---|---|
System.String | sMessageFormat | A message format string in the format "pain.000.000.00", or "camt.000.000.00". |
Returns
Type | Description |
---|---|
SepaWellKnownMessageInfos | If the message format is known, then the corresponding well known ZKA format is returned. If the message format is not known, then Null is returned. |
NewMessage()
Creates a new SepaMessage object with the given SEPA message type.
Declaration
public SepaMessage NewMessage()
Returns
Type | Description |
---|---|
SepaMessage | A new SepaMessage object. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | There is no implementation available for this MessageType. |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |