gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: addressing #6988


From: gnunet
Subject: [libeufin] branch master updated: addressing #6988
Date: Wed, 15 Feb 2023 12:39:58 +0100

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

ms pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new 75bd4dcf addressing #6988
75bd4dcf is described below

commit 75bd4dcf3697c40ffd5ce02d34b8e60a60da67cf
Author: MS <ms@taler.net>
AuthorDate: Wed Feb 15 12:39:51 2023 +0100

    addressing #6988
---
 cli/tests/launch_services.sh                       |  5 ++-
 .../tech/libeufin/nexus/bankaccount/BankAccount.kt |  3 +-
 .../kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt | 46 ++++++++++++++++------
 3 files changed, 39 insertions(+), 15 deletions(-)

diff --git a/cli/tests/launch_services.sh b/cli/tests/launch_services.sh
index 369b9bed..fdd5a74d 100755
--- a/cli/tests/launch_services.sh
+++ b/cli/tests/launch_services.sh
@@ -27,7 +27,7 @@ echo -n Delete previous data...
 rm -f $DB_PATH
 echo DONE
 echo -n Configure the default demobank with MANA...
-libeufin-sandbox config --currency MANA default
+libeufin-sandbox config --with-signup-bonus --currency MANA default
 echo DONE
 echo -n Start the bank...
 export LIBEUFIN_SANDBOX_ADMIN_PASSWORD=foo
@@ -100,4 +100,7 @@ libeufin-cli facades \
   --currency TESTKUDOS --facade-name test-facade \
   wwwconn www-nexus
 echo OK
+echo -n "Ticking, to let statements be generated..."
+libeufin-sandbox camt053tick
+echo OK
 read -p "Press Enter to terminate..."
diff --git 
a/nexus/src/main/kotlin/tech/libeufin/nexus/bankaccount/BankAccount.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/bankaccount/BankAccount.kt
index af72ab1f..7dab22ff 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/bankaccount/BankAccount.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/bankaccount/BankAccount.kt
@@ -423,7 +423,8 @@ suspend fun fetchBankAccountTransactions(
     }
     /**
      * Collects transactions from the bank and stores the (camt)
-     * document into the database.
+     * document into the database.  This function tries to download
+     * both reports AND statements even if the first one fails.
      */
     getConnectionPlugin(res.connectionType).fetchTransactions(
         fetchSpec,
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt
index 45240e31..b02e8193 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt
@@ -427,8 +427,15 @@ class EbicsBankConnectionProtocol: BankConnectionProtocol {
                 }
             }
         }
+        /**
+         * Will be filled with fetch instructions, according
+         * to the parameters received from the client.
+         */
         val specs = mutableListOf<EbicsFetchSpec>()
-
+        /**
+         * 'level' indicates whether to fetch statements and/or reports,
+         * whereas 'p' usually carries a date range.
+         */
         fun addForLevel(l: FetchLevel, p: EbicsOrderParams) {
             when (l) {
                 FetchLevel.ALL -> {
@@ -443,7 +450,7 @@ class EbicsBankConnectionProtocol: BankConnectionProtocol {
                 }
             }
         }
-
+        // Figuring out what time range to put in the fetch instructions.
         when (fetchSpec) {
             is FetchSpecLatestJson -> {
                 val p = EbicsStandardOrderParams()
@@ -458,6 +465,11 @@ class EbicsBankConnectionProtocol: BankConnectionProtocol {
                 )
                 addForLevel(fetchSpec.level, p)
             }
+            /**
+             * This branch differentiates the last date of reports and
+             * statements and builds the fetch instructions for each of
+             * them.
+             */
             is FetchSpecSinceLastJson -> {
                 val pRep = EbicsStandardOrderParams(
                     EbicsDateRange(
@@ -476,6 +488,11 @@ class EbicsBankConnectionProtocol: BankConnectionProtocol {
                     )
                 )
                 when (fetchSpec.level) {
+                    /**
+                     * This branch doesn't call the "addForLevel()" helper 
because
+                     * that takes only ONE time range and would use it for both
+                     * statements and reports.
+                     */
                     FetchLevel.ALL -> {
                         specs.add(EbicsFetchSpec("C52", pRep))
                         specs.add(EbicsFetchSpec("C53", pStmt))
@@ -489,17 +506,20 @@ class EbicsBankConnectionProtocol: BankConnectionProtocol 
{
                 }
             }
         }
-        /**
-         * Downloads and stores the bank message into the database.  No 
ingestion.
-         */
-        for (spec in specs)
-            fetchEbicsC5x(
-                spec.orderType,
-                client,
-                bankConnectionId,
-                spec.orderParams,
-                subscriberDetails
-            )
+        // Downloads and stores the bank message into the database.  No 
ingestion.
+        for (spec in specs) {
+            try {
+                fetchEbicsC5x(
+                    spec.orderType,
+                    client,
+                    bankConnectionId,
+                    spec.orderParams,
+                    subscriberDetails
+                )
+            } catch (e: Exception) {
+                logger.warn("Fetching transactions (${spec.orderType}) 
excepted: ${e.message}.")
+            }
+        }
     }
     /**
      * Submit one Pain.001 for one payment initiations.

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