Class EbicsServiceMap
Catalog of well known EBICS services. This is required for conversion between an EBICS Service element and an EBICS OrderType.
public class EbicsServiceMap
- Inheritance
-
EbicsServiceMap
- Inherited Members
Constructors
EbicsServiceMap()
Creates an empty EbicsServiceMap.
public EbicsServiceMap()
EbicsServiceMap(EbicsServiceMapRecord[])
Creates a EbicsServiceMap that initially contains the given records.
public EbicsServiceMap(EbicsServiceMapRecord[] vRecords)
Parameters
vRecords
EbicsServiceMapRecord[]
Exceptions
- ArgumentNullException
- ArgumentException
The given array of records did contain a duplicate entry for the same OrderType or, one of the records in the array was not correctly initialized.
Properties
Default
public static EbicsServiceMap Default { get; }
Property Value
Methods
AddRecord(EbicsServiceMapRecord, bool)
Add or replace a EbicsServiceMapRecord in this map.
public bool AddRecord(EbicsServiceMapRecord aRecord, bool fReplace = false)
Parameters
aRecord
EbicsServiceMapRecordfReplace
boolIf
true
, then an existing entry with the same OrderType will be replaced with the given entry. Iffalse
, then an existing entry will not be replaced and the given record will not be added in that case.
Returns
- bool
If the given record was actually added as a new entry, then
true
is returned. If the entry already exists, thenfalse
is returned, even when it was replaced.
Exceptions
CreateService(string)
public EbicsService CreateService(string sOrderType)
Parameters
sOrderType
stringThe classic order type for which a corresponding EBICS 3.0 Service shall be created. May be
null
.
Returns
- EbicsService
If the given
sOrderType
isnull
, or cannot be mapped to a Service, thennull
will be returned. Otherwise a new EbicsService instance that matches the classic order type, will be returned.
Exceptions
- ArgumentException
The parameter
sOrderType
was not a valid order type specification.
CreateServiceMap(string)
Creates a new instance of a EbicsServiceMap, initialized with the well known entries for a given country.
public static EbicsServiceMap CreateServiceMap(string sCountryCode)
Parameters
sCountryCode
stringThe ISO country code of the country to get a EbicsServiceMap for. Must not be
null
.
Returns
- EbicsServiceMap
If there is a well known EbicsServiceMap for the requested country, then it is returned. If no service map is known for that country, then
null
is returned.
Remarks
Currently there are well known service maps for Germany (DE), Switzerland (CH),
and Austria (AT). For any other country codes the value null
will be
returned.
Exceptions
- ArgumentNullException
- ArgumentException
The parameter
sCountryCode
was not a valid ISO country code.
FindByOrderType(string)
Tries to find a service mapping for a given order type.
public EbicsServiceMapRecord FindByOrderType(string sOrderType)
Parameters
sOrderType
string
Returns
- EbicsServiceMapRecord
If a mapping was found, then it is returned. If there is no mapping known for the given order type, then
null
is returned.
Exceptions
- ArgumentNullException
The parameter
sOrderType
wasnull
.- ArgumentException
The parameter
sOrderType
was not a valid order type specification.
FindByService(EbicsService)
Tries to find the EbicsServiceMapRecord for a EbicsService instance.
public EbicsServiceMapRecord FindByService(EbicsService aService)
Parameters
aService
EbicsServiceThe EbicsService element for which to find a record entry.
Returns
- EbicsServiceMapRecord
If a mapping was found, then it is returned. If there is no mapping known for the given service, then
null
is returned.
Exceptions
- ArgumentNullException
The parameter
aService
wasnull
.
GetOrderType(EbicsService)
Tries to get the order type for a BTD or BTU service.
public string GetOrderType(EbicsService aService)
Parameters
aService
EbicsServiceThe EbicsService for which to determine the order type. This may be
null
, in which casenull
will be returned.
Returns
- string
Returns the classic order type that matches the given service, or
null
, if the given service cannot be resolved to a known classic order type.
Exceptions
- ArgumentNullException
The parameter
aService
wasnull
.
GetOrderType(string, EbicsService)
Tries to get the order type for an AdminOrderType and Service.
public string GetOrderType(string sAdminOrderType, EbicsService aService)
Parameters
sAdminOrderType
stringThe AdminOrderType associated with the optional
aService
. This must not benull
. This is usually BTD or BTU, but may be any other order type.aService
EbicsServiceIf the
sAdminOrderType
is BTD or BTU, then the Service element must be provided in order to derive the classic OrderType.