Class FinXmlOrderBuilder

Namespace
Subsembly.FinTS
Assembly
Subsembly.FinTS.Core.dll

Builds FinXmlOrder instances from XML order data and provides bank parameter data in XML format.

public class FinXmlOrderBuilder
Inheritance
FinXmlOrderBuilder
Inherited Members

Remarks

The FinXmlOrderBuilder provides the hub for working with orders, response data and parameter data in XML format. When creating an instance of the FinXmlOrderBuilder class, one must supply an instance of the FinTransmogrifierRepository class. The supplied Transmogrifier repository must contain the segment syntax of all order, response and parameter segments that shall be supported by the new FinXmlOrderBuilder instance.

According to FinTS 4.0 the name of the XML tag of an order must be constructed according to the pattern Name_Version_Req, the name of the XML tag of the corresponding response XML must be Name_Version_Req, and the name of the XML tag of the parameter XML must be Name_Version_Par. Within the context of the FinTS Subsembly, the Name part of this tag name is called the Order Tag and the complete tag name is called the Segment Tag. Furthermore, the Version part of the tag name is assumed to be equal to the version number of the transmogrified segment.

The XML syntax description required to transmogrify the HIBPA segment is already hard coded in this class and thus must not be supplied by the client application.

Constructors

FinXmlOrderBuilder(FinContact, FinTransmogrifierRepository)

Creates an XML order builder for a particular contact using the given Transmogrifier repository.

public FinXmlOrderBuilder(FinContact aContact, FinTransmogrifierRepository aTransmogrifierRepository)

Parameters

aContact FinContact

Contact data of a fully initialised and synchronised contact for which to create the FinXmlOrderBuilder instance. Must not be null.

aTransmogrifierRepository FinTransmogrifierRepository

Instance of FinTransmogrifierRepository that contains the syntax descriptions of all types of order segments, response segments and parameter segments that will be used together with the constructed FinXmlOrderBuilder instance. Must not be null.

Exceptions

ArgumentNullException

A parameter was null.

Properties

BankParamDataXml

Provides the Bank Parameter Data (BPD) in transmogrified XML format.

public XmlDocument BankParamDataXml { get; }

Property Value

XmlDocument

The provided XML document contains a <BankParamData> root node. Below this root there are the transmogrified BPD segments, starting with the <GenericBankParam> (HIBPA) segment.

Only those BPD segments are transmogrified, where an appropriate transmogrifier syntax is found in the FinTransmogrifierRepository which was passed to the constructor of this instance. All other BPD segments are simply ignored.

Methods

Build(XmlElement)

Builds a FinXmlOrder from the given XML order data.

public FinXmlOrder Build(XmlElement xmlOrder)

Parameters

xmlOrder XmlElement

The XML order data. The syntax of this XML order data must be defined in the FinTransmogrifierRepository that was given to the constructor of this FinXmlOrderBuilder.

Returns

FinXmlOrder

New FinXmlOrder instance.

Remarks

The root tag of the xmlOrder passed to this method may be a complete Segment Tag (e.g. SingRemitt_5_Req), or just the base Order Tag (e.g. SingRemitt).

In the former case, the exact Segment Tag is used to look up the appropriate FinTransmogrifier in the FinTransmogrifierRepository that was given to the constructor of this FinXmlOrderBuilder. If it doesn't exist, then an exception is thrown. For processing any response segments, the _Req ending is replaced with _Resp and a matching FinTransmogrifier is sought in the FinTransmogrifierRepository. Therefore an appropriately named FinTransmogrifier must be present in the FinTransmogrifierRepository, if any response data is expected.

In the latter case, the exact Transmogrifiers used to create the order segment and process the response segments are derived by comparing the Bank Parameter Data with the Transmogrifiers available in the FinTransmogrifierRepository.

Exceptions

ArgumentNullException

Parameter xmlOrder was null.

ArgumentOutOfRangeException

The tag name of the root tag of the XML order did not end with "_Req".

InvalidOperationException

No Transmogrifier matching the XML order was found in the FinTransmogrifierRepository that was given to the constructor.

Build(XmlElement, string)

Builds a FinXmlOrder from the given XML order data and the expected response tag.

public FinXmlOrder Build(XmlElement xmlOrder, string sResponseTag)

Parameters

xmlOrder XmlElement

The XML order data. The syntax of this XML order data must be defined in the FinTransmogrifierRepository that was given to the constructor of this FinXmlOrder.

sResponseTag string

Tag name of the FinTransmogrifier that shall be used to process any response segments. This may be null if no response data is expected.

If this tag name is given, then an appropriate syntax must be defined in the FinTransmogrifierRepository that was given to the constructor of this FinXmlOrder.

Returns

FinXmlOrder

New FinXmlOrder instance.

Exceptions

ArgumentNullException

Parameter xmlOrder was null.

InvalidOperationException

No transmogrifier matching the XML order or the response tag was found in the FinTransmogrifierRepository that was given to the constructor.

GetOrderParameter(string, string)

Returns the requested parameter from the BPD.

public string GetOrderParameter(string sOrderTag, string sParameterTag)

Parameters

sOrderTag string

XML tag of the order for which the parameter shall be retrieved. This parameter must be given the base tag name without the version number and _Req suffix, for example SingRemitt.

sParameterTag string

The XML tag of the parameter element in the parameter group. For example, MaxNo_PaymtPurposeLines.

Returns

string

If the requested parameter was found then its XML element content is returned as a string. If the parameter element was empty, then an empty string is returned. If the requested order or parameter was not found, then null is returned.

OrderSupported(string)

Checks whether a particular order type is supported by this FinXmlOrderBuilder instance.

public bool OrderSupported(string sOrderTag)

Parameters

sOrderTag string

The base Order Tag without version number and without _Req suffix. For example, "SingRemitt" is the base Order Tag for a single remittance. Must not be null.

Returns

bool

Remarks

For an order to be supported a matching order parameter entry must be present in the bank parameter data of this contact and a matching Transmogrifier must be present in the Transmogrifier repository of this FinXmlOrderBuilder instance.

Exceptions

ArgumentNullException

The sOrderTag parameter was null.

TanRequired(string)

public bool TanRequired(string sOrderTag)

Parameters

sOrderTag string

Returns

bool

TanSecuritySupported(string)

public bool TanSecuritySupported(string sOrderTag)

Parameters

sOrderTag string

Returns

bool