gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libeufin] 02/02: Comments. Rewording logging.


From: gnunet
Subject: [libeufin] 02/02: Comments. Rewording logging.
Date: Fri, 20 Jan 2023 21:07:38 +0100

This is an automated email from the git hooks/post-receive script.

ms pushed a commit to branch master
in repository libeufin.

commit 1bce72ce659f7ec739fdb88806a2fcc5aa21c875
Author: MS <ms@taler.net>
AuthorDate: Fri Jan 20 21:07:16 2023 +0100

    Comments.  Rewording logging.
---
 .../main/kotlin/tech/libeufin/nexus/FacadeUtil.kt  |  7 +++++--
 nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt | 24 +++++++++++++++-------
 2 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/FacadeUtil.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/FacadeUtil.kt
index 2c2a3ea1..0227489c 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/FacadeUtil.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/FacadeUtil.kt
@@ -81,10 +81,13 @@ fun ingestFacadeTransactions(
         }
         try {
             if (refundCb != null) {
-                refundCb(bankAccount, facadeState.highestSeenMessageSerialId)
+                refundCb(
+                    bankAccount,
+                    facadeState.highestSeenMessageSerialId
+                )
             }
         } catch (e: Exception) {
-            logger.warn("sending refund payment failed", e);
+            logger.warn("sending refund payment failed", e)
         }
         facadeState.highestSeenMessageSerialId = lastId
     }
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt
index f14d5552..1777522c 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt
@@ -288,7 +288,6 @@ fun talerFilter(payment: NexusBankTransactionEntity, 
txDtls: TransactionDetails)
     }
 
     if (!CryptoUtil.checkValidEddsaPublicKey(reservePub)) {
-        // FIXME: send back!
         logger.info("invalid public key detected")
         isInvalid = true
     }
@@ -316,23 +315,34 @@ fun maybeTalerRefunds(bankAccount: 
NexusBankAccountEntity, lastSeenId: Long) {
                 " after last seen transaction id: $lastSeenId"
     )
     transaction {
-        TalerInvalidIncomingPaymentsTable.innerJoin(NexusBankTransactionsTable,
-            { NexusBankTransactionsTable.id }, { 
TalerInvalidIncomingPaymentsTable.payment }).select {
+        TalerInvalidIncomingPaymentsTable.innerJoin(
+            NexusBankTransactionsTable,
+            { NexusBankTransactionsTable.id },
+            { TalerInvalidIncomingPaymentsTable.payment }
+        ).select {
+            /**
+             * Finds Taler-invalid incoming payments that weren't refunded
+             * yet and are newer than those processed along the last round.
+             */
             TalerInvalidIncomingPaymentsTable.refunded eq false and
                     (NexusBankTransactionsTable.bankAccount eq 
bankAccount.id.value) and
                     (NexusBankTransactionsTable.id greater lastSeenId)
-
         }.forEach {
+            // For each of them, extracts the wire details to reuse in the 
refund.
             val paymentData = jacksonObjectMapper().readValue(
                 it[NexusBankTransactionsTable.transactionJson],
                 CamtBankAccountEntry::class.java
             )
             if (paymentData.batches == null) {
                 logger.error(
-                    "A singleton batched payment was expected to be refunded," 
+
-                            " but none was found (in transaction 
(AcctSvcrRef): ${paymentData.accountServicerRef})"
+                    "Empty wire details encountered in transaction with" +
+                            " AcctSvcrRef: ${paymentData.accountServicerRef}." 
+
+                            " Taler can't refund."
+                )
+                throw NexusError(
+                    HttpStatusCode.InternalServerError,
+                    "Unexpected void payment, cannot refund"
                 )
-                throw NexusError(HttpStatusCode.InternalServerError, 
"Unexpected void payment, cannot refund")
             }
             val debtorAccount = 
paymentData.batches[0].batchTransactions[0].details.debtorAccount
             if (debtorAccount?.iban == null) {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]