Class FinOrderBuilder
Base class for concrete order builders. A concrete derived order builder class builds a specific FinOrder derived class.
public class FinOrderBuilder
- Inheritance
-
FinOrderBuilder
- Derived
- Inherited Members
Remarks
All actual FinOrder derived order classes can only be created through their corresponding FinOrderBuilder derived class. Thus, to create an order, the first step is to create the appropriate FinOrderBuilder derived class. For example: In order to create an account balance inquiry order, the first step is to create a FinAcctBalBuilder instance. Then its Build(FinAcct, bool) method must be called, which will return a new FinAcctBal instance, derived from FinOrder. An FinOrderBuilder derived class needs only be created once and can be used to create any number of orders.
The second task of all FinOrderBuilder derived classes is to provide convenient access to the bank parameter data associated with their type of order. Derived classes usually make bank parameter data available as simple objcet properties.
Classes that derive from FinOrderBuilder must call Init(FinOrderSegmentInfo[]) in order to initialise the order builder.
Constructors
FinOrderBuilder(FinContact)
protected FinOrderBuilder(FinContact aContact)
Parameters
aContact
FinContact
FinOrderBuilder(FinContact, FinAcctTypeClass)
protected FinOrderBuilder(FinContact aContact, FinAcctTypeClass nAcctTypeClass)
Parameters
aContact
FinContactThe contact for which the order builder shall create orders. This is used to get the FinTS version, the bank parameter data and the user parameter data that are in effect. This parameter must not be
null
.nAcctTypeClass
FinAcctTypeClassMust be set to the preferred account type class of the implementing order.
Properties
BankParamSegment
The bank parameter segment that was chosen for the type of order that this class will build.
public FinSegment BankParamSegment { get; }
Property Value
Contact
public FinContact Contact { get; }
Property Value
FinTSVersion
The FinTS version that the chosen order segment version was designed for.
public int FinTSVersion { get; }
Property Value
Remarks
This is not necessarily the FinTS version that will be used as the protocol version for the online dialog. The purpose of this information is to control the correct handling of FinTS version dependent idioms such as the security level and the subaccount characteristic.
IsSupported
Indicates whether the order type is supported by checking whether the requested BPD segment is available.
public virtual bool IsSupported { get; }
Property Value
MaxOrders
Maximum number of orders of this type that can be sent in a single FinTS message.
public int MaxOrders { get; }
Property Value
- int
This is in the range from 1 through 999.
MinSignatures
Minimum number of signatures required when sending an order of the derived type.
public int MinSignatures { get; }
Property Value
- int
Usually this is only zero (for orders that can be sent without any signature) or one (for orders that have to be signed). The FinTS defined range is from zero through three.
OrderSegmentInfo
The order segment information that was chosen by this builder.
public FinOrderSegmentInfo OrderSegmentInfo { get; }
Property Value
OrderSegmentType
The order segment type that was chosen by this order builder.
public string OrderSegmentType { get; }
Property Value
ParamSegmentType
The parameter segment type that was chosen by this order builder.
public string ParamSegmentType { get; }
Property Value
ParameterCount
Provides the number of parameter GDs that are given in the BPD segment for this order type.
public int ParameterCount { get; }
Property Value
- int
This will be zero until initialised.
ParameterDEG
Provides the DEG group position where the parameters can be found inside the BPD segment of this order type.
public int ParameterDEG { get; }
Property Value
- int
This is usually 4 for all HBCI versions up to HBCI 2.2 and 5 for FinTS 3.0. It is zero until initialised.
SecurityLevel
Required security level for sending an order of the derived type.
public int SecurityLevel { get; }
Property Value
- int
The concept of security levels is currently only defined for FinTS 3.0.
SegmentVersion
The segment version that was chosen by this order builder.
public int SegmentVersion { get; }
Property Value
SepaDomesticAcctAllowed
Indicates whether the domestic account information is allowed in an international account data element group.
protected bool SepaDomesticAcctAllowed { get; }
Property Value
Remarks
This is a conveniece for easy access of this.Contact.SepaAcctInfoBuilder.DomesticAcctAllowed.
SepaOrderCustAcct
Indicates whether this order builder needs a SEPA ordering account.
public bool SepaOrderCustAcct { get; }
Property Value
TanRequired
Indicates whether a TAN is required when sending an order of the derived type.
public bool TanRequired { get; }
Property Value
- bool
If this is
, then a TAN is required, if this istrue
, then no TAN is required. In the latter case, there is stillfalse
a PIN required, unless MinSignatures is zero, too.
TanSecuritySupported
Indicates whether an order of the derived type may be sent using PIN/TAN security.
public bool TanSecuritySupported { get; }
Property Value
Methods
AugmentSubAcctCharacteristic(FinAcct)
If needed, then try to augment the sub-account-characteristic from the UPD.
protected void AugmentSubAcctCharacteristic(FinAcct aAcct)
Parameters
aAcct
FinAcct
BuildOrderSegment()
Builds a completely uninitialised order segment of an appropriate type.
protected FinSegment BuildOrderSegment()
Returns
- FinSegment
Returns a new instance of an FinSegment.
Remarks
This method is mainly of interest to derived classes and isn't usually called directly by application code.
BuildOrderSegment(FinAcct)
Builds an order segment of an appropriate type initialised with the given ordering account.
protected virtual FinSegment BuildOrderSegment(FinAcct aOrderAcct)
Parameters
aOrderAcct
FinAcctOptional ordering customer account. If this is not
null
, then the account data will be inserted into the DEG number 2 of the newly created segment.
Returns
- FinSegment
Returns a new instance of an FinSegment.
Remarks
This method is mainly of interest to derived classes and isn't usually called directly by application code.
Exceptions
- InvalidOperationException
This FinOrderBuilder instance was not initialised, or the order type is not supported.
FindParameterSegment(FinOrderSegmentInfo)
Find an exactly matching parameter segment.
protected FinSegment FindParameterSegment(FinOrderSegmentInfo aSegInfo)
Parameters
aSegInfo
FinOrderSegmentInfo
Returns
GetAmountParameter(int)
Returns the amount MVE that starts at the given position inside the BPD segments parameter group.
public SwiftAmt GetAmountParameter(int nGD)
Parameters
nGD
int
Returns
GetBoolParameter(int)
Returns the boolean element from the given position inside the BPD segments parameter group.
public bool GetBoolParameter(int nGD)
Parameters
nGD
int
Returns
GetIntegerParameter(int)
Returns the integer element from the given position inside the BPD segments parameter group.
public int GetIntegerParameter(int nGD)
Parameters
nGD
int
Returns
GetStringParameter(int)
Returns the string element from the given position inside the BPD segments parameter group.
public string GetStringParameter(int nGD)
Parameters
nGD
int
Returns
Init(FinOrderSegmentInfo, FinSegment)
For internal use only.
protected void Init(FinOrderSegmentInfo aOrderSegmentInfo, FinSegment aBankParamSegment)
Parameters
aOrderSegmentInfo
FinOrderSegmentInfoThe chosen order segment info.
aBankParamSegment
FinSegmentThe choden bank parameter segment.
Init(FinOrderSegmentInfo[])
Must be called by derived classes in order to initialise this base class.
protected bool Init(FinOrderSegmentInfo[] vaSegmentInfos)
Parameters
vaSegmentInfos
FinOrderSegmentInfo[]An array with information about the order segment types that are supported by the derived implementation. This array is matched against the bank parameter data in order to find the best possible order segment type. This array should contain order segment types in decreasing order of preference. This parameter must not be
null
.
Returns
- bool
If a matching parameter segment was found, then
true
is returned. If not, then the requested order cannot be supported andfalse
is returned.
Remarks
The FinTS version that is used by the dialog for which this order builder shall build suitable order segments is taken from the contact object. The order builder uses this FinTS version in order to find the optimal parameter segment version based on the bank parameter data.