gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated (8723a71 -> 44ce3b0)


From: gnunet
Subject: [libeufin] branch master updated (8723a71 -> 44ce3b0)
Date: Tue, 31 Mar 2020 18:41:46 +0200

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

marcello pushed a change to branch master
in repository libeufin.

    from 8723a71  Implement refunds, plus helpers.
     new 00f798e  Avoid processing invalid payments twice
     new 44ce3b0  Give CLI Taler-refund command.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 cli/python/libeufin-cli                           | 30 ++++++++++++++++++++++-
 nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt   |  1 +
 nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt |  5 ++--
 3 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/cli/python/libeufin-cli b/cli/python/libeufin-cli
index b891715..a753791 100755
--- a/cli/python/libeufin-cli
+++ b/cli/python/libeufin-cli
@@ -427,7 +427,35 @@ def crz(obj, account_id, date_range, nexus_base_url):
     resp = post(url, json=req)
     print(resp.content.decode("utf-8"))
 
-@taler.command(help="Separate payments with Taler-subject from the rest")
+@taler.command(help="Trigger refunds for invalid incoming transactions")
+@click.pass_obj
+@click.option(
+    "--account-id",
+    help="Numerical ID of the customer at the Nexus",
+    required=True
+)
+@click.option(
+    "--bank-account-id",
+    help="Token that identifies one bank account belonging to --account-id",
+    required=True
+)
+@click.argument(
+  "nexus-base-url"
+)
+def refund(ctx, account_id, bank_account_id, nexus_base_url):
+    nexus_url = urljoin(
+        nexus_base_url, 
"/ebics/taler/{}/accounts/{}/refund-invalid-payments".format(
+            account_id, bank_account_id
+        )
+    )
+    try:
+        resp = post(nexus_url, json=body)
+    except Exception:
+        print("Could not reach the Nexus")
+        return
+    print(resp.content.decode("utf-8"))
+
+@taler.command(help="Flag Taler-invalid incoming payments.")
 @click.pass_obj
 @click.option(
     "--account-id",
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt
index 361cf6a..7db1461 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt
@@ -23,6 +23,7 @@ class TalerIncomingPaymentEntry(id: EntityID<Long>) : 
LongEntity(id) {
     companion object : 
LongEntityClass<TalerIncomingPaymentEntry>(TalerIncomingPayments)
     var payment by EbicsRawBankTransactionEntry referencedOn 
TalerIncomingPayments.payment
     var valid by TalerIncomingPayments.valid
+    var processed by TalerIncomingPayments.processed
 }
 
 object EbicsRawBankTransactionsTable : LongIdTable() {
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
index 81773a8..7ee52e7 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
@@ -630,7 +630,7 @@ fun main() {
                 return@get
             }
 
-            post("/ebics/taler/{id}/{acctid}/refund-invalid-payments") {
+            
post("/ebics/taler/{id}/accounts/{acctid}/refund-invalid-payments") {
                 transaction {
                     val subscriber = expectIdTransaction(call.parameters["id"])
                     val acctid = 
expectAcctidTransaction(call.parameters["acctid"])
@@ -641,7 +641,7 @@ fun main() {
                         )
                     }
                     TalerIncomingPaymentEntry.find {
-                        TalerIncomingPayments.processed eq false
+                        TalerIncomingPayments.processed eq false and 
TalerIncomingPayments.valid eq false
                     }.forEach {
                         createPain001entry(
                             Pain001Data(
@@ -653,6 +653,7 @@ fun main() {
                             ),
                             acctid.id.value
                         )
+                        it.processed = true
                     }
                 }
                 return@post

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

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