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
jsAccountJsonObject
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
aAccountSepaAccount
Returns
ConvertBalance(JsonObject)
public static SepaBalance ConvertBalance(JsonObject jsBalance)
Parameters
jsBalanceJsonObject
Returns
ConvertBalance(SepaBalance)
public static JsonObject ConvertBalance(SepaBalance aBalance)
Parameters
aBalanceSepaBalance
Returns
ConvertResult(JsonObject)
public static ScraperResult ConvertResult(JsonObject jsRes)
Parameters
jsResJsonObject
Returns
Exceptions
- ArgumentNullException
The parameter was
null.
- See Also
ConvertResult(ScraperResult)
Converts a ScraperResult into JSON representation.
public static JsonObject ConvertResult(ScraperResult aRes)
Parameters
aResScraperResultThe result to be converted. Must not be
null.
Returns
- JsonObject
Returns a JSON object with the data elements
Code,Text(optional), andTrace(optional). TheCodecontains the numeric value of the Code property. TheTextcontains the value from the DisplayText property. TheTracecontains 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
aDocSepaDocument
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
aStmtSepaStatement
Returns
ConvertStatementEntry(SepaStatementEntry)
Creates a JSON object for the given SepaStatementEntry.
public static JsonObject ConvertStatementEntry(SepaStatementEntry aEntry)
Parameters
aEntrySepaStatementEntry
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
aEntrySepaStatementEntryaTxnSepaTransactionDetails
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.