Class SupaConverter
Methods for conversion between SEPA objects and SUPA records.
public static class SupaConverter- Inheritance
- 
      
      SupaConverter
- 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
ConvertToSupa(SepaAccount, SepaBalance, SepaBalance, ISupaRecord)
Fills ISupaRecord with account and balance information according to
the SUPA specification for an object of type AcctBal.
public static void ConvertToSupa(SepaAccount aAccount, SepaBalance aBookedBalance, SepaBalance aExpectedBalance, ISupaRecord aSupaRecord)Parameters
- aAccountSepaAccount
- Provides the account information for the - Acctfields. Must be fully valid and not be- null.
- aBookedBalanceSepaBalance
- Provides the booked balance information for the fields - BalAmt,- BalCdtDbtInd, and- BalDt. May also include credit line information which will be set as- CdtLineAmt. Must be fully valid and not be- null.
- aExpectedBalanceSepaBalance
- Provides optional current balance information for the fields - CurBalAmt,- CurBalCdtDbtInd, and- CurBalDt. May also include credit line information which will be set as- CdtLineAmt. May be- nullif no current balance is provided. Must be fully valid, if provided.
- aSupaRecordISupaRecord
- The ISupaRecord where the fields shall be set. Must not be - null.
Remarks
If both balances include a CreditLineAmount, then both must have the same value, otherwise an exception will be thrown.
ConvertToSupa(SepaAccount, ISupaRecord)
public static void ConvertToSupa(SepaAccount aAccount, ISupaRecord aSupaRecord)Parameters
- aAccountSepaAccount
- The SepaAccount to convert from. Must not be - null.
- aSupaRecordISupaRecord
- The target record that shall receive the SUPA data fields for the given account. Must not be - null.
Exceptions
ConvertToSupa(SepaBalance, ISupaRecord)
Fills ISupaRecord with balance information according to
the SUPA specification for an object of type Bal.
public static void ConvertToSupa(SepaBalance aBalance, ISupaRecord aSupaRecord)Parameters
- aBalanceSepaBalance
- The SepaBalance to be converted to SUPA fields. This must be a fully valid balance object and must not be - null.
- aSupaRecordISupaRecord
- The ISupaRecord where the balance fields shall be set. Must not be - null.
Remarks
This will set the SUPA balance fields BalTpCd, BalAmt,
BalCdtDbtInd, and BalDt from the given aBalance.
The SepaBalanceType will be copied to the BalTpCd field
without any validation.
The Currency from the balance will be set to the SUPA
field AcctCcy.
If the given balance includes a non-empty CreditLineAmount,
then the SUPA field CdtLineAmt is set with that amount.
ConvertToSupa(SepaStatementEntry, SepaTransactionDetails, ISupaRecord)
public static void ConvertToSupa(SepaStatementEntry aEntry, SepaTransactionDetails aTxn, ISupaRecord aSupaRecord)Parameters
- aEntrySepaStatementEntry
- aTxnSepaTransactionDetails
- optional 
- aSupaRecordISupaRecord
ProduceAccount(JsonObject)
public static SepaAccount ProduceAccount(JsonObject jsAcct)Parameters
- jsAcctJsonObject
Returns
ProduceAccount(ISupaRecord)
public static SepaAccount ProduceAccount(ISupaRecord aSupaRecord)Parameters
- aSupaRecordISupaRecord
Returns
ProduceAccountBalance(JsonObject, out SepaAccount, out SepaBalance, out SepaBalance)
Produce a SepaAccount and SepaBalance objects from a single
SUPA AcctBal JSON object.
public static void ProduceAccountBalance(JsonObject jsAcctBal, out SepaAccount aAccount, out SepaBalance aBookedBalance, out SepaBalance aExpectedBalance)Parameters
- jsAcctBalJsonObject
- The SUPA JSON - AcctBalobject to convert. This must not be- null.
- aAccountSepaAccount
- aBookedBalanceSepaBalance
- aExpectedBalanceSepaBalance
- See Also
ProduceAccountBalance(ISupaRecord, out SepaAccount, out SepaBalance, out SepaBalance)
Produce a SepaAccount and SepaBalance objects from a single
SUPA AcctBal record.
public static void ProduceAccountBalance(ISupaRecord aSupaRecord, out SepaAccount aAccount, out SepaBalance aBookedBalance, out SepaBalance aExpectedBalance)Parameters
- aSupaRecordISupaRecord
- aAccountSepaAccount
- Will receive the result from ProduceAccount(ISupaRecord). 
- aBookedBalanceSepaBalance
- The booked balance will be created from the SUPA fields - BalAmt,- BalCdtDbtInd,- BalDt,- AcctCcy, and optional- CdtLineAmt. The balance type will always be set to ClosingBooked.
- aExpectedBalanceSepaBalance
- If the SUPA record contains a field - CurBalAmt, then this balance will be created from the fields- CurBalAmt,- CurBalCdtDbtInd,- CurBalDt, and- AcctCcy. The balance type will always be set to Expected. The CreditLineAmount will not be set. If no- CurBalAmtis present, then this will be set to- null.
ProduceBalance(JsonObject)
Produce a SepaBalance from SUPA JSON object.
public static SepaBalance ProduceBalance(JsonObject jsBal)Parameters
- jsBalJsonObject
- The SUPA JSON balance object to convert. This must not be - null.
Returns
- See Also
ProduceBalance(ISupaRecord)
Produce a SepaBalance from SUPA data.
public static SepaBalance ProduceBalance(ISupaRecord aSupaRecord)Parameters
- aSupaRecordISupaRecord
Returns
Remarks
This will create a SepaBalance from the SUPA fields BalTpCd,
BalAmt, BalCdtDbtInd, BalDt, AcctCcy, and optional
CdtLineAmt.
ProduceBatchEntry(ISupaRecord, IList<ISupaRecord>)
Produces a SepaStatementEntry containing multiple SepaTransactionDetails from the given list of SUPA statement entries.
public static SepaStatementEntry ProduceBatchEntry(ISupaRecord aSupaEntryRecord, IList<ISupaRecord> vSupaTransactionRecords)Parameters
- aSupaEntryRecordISupaRecord
- vSupaTransactionRecordsIList<ISupaRecord>
Returns
ProduceEntry(JsonObject)
public static SepaStatementEntry ProduceEntry(JsonObject jsEntry)Parameters
- jsEntryJsonObject
Returns
ProduceEntry(ISupaRecord)
Produces a SepaStatementEntry containing a single SepaTransactionDetails from the given SUPA statement entry.
public static SepaStatementEntry ProduceEntry(ISupaRecord aSupaRecord)Parameters
- aSupaRecordISupaRecord
Returns
ProduceJson(SepaAccount)
public static JsonObject ProduceJson(SepaAccount aAccount)Parameters
- aAccountSepaAccount
Returns
ProduceJson(SepaAccount, SepaBalance, SepaBalance)
Creates a SUPA JSON object with account and balance information according to
the SUPA specification for an object of type AcctBal.
public static JsonObject ProduceJson(SepaAccount aAccount, SepaBalance aBookedBalance, SepaBalance aExpectedBalance)Parameters
- aAccountSepaAccount
- Provides the account information for the - Acctfields. Must be fully valid and not be- null.
- aBookedBalanceSepaBalance
- Provides the booked balance information for the fields - BalAmt,- BalCdtDbtInd, and- BalDt. May also include credit line information which will be set as- CdtLineAmt. Must be fully valid and not be- null.
- aExpectedBalanceSepaBalance
- Provides optional current balance information for the fields - CurBalAmt,- CurBalCdtDbtInd, and- CurBalDt. May also include credit line information which will be set as- CdtLineAmt. May be- nullif no current balance is provided. Must be fully valid, if provided.
Returns
- See Also
ProduceJson(SepaBalance)
Creates a SUPA JSON object with balance information according to
the SUPA specification for an object of type Bal.
public static JsonObject ProduceJson(SepaBalance aBalance)Parameters
- aBalanceSepaBalance
- The SepaBalance to be converted to SUPA. This must be a fully valid balance object and must not be - null.
Returns
- See Also
ProduceJson(SepaDocument)
Converts a CAMT document into JSON representation.
public static JsonObject ProduceJson(SepaDocument aDoc)Parameters
- aDocSepaDocument
Returns
Exceptions
- ArgumentNullException
- The parameter was - null.
- ArgumentException
- The given document was not CAMT document. 
- NotSupportedException
- The CAMT document contains no stmt at all. 
ProduceJson(SepaStatement)
Converts a SepaStatement instance into JSON representation.
public static JsonObject ProduceJson(SepaStatement aStmt)Parameters
- aStmtSepaStatement
Returns
ProduceJson(SepaStatementEntry)
public static JsonObject ProduceJson(SepaStatementEntry aEntry)Parameters
- aEntrySepaStatementEntry
Returns
ProduceJson(SepaStatementEntry, SepaTransactionDetails)
public static JsonObject ProduceJson(SepaStatementEntry aEntry, SepaTransactionDetails aTxn)Parameters
- aEntrySepaStatementEntry
- aTxnSepaTransactionDetails
- optional 
Returns
ProduceJson(IEnumerable<SepaStatementEntry>)
public static JsonArray ProduceJson(IEnumerable<SepaStatementEntry> vEntries)Parameters
- vEntriesIEnumerable<SepaStatementEntry>
Returns
ProducePaymentInitiation(JsonObject)
public static SepaPaymentInitiation ProducePaymentInitiation(JsonObject jsRemitt)Parameters
- jsRemittJsonObject
Returns
ProducePaymentInitiation(ISupaRecord)
public static SepaPaymentInitiation ProducePaymentInitiation(ISupaRecord aSupaRecord)Parameters
- aSupaRecordISupaRecord
Returns
ProduceTransactionInformation(SepaPaymentInformation, JsonObject, bool)
public static SepaTransactionInformation ProduceTransactionInformation(SepaPaymentInformation aPmtInf, JsonObject jsRemitt, bool fSetPmtTpInf)Parameters
- aPmtInfSepaPaymentInformation
- jsRemittJsonObject
- fSetPmtTpInfbool
Returns
ProduceTransactionInformation(SepaPaymentInformation, ISupaRecord, bool)
public static SepaTransactionInformation ProduceTransactionInformation(SepaPaymentInformation aPmtInf, ISupaRecord aSupaRecord, bool fSetPmtTpInf)Parameters
- aPmtInfSepaPaymentInformation
- aSupaRecordISupaRecord
- fSetPmtTpInfbool
- If - true, then the Payment Type Information element will be initialized in the returned SepaTransactionInformation. Otherwise the element is forced to be excluded.