Class FinUserParamData

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

Wraps the user parameter data (UPD) sequence.

public sealed class FinUserParamData : IEnumerable
Inheritance
FinUserParamData
Implements
Inherited Members

Remarks

With the introduction of SEPA in HBCI an additional SEPA account information segment with the ID HISPA was specified. This additional segment is not an official part of the UPD. However, in order to have all account information in one convenient place, the HISPA segment can be stored in a FinUserParamData instance. If it is, then the FinAcctInfo data from the HIUPD segments is automatically augmented with the SEPA information from the HISPA segment. In addition, the SEPA information is save together with the UPD and thus also inside the FinContact that owns it.

Constructors

FinUserParamData()

Creates a new and completely empty FinUserParamData instance.

public FinUserParamData()

FinUserParamData(FinSegment)

Creates a new FinUserParamData instance from a given HIUPA segment.

public FinUserParamData(FinSegment aHIUPA)

Parameters

aHIUPA FinSegment

HIUPA segment that is the initial content of this FinUserParamData instance. May be null.

Exceptions

ArgumentException

The given HIUPA segment does not have the Type HIUPA.

Properties

AcctInfos

List of collected HIUPD segments.

public IList AcctInfos { get; }

Property Value

IList

Count

Number of accounts available in this user parameter data.

public int Count { get; }

Property Value

int

Extension

Optional extension information from extended HIUPA segment version 4.

public string Extension { get; }

Property Value

string

A string with up to 2048 characters with proprietary content. If not supplied, then this property is null.

HIUPA

Provides direct access to the HIUPA segment.

public FinSegment HIUPA { get; }

Property Value

FinSegment

Remarks

Direct access to the HIUPA segment is discouraged. Instead the various properties of this class shall be used to access the information from the HIUPA segment.

HaveAllSepaInfos

Indicates whether an IBAN and BIC is available for all HIUPD accounts in this collection.

public bool HaveAllSepaInfos { get; }

Property Value

bool

Remarks

This property is also true, if the collection is empty. In addition only accounts that actually support HKSPA are considered. If this is true, then no HKSPA is needed.

IsEmpty

Is

true
if this UPD sequence does not have any HIUPA or HIUPD segments, yet.
public bool IsEmpty { get; }

Property Value

bool

this[int]

Access account information by index.

public FinAcctInfo this[int i] { get; }

Parameters

i int

Property Value

FinAcctInfo

Remarks

The valid index ranges from zero through Count-1. Only the HIUPD segments are indexed and available through this indexer, the HIUPA segment is separate.

Exceptions

ArgumentOutOfRangeException

The given index was negative or otehrwise outside the range of available HIUPD segments.

SepaInfos

List of collected HISPA segments.

public IList SepaInfos { get; }

Property Value

IList

Usage

UPD usage flag from the HIUPA segment.

public int Usage { get; }

Property Value

int

The value 0 indicates that any transaction types that are not given by the HIUPD segments are not allowed. The value 1 indicates that additional transaction types might be allowed.

UserID

User ID from the HIUPA segment.

public string UserID { get; }

Property Value

string

UserName

Optional user name from HIUPD segment according to FinTS 3.0.

public string UserName { get; }

Property Value

string

A string with up to 35 characters. If not supplied, then this property is null.

Version

UPD version from the HIUPA segment.

public int Version { get; }

Property Value

int

Methods

Clear()

Remove all UPD segments from this UPD Sequence.

public void Clear()

FindAccount(FinAcct)

public FinAcctInfo FindAccount(FinAcct aAcct)

Parameters

aAcct FinAcct

Returns

FinAcctInfo

FindAccount(SepaIBAN, string)

Find the HIUPD segment for a particular account with a given IBAN.

public FinAcctInfo FindAccount(SepaIBAN tIBAN, string sCurrency)

Parameters

tIBAN SepaIBAN

The IBAN of the account that is sought. This must not be a null IBAN.

sCurrency string

The currency of the account that is sought. If this is null, then the currency will be ignored when matching the HIUPD segments. It is highly recommended to pass a valid account currency.

Returns

FinAcctInfo

Remarks

This method does cannot find portfolio accounts, as these usually do neither have an IBAN nor a currency.

FindAccount(string)

DEPRECTATED: Find first account info with a particular account number.

public FinAcctInfo FindAccount(string sAcctNo)

Parameters

sAcctNo string

Account number to seek in user parameter data.

Returns

FinAcctInfo

If the requested account information was found, then its FinAcctInfo instance is returned. If no matching account was found, then null is returned.

Remarks

When comparing account numbers any leding zeroes are ignored.

This method is DEPRECTATED. Please use the overloaded FindAccount(string, string, string, bool) instead. The account number alone is not enough to sufficiently determine a particular account.

Exceptions

ArgumentNullException

The given sAcctNo parameter was null.

FindAccount(string, string, string, FinAcctTypeClass)

Find the HIUPD segment for a particular account.

public FinAcctInfo FindAccount(string sBankCode, string sAcctNo, string sCurrency, FinAcctTypeClass nAcctTypeClass)

Parameters

sBankCode string

The bank code of the account that is sought. If this is null, then the bank code will be ignored when matching the HIUPD segments.

sAcctNo string

The account number of the account that is sought. This must not be null, and must not be an empty string. Any leading zeroes are ignored.

sCurrency string

The currency of the account that is sought. If this is null, then the currency will be ignored when matching the HIUPD segments. It is required, to pass null for the currency when seeking a portfolio account. It is highly recommended to pass a valid currency for all other account types.

nAcctTypeClass FinAcctTypeClass

The class of the account type to be sought. An attempt is made to match this class to the account type of the available accounts. If a perfect match is found, then that account is returned. If no match is found, then the first account where the other criterias are matching is returned.

Returns

FinAcctInfo

FindAccount(string, string, string, bool)

Find the HIUPD segment for a particular account.

public FinAcctInfo FindAccount(string sBankCode, string sAcctNo, string sCurrency, bool fPortfolio)

Parameters

sBankCode string

The bank code of the account that is sought. If this is null, then the bank code will be ignored when matching the HIUPD segments.

sAcctNo string

The account number of the account that is sought. This must not be null, and must not be an empty string. Any leading zeroes are ignored.

sCurrency string

The currency of the account that is sought. If this is null, then the currency will be ignored when matching the HIUPD segments. It is required, to pass null for the currency when seeking a portfolio account. It is highly recommended to pass a valid currency for all other account types.

fPortfolio bool

Must be true if a portfolio account (Wertpapierdepot) is sought. If false then an ordinary banking account is sought.

Returns

FinAcctInfo

FindAccount(string, string, string, string, FinAcctTypeClass)

Find the HIUPD segment for a particular account.

public FinAcctInfo FindAccount(string sBankCode, string sAcctNo, string sCurrency, string sSubAcctCharacteristic, FinAcctTypeClass nAcctTypeClass)

Parameters

sBankCode string

The bank code of the account that is sought. If this is null, then the bank code will be ignored when matching the HIUPD segments.

sAcctNo string

The account number of the account that is sought. This must not be null, and must not be an empty string. Any leading zeroes are ignored.

sCurrency string

The currency of the account that is sought. If this is null, then the currency will be ignored when matching the HIUPD segments. It is required, to pass null for the currency when seeking a portfolio account. It is highly recommended to pass a valid currency for all other account types.

sSubAcctCharacteristic string

If known, the subaccount identifier of the account that is sought. If this is null, then the subaccount identifier will be ignored when matching the HIUPD segments.

nAcctTypeClass FinAcctTypeClass

The class of the account type to be sought. An attempt is made to match this class to the account type of the available accounts. If a perfect match is found, then that account is returned. If no match is found, then the first account where the other criterias are matching is returned.

Returns

FinAcctInfo

GetEnumerator()

Implements IEnumerable and provides an enumerator that iterates all HIUPD segments as FinAcctInfo instances.

public IEnumerator GetEnumerator()

Returns

IEnumerator

Read(Stream)

Reads a complete user parameter data segment sequence from a given stream.

public static FinUserParamData Read(Stream aStream)

Parameters

aStream Stream

Input stream that provides the raw user parameter data segment sequence.

Returns

FinUserParamData

Returns a new instance of the FinUserParamData class initialised with the user parameter data segment sequence from the loaded stream.

Exceptions

ArgumentNullException

Parameter aStream was null.

Write(Stream)

Writes the complete user parameter data segment sequence to the given stream.

public void Write(Stream aStream)

Parameters

aStream Stream

Output stream that receives the raw user parameter data segment sequence.

Exceptions

ArgumentNullException

Parameter aStream was null.