commit 4bead8c64fd7e0b45f61de8a4e213526add165b5
parent ac9f2f33489d4a40e1984d28e7eccc6e6c6bd9d1
Author: MS <ms@taler.net>
Date: Wed, 22 Nov 2023 07:05:15 +0100
nexus fetch: adapting the parser to camt.054 2019
Diffstat:
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Iso20022.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/Iso20022.kt
@@ -261,9 +261,11 @@ fun parseIncomingTxNotif(
}
// warn: it might need the postal address too..
requireUniqueChildNamed("Dbtr") {
- requireUniqueChildNamed("Nm") {
- val urlEncName = URLEncoder.encode(focusElement.textContent, "utf-8")
- debtorPayto.append("?receiver-name=$urlEncName")
+ requireUniqueChildNamed("Pty") {
+ requireUniqueChildNamed("Nm") {
+ val urlEncName = URLEncoder.encode(focusElement.textContent, "utf-8")
+ debtorPayto.append("?receiver-name=$urlEncName")
+ }
}
}
}
@@ -298,10 +300,12 @@ private fun notificationForEachTx(
mapEachChildNamed("Ntfctn") {
mapEachChildNamed("Ntry") {
requireUniqueChildNamed("Sts") {
- if (focusElement.textContent != "BOOK")
- throw Exception("Found non booked transaction, " +
- "stop parsing. Status was: ${focusElement.textContent}"
- )
+ requireUniqueChildNamed("Cd") {
+ if (focusElement.textContent != "BOOK")
+ throw Exception("Found non booked transaction, " +
+ "stop parsing. Status was: ${focusElement.textContent}"
+ )
+ }
}
val bookDate: Instant = requireUniqueChildNamed("BookgDt") {
requireUniqueChildNamed("Dt") {