aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMS <ms@taler.net>2023-11-22 07:05:15 +0100
committerMS <ms@taler.net>2023-11-22 07:05:15 +0100
commit4bead8c64fd7e0b45f61de8a4e213526add165b5 (patch)
treeb4e22831016c8a39771eb03a6a6582bcf3162a6d
parentac9f2f33489d4a40e1984d28e7eccc6e6c6bd9d1 (diff)
downloadlibeufin-4bead8c64fd7e0b45f61de8a4e213526add165b5.tar.gz
libeufin-4bead8c64fd7e0b45f61de8a4e213526add165b5.tar.bz2
libeufin-4bead8c64fd7e0b45f61de8a4e213526add165b5.zip
nexus fetch: adapting the parser to camt.054 2019
-rw-r--r--nexus/src/main/kotlin/tech/libeufin/nexus/Iso20022.kt18
1 files 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
index 46622f6e..032e3ae0 100644
--- 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") {