Class ScraperJson
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
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
ConvertBalance(JsonObject)
public static SepaBalance ConvertBalance(JsonObject jsBalance)
Parameters
jsBalance
JsonObject
Returns
ConvertBalance(SepaBalance)
public static JsonObject ConvertBalance(SepaBalance aBalance)
Parameters
aBalance
SepaBalance
Returns
ConvertResult(JsonObject)
public static ScraperResult ConvertResult(JsonObject jsRes)
Parameters
jsRes
JsonObject
Returns
Exceptions
- ArgumentNullException
The parameter was
null
.
- See Also
ConvertResult(ScraperResult)
Converts a ScraperResult into JSON representation.
public static JsonObject ConvertResult(ScraperResult aRes)
Parameters
aRes
ScraperResultThe result to be converted. Must not be
null
.
Returns
- JsonObject
Returns a JSON object with the data elements
Code
,Text
(optional), andTrace
(optional). TheCode
contains the numeric value of the Code property. TheText
contains the value from the DisplayText property. TheTrace
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
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
ConvertStatementEntry(SepaStatementEntry)
Creates a JSON object for the given SepaStatementEntry.
public static JsonObject ConvertStatementEntry(SepaStatementEntry aEntry)
Parameters
aEntry
SepaStatementEntry
Returns
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
SepaStatementEntryaTxn
SepaTransactionDetails
Returns
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.