Class FinAcct

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

Collects information about a financial account.

public class FinAcct : FinPersist
Inheritance
FinAcct
Inherited Members

Remarks

The minimal information required to uniquely identify an account is a three digit ISO 3166 numeric country code (stored in CountryCode), the account number (stored in AcctNo), and sometimes the country specific bank code (stored in BankCode).

A german account is represented an account number with up to 10 digits, the ISO country code 280 and the bank sort code (Bankleitzahl) as the bank code. Optionally a bank may add an arbitrary subaccount characteristic.

Constructors

FinAcct()

Constructs a FinAcct instance with default values.

public FinAcct()

Remarks

By default the CountryCode is set to "280" (Germany) and the Currency code is set to "EUR". All other properties will have a null value.

FinAcct(string, string)

Constructs a FinAcct instance with the given properties.

public FinAcct(string sAcctNo, string sBankCode)

Parameters

sAcctNo string

The account number as a string with up to 30 characters.

sBankCode string

The bank code as a string with up to 30 characters.

Remarks

In addition to the given parameters the CountryCode is set to "280" (Germany) and the Currency code is set to "EUR". All remaning properties will have a null value.

Exceptions

ArgumentOutOfRangeException

If any of the arguments is outside the allowed range, then an ArgumentOutOfRangeException will be thrown.

FinAcct(string, string, string)

Constructs a FinAcct instance with the given properties.

public FinAcct(string sAcctNo, string sCountryCode, string sBankCode)

Parameters

sAcctNo string

The account number as a string with up to 30 characters.

sCountryCode string

The country code as a string with three digits.

sBankCode string

The bank code as a string with up to 30 characters.

Remarks

In addition to the given parameters the Currency code is set to "EUR". All remaning properties will have a null value.

Exceptions

ArgumentOutOfRangeException

If any of the arguments is outside the allowed range, then an ArgumentOutOfRangeException will be thrown.

Properties

AcctNo

The account number of this account record.

public string AcctNo { get; set; }

Property Value

string

The account number is a required property and must hold a string of up to 30 characters. This property is never an empty string but may be null. No validation about the character set or content of a given account number string is made.

Remarks

Actually this field now accepts a string length of up to 34 characters in order to match the maximum length of an account number returned in MT-940 data. However, sending an account number longer than 30 characters in a HBCI segment will always fail.

Exceptions

ArgumentOutOfRangeException

An attempt to set the account number to a string longer than 30 characters will cause an ArgumentOutOfRangeException to be thrown.

BIC

Optional BIC.

public string BIC { get; set; }

Property Value

string

BankCode

The optional bank code of this account.

public string BankCode { get; set; }

Property Value

string

The bank code is an optional property and can hold a string of up to 30 characters or be null.

Remarks

Although, internationally speaking, the bank code is optional, it is a required property for many nations, such as germany.

Exceptions

ArgumentOutOfRangeException

An attempt to set the bank code to a string longer than 30 characters will cause an ArgumentOutOfRangeException to be thrown.

CountryCode

The ISO 3166 numeric country code of this account record.

public string CountryCode { get; set; }

Property Value

string

The country code is a required property and must hold a string of three digits. Although it contains only digits, it is represented as a string, because it may have leding zeroes that must not get lost.

Remarks

No validation is made whether the country code actually exists. Thus any three digit string may be passed.

Although the correct ISO 3166 country code for germany would be 276, the code actually used by FinTS is 280.

Exceptions

ArgumentOutOfRangeException

An attempt to set the country code to a string that does not contain three digits will cause an ArgumentOutOfRangeException to be thrown.

Currency

Optional ISO 4217 alpha currency code of this account.

public string Currency { get; set; }

Property Value

string

An ISO 4217 alpha currency code consists of three upper case letters.

Remarks

Generally all real life accounts have a currency. In FinTS however, the currency code is optional and may be absent for portfolio accounts.

No validation is made whether the currency code actually exists. Thus any string of three upper case letters and digits may be passed.

Exceptions

ArgumentException

An attempt to set the currency code to a string that does not contain three upper case letters or digits will cause an ArgumentException to be thrown.

FromUPD

Optional reference to the HIUPD segment that this instance was constructed from.

public FinAcctInfo FromUPD { get; }

Property Value

FinAcctInfo

Remarks

This property is non-null for all instances that were created from the UPD and are returned through the FinAcctInfo.Acct property.

For instances where this property is not null, all other properties are read-only and cannot be changed. Any attempt to change other properties in this case will produce an immediate IllegalOperationException.

HolderName

Optional account holder name.

public string HolderName { get; set; }

Property Value

string

IBAN

Optional International Bank Account Number (IBAN) of this account.

public string IBAN { get; set; }

Property Value

string

SubAcctCharacteristic

The optional subaccount characteristic of this account record.

public string SubAcctCharacteristic { get; set; }

Property Value

string

The subaccount characteristic is an optional property and can hold a string of up to 30 characters or be null.

Remarks

A subaccount characteristic is some FinTS protocol specific account identification string that is usually of no meaning to and not known by the account holder. It is solely obtained from the account information in the user parameter data.

Exceptions

ArgumentOutOfRangeException

An attempt to set the subaccount characteristic to a string longer than 30 characters will cause an ArgumentOutOfRangeException to be thrown.

Methods

Clear()

Clear all properties.

public void Clear()

Remarks

This will reset all properties to null values, including the currency and the country code.

Clone()

Returns a copy of this FinAcct instance.

public FinAcct Clone()

Returns

FinAcct

Remarks

The FromUPD property of the returned clone will always be false.

ReadXml(XmlReader)

Reads an FinTS 4.0 account specification XML.

public override void ReadXml(XmlReader aXmlReader)

Parameters

aXmlReader XmlReader

Remarks

This method does not expect a root element. It only reads the sequence of elements from <AcctNo> through <BankID>. Only elements that are found will replace the current value of the corresponding fields. Other fields remain untouched.

Exceptions

ArgumentNullException

The parameter aXmlReader was null.

WriteXml(XmlWriter)

Writes the account data as a FinTS 4.0 XML formatted account specification.

public override void WriteXml(XmlWriter aXmlWriter)

Parameters

aXmlWriter XmlWriter

Remarks

This method does not write a root element. It only writes the elements <IBAN> through <BankID>. Any null fields will be omitted from the output. Empty strings are written as empty XML elements. The properties Currency and HolderName are not persisted.

Exceptions

ArgumentNullException

The parameter aXmlWriter was null.