Class ScraperJson

Namespace
Subsembly.Scraper
Assembly
Subsembly.Scraper.dll

Utility methods for converting between SEPA classes and their SUPA/JSON representation.

public static class ScraperJson
Inheritance
ScraperJson
Inherited Members

Remarks

The field names of the JSON objects are based on the XML tag names defined in the Subsembly SUPA specification based on ISO 20022. Hence, it should be straightforward to understand and apply.

Methods

ConvertAccount(JsonObject)

Creates a new, fully initialized SepaAccount instance from the given JSON account data.

public static SepaAccount ConvertAccount(JsonObject jsAccount)

Parameters

jsAccount JsonObject

Returns

SepaAccount

Remarks

This will throw an exception if the given jsAccount contains syntactically invalid values e.g. for IBAN, BIC or Currency. The method does not validate the completeness of the account information.

ConvertAccount(SepaAccount)

public static JsonObject ConvertAccount(SepaAccount aAccount)

Parameters

aAccount SepaAccount

Returns

JsonObject

ConvertBalance(JsonObject)

public static SepaBalance ConvertBalance(JsonObject jsBalance)

Parameters

jsBalance JsonObject

Returns

SepaBalance

ConvertBalance(SepaBalance)

public static JsonObject ConvertBalance(SepaBalance aBalance)

Parameters

aBalance SepaBalance

Returns

JsonObject

ConvertResult(JsonObject)

public static ScraperResult ConvertResult(JsonObject jsRes)

Parameters

jsRes JsonObject

Returns

ScraperResult

Exceptions

ArgumentNullException

The parameter was null.

See Also

ConvertResult(ScraperResult)

Converts a ScraperResult into JSON representation.

public static JsonObject ConvertResult(ScraperResult aRes)

Parameters

aRes ScraperResult

The result to be converted. Must not be null.

Returns

JsonObject

Returns a JSON object with the data elements Code, Text (optional), and Trace (optional). The Code contains the numeric value of the Code property. The Text contains the value from the DisplayText property. The Trace contains the UTF8 and Base64 encoded value from the DiagnosticTrace.

Exceptions

ArgumentNullException

The parameter was null.

See Also

ConvertStatement(SepaDocument)

Converts a CAMT document into JSON representation.

public static JsonObject ConvertStatement(SepaDocument aDoc)

Parameters

aDoc SepaDocument

Returns

JsonObject

Exceptions

ArgumentNullException

The parameter was null.

ArgumentException

The given document was not CAMT document.

NotSupportedException

The CAMT document did not contain a single statement only.

ConvertStatement(SepaStatement)

Converts a SepaStatement instance into JSON representation.

public static JsonObject ConvertStatement(SepaStatement aStmt)

Parameters

aStmt SepaStatement

Returns

JsonObject

ConvertStatementEntry(SepaStatementEntry)

Creates a JSON object for the given SepaStatementEntry.

public static JsonObject ConvertStatementEntry(SepaStatementEntry aEntry)

Parameters

aEntry SepaStatementEntry

Returns

JsonObject

Remarks

A single SepaStatementEntry without any SepaTransactionDetails.

ConvertStatementEntry(SepaStatementEntry, SepaTransactionDetails)

Creates a JSON object for the given CAMT transaction details.

public static JsonObject ConvertStatementEntry(SepaStatementEntry aEntry, SepaTransactionDetails aTxn)

Parameters

aEntry SepaStatementEntry
aTxn SepaTransactionDetails

Returns

JsonObject

Remarks

A single SepaStatementEntry may contain multiple SepaTransactionDetails or none at all. In order to convert the complete statement entry, this method must be invoked for every SepaTransactionDetails instance.