aboutsummaryrefslogtreecommitdiff
path: root/nexus
diff options
context:
space:
mode:
authorMS <ms@taler.net>2021-02-05 17:05:37 +0100
committerMS <ms@taler.net>2021-02-05 17:05:37 +0100
commit2274e4019f2715213037f508bbcf0c84e2582ab9 (patch)
tree86e59544c0e3222358f5272bb4b38be5109c38a3 /nexus
parentc61255f3ef464a251619f0d4df2850e7c80f7adb (diff)
downloadlibeufin-2274e4019f2715213037f508bbcf0c84e2582ab9.tar.gz
libeufin-2274e4019f2715213037f508bbcf0c84e2582ab9.tar.bz2
libeufin-2274e4019f2715213037f508bbcf0c84e2582ab9.zip
syntax / debug
Diffstat (limited to 'nexus')
-rw-r--r--nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt2
-rw-r--r--nexus/src/main/kotlin/tech/libeufin/nexus/iso20022/Iso20022.kt11
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
index ec504248..e5e13e4d 100644
--- 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
index 182738c9..70bd620b 100644
--- 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,