Class SwiftMX

Namespace
Subsembly.Swift
Assembly
Subsembly.Sepa.dll

Utility methods that convert old SWIFT MT-940 and SWIFT MT-942 messages to ISO 20022 CAMT statements and vice versa.

public static class SwiftMX
Inheritance
SwiftMX
Inherited Members

Methods

Convert(SepaDocument, List<SwiftStatement>)

Convert CAMT.053 Sepa document to one or more SWIFT MT-940 statements

public static bool Convert(SepaDocument aSepaDocument, List<SwiftStatement> vSwiftStatements)

Parameters

aSepaDocument SepaDocument
vSwiftStatements List<SwiftStatement>

Returns

bool

Convert(SepaStatement)

Convert CAMT.053 or CAMT.052 statement to SWIFT MT-940 or MT-942 statement.

public static Swift9xxBase Convert(SepaStatement aSepaStatement)

Parameters

aSepaStatement SepaStatement

Returns

Swift9xxBase

Convert(SepaStatement, int)

Convert CAMT.053 or CAMT.052 statement to SWIFT MT-940 or MT-942 statement.

public static Swift9xxBase Convert(SepaStatement aSepaStatement, int nMT)

Parameters

aSepaStatement SepaStatement

The CAMT statement to be converted to a SWIFT statement. If this is null, then null will be returned.

nMT int

Selects the target SWIFT MT format that shall be created. If this is zero, then the target SWIFT MT format is derived from the aSepaStatement. Alternatively, the values 940 or 942 may be used to select a particular target SWIFT MT format.

Returns

Swift9xxBase

Either an instance of SwiftStatement or SwiftInterimTransRept, depending on the TagName of the SepaStatement that was provided. The tag name "Stmt" will produce a SwiftStatement, the tag name "Rpt" will produce a SwiftInterimTransRept.

Exceptions

ArgumentException

The TagName of the SepaStatement was neither "Stmt", nor "Rpt".

SwiftException

A SwiftException with Code CannotConvert may be thrown if the given CANT statement could not be converted for various reasons.

  • The ElectronicSequenceNumber is too big to be represented in a valid SWIFT statement.
  • The statement is of type "Stmt" and does not contain an opening or closing balance.

Convert(SwiftInterimTransRept)

Converts a single SWIFT MT-942 transaction report to a CAMT statement.

public static SepaStatement Convert(SwiftInterimTransRept aSwiftStatement)

Parameters

aSwiftStatement SwiftInterimTransRept

Returns

SepaStatement

Convert(SwiftStatement)

Converts a single SWIFT MT-940 statement to a CAMT statement.

public static SepaStatement Convert(SwiftStatement aSwiftStatement)

Parameters

aSwiftStatement SwiftStatement

The SwiftStatement to be converted, or null.

Returns

SepaStatement

A new SepaStatement with TagName "Stmt" produced from the given SwiftStatement. If the parameter aSwiftStatement was null, then this method does return null.

Remarks

If the SWIFT statement does not contain a ClosingBalance then a SwiftException is thrown.

The account currency is determined from the ClosingBalance. If the closing balance does not contain a currency, or the OpeningBalance contains a different currency, then a SwiftException is thrown.

Exceptions

SwiftException

A SwiftException with Code CannotConvert is thrown, when the given statement cannot be converted.