libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit d7270181fd148d43ecc34f1e8f1613af696d5f3c
parent 55e2588ca801da74d80f2b44c47c2602d7a8e2c2
Author: MS <ms@taler.net>
Date:   Sat, 18 Nov 2023 09:46:23 +0100

nexus fetch: check for BOOK status.

Diffstat:
Mnexus/src/main/kotlin/tech/libeufin/nexus/EbicsFetch.kt | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/EbicsFetch.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/EbicsFetch.kt @@ -345,6 +345,12 @@ fun notificationForEachTx( requireUniqueChildNamed("BkToCstmrDbtCdtNtfctn") { mapEachChildNamed("Ntfctn") { mapEachChildNamed("Ntry") { + requireUniqueChildNamed("Sts") { + if (focusElement.textContent != "BOOK") + throw Exception("Found non booked transaction, " + + "stop parsing. Status was: ${focusElement.textContent}" + ) + } val bookDate: Instant = requireUniqueChildNamed("BookgDt") { requireUniqueChildNamed("Dt") { parseBookDate(focusElement.textContent)