[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] 02/02: nexus fetch
From: |
gnunet |
Subject: |
[libeufin] 02/02: nexus fetch |
Date: |
Sat, 18 Nov 2023 08:20:19 +0100 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository libeufin.
commit d8f7744a95865ed0c8ad5b1cc98015336f27ba74
Author: MS <ms@taler.net>
AuthorDate: Sat Nov 18 08:09:53 2023 +0100
nexus fetch
Adjusting parsing and reconciliation of outgoing payments.
The change suits "Lastschriftavisierung" (camt.054) case. Notably,
parsing does not look for payee IBAN & name and payment subject,
and reconciliation admits that a booked outgoing payment may
not have an initiated payment counterpart in the database. That
would be the case of an auditor running Nexus: no reason for them
to initiate / reconciliate payments.
---
.../main/kotlin/tech/libeufin/nexus/EbicsFetch.kt | 45 +++++-----------------
1 file changed, 10 insertions(+), 35 deletions(-)
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/EbicsFetch.kt
b/nexus/src/main/kotlin/tech/libeufin/nexus/EbicsFetch.kt
index 5b10369f..9e537104 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/EbicsFetch.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/EbicsFetch.kt
@@ -250,40 +250,10 @@ private fun parseOutgoingTxNotif(
}
}
- // Obtaining payment subject.
- val subject = StringBuilder()
- requireUniqueChildNamed("RmtInf") {
- this.mapEachChildNamed("Ustrd") {
- val piece = this.focusElement.textContent
- subject.append(piece)
- }
- }
-
- // Obtaining the payer's details
- val creditorPayto = StringBuilder("payto://iban/")
- requireUniqueChildNamed("RltdPties") {
- requireUniqueChildNamed("CdtrAcct") {
- requireUniqueChildNamed("Id") {
- requireUniqueChildNamed("IBAN") {
- creditorPayto.append(focusElement.textContent)
- }
- }
- }
- requireUniqueChildNamed("Cdtr") {
- requireUniqueChildNamed("Pty") {
- requireUniqueChildNamed("Nm") {
- val urlEncName =
URLEncoder.encode(focusElement.textContent, "utf-8")
- creditorPayto.append("?receiver-name=$urlEncName")
- }
- }
- }
- }
ret.add(OutgoingPayment(
amount = amount,
bankTransferId = uidFromBank.toString(),
- creditPaytoUri = creditorPayto.toString(),
- executionTime = bookDate,
- wireTransferSubject = subject.toString()
+ executionTime = bookDate
))
}
return ret
@@ -475,12 +445,17 @@ private suspend fun ingestOutgoingPayment(
logger.debug("Outgoing payment with UID '${payment.bankTransferId}'
already seen.")
return
}
- // Get the initiate payment to link to this.
- val initId: Long = db.initiatedPaymentGetFromUid(payment.bankTransferId)
- ?: throw Exception("Outgoing payment lacks (submitted) initiated " +
+ /**
+ * Getting the initiate payment to link to this. A missing initiated
+ * payment could mean that a third party is downloading the bank account
+ * history (to conduct an audit, for example)
+ */
+ val initId: Long? = db.initiatedPaymentGetFromUid(payment.bankTransferId);
+ if (initId == null)
+ logger.info("Outgoing payment lacks (submitted) initiated " +
"counterpart with UID ${payment.bankTransferId}"
)
- // store the payment and its linked init
+ // store the payment and its (maybe null) linked init
val insertionResult = db.outgoingPaymentCreate(payment, initId)
if (insertionResult != OutgoingPaymentOutcome.SUCCESS) {
throw Exception("Could not store outgoing payment with UID " +
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.