commit 2274e4019f2715213037f508bbcf0c84e2582ab9
parent c61255f3ef464a251619f0d4df2850e7c80f7adb
Author: MS <ms@taler.net>
Date: Fri, 5 Feb 2021 17:05:37 +0100
syntax / debug
Diffstat:
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt
@@ -325,7 +325,7 @@ private suspend fun talerAddIncoming(call: ApplicationCall, httpClient: HttpClie
"currency": "${parsedAmount.currency}",
"direction": "CRDT",
"subject": "${addIncomingData.reserve_pub}",
- "uid": ${getRandomString(8)}
+ "uid": "${getRandomString(8)}"
}""".trimIndent()
contentType(ContentType.Application.Json)
}
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/iso20022/Iso20022.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/iso20022/Iso20022.kt
@@ -657,12 +657,15 @@ private fun XmlElementDestructor.extractMaybeCurrencyExchange(): CurrencyExchang
private fun XmlElementDestructor.extractBatches(
inheritableAmount: CurrencyAmount,
- outerCreditDebitIndicator: CreditDebitIndicator
+ outerCreditDebitIndicator: CreditDebitIndicator,
+ acctSvcrRef: String
): List<Batch> {
- if (mapEachChildNamed("NtryDtls") {}.size != 1) throw CamtParsingError("This money movement is not a singleton #0")
+ if (mapEachChildNamed("NtryDtls") {}.size != 1) throw CamtParsingError(
+ "This money movement (AcctSvcrRef: $acctSvcrRef) is not a singleton #0"
+ )
var txs = requireUniqueChildNamed("NtryDtls") {
if (mapEachChildNamed("TxDtls") {}.size != 1) {
- throw CamtParsingError("This money movement is not a singleton #1")
+ throw CamtParsingError("This money movement (AcctSvcrRef: $acctSvcrRef) is not a singleton #1")
}
requireUniqueChildNamed("TxDtls") {
val details = extractTransactionDetails(outerCreditDebitIndicator)
@@ -854,7 +857,7 @@ private fun XmlElementDestructor.extractInnerTransactions(): CamtReport {
instructedAmount = instructedAmount,
creditDebitIndicator = creditDebitIndicator,
bankTransactionCode = btc,
- batches = extractBatches(amount, creditDebitIndicator),
+ batches = extractBatches(amount, creditDebitIndicator, acctSvcrRef ?: "AcctSvcrRef not given/found"),
bookingDate = maybeUniqueChildNamed("BookgDt") { extractDateOrDateTime() },
valueDate = maybeUniqueChildNamed("ValDt") { extractDateOrDateTime() },
accountServicerRef = acctSvcrRef,