gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] 01/02: nexus fetch: fix helper invocation


From: gnunet
Subject: [libeufin] 01/02: nexus fetch: fix helper invocation
Date: Wed, 22 Nov 2023 08:09:56 +0100

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

ms pushed a commit to branch master
in repository libeufin.

commit 7a0acd6112a00c25b809ad5a23b3724dc753fbcf
Author: MS <ms@taler.net>
AuthorDate: Wed Nov 22 07:31:56 2023 +0100

    nexus fetch: fix helper invocation
---
 .../src/main/kotlin/tech/libeufin/nexus/EbicsFetch.kt | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/EbicsFetch.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/EbicsFetch.kt
index 768dde2f..509a5493 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/EbicsFetch.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/EbicsFetch.kt
@@ -202,8 +202,10 @@ fun getTalerAmount(
     if (currency.isEmpty()) throw Exception("Wrong helper invocation: currency 
is empty")
     val split = noCurrencyAmount.split(".")
     // only 1 (no fraction) or 2 (with fraction) sizes allowed.
-    if (split.size != 1 && split.size != 2) throw 
Exception("${errorMessagePrefix}invalid amount: $noCurrencyAmount")
-    val value = split[0].toLongOrNull() ?: throw 
Exception("${errorMessagePrefix}value part not a long")
+    if (split.size != 1 && split.size != 2)
+        throw Exception("${errorMessagePrefix}invalid amount: 
$noCurrencyAmount")
+    val value = split[0].toLongOrNull()
+        ?: throw Exception("${errorMessagePrefix}value part '${split[0]}' not 
a long")
     if (split.size == 1) return TalerAmount(
         value = value,
         fraction = 0,
@@ -342,6 +344,10 @@ private suspend fun ingestIncomingPayment(
             incomingPayment.amount,
             ctx.minimumAmount
         )) {
+        logger.debug("Incoming payment with UID 
'${incomingPayment.bankTransferId}'" +
+                " is too low: ${incomingPayment.amount}."
+        )
+
         /**
          * Setting the refund amount to zero makes the initiated
          * payment _never_ paid back.  Inserting this row merely
@@ -357,6 +363,9 @@ private suspend fun ingestIncomingPayment(
     }
     val reservePub = getTalerReservePub(db, incomingPayment)
     if (reservePub == null) {
+        logger.debug("Incoming payment with UID 
'${incomingPayment.bankTransferId}'" +
+                " has invalid subject: ${incomingPayment.wireTransferSubject}."
+        )
         db.incomingPaymentCreateBounced(
             incomingPayment,
             UUID.randomUUID().toString().take(35)
@@ -616,9 +625,9 @@ class EbicsFetch: CliktCommand("Fetches bank records.  
Defaults to camt.054 noti
         if (minAmountCfg != null) {
             minAmount = doOrFail {
                 getTalerAmount(
-                    cfg.currency,
-                    minAmountCfg,
-                    "[nexus-fetch]/minimum_amount, "
+                    noCurrencyAmount = minAmountCfg,
+                    currency = cfg.currency,
+                    "[nexus-fetch]/minimum_amount '$minAmountCfg', "
                 )
             }
         }

-- 
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]