gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: add raw CRZ query


From: gnunet
Subject: [libeufin] branch master updated: add raw CRZ query
Date: Wed, 25 Mar 2020 13:33:31 +0100

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

dold pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new 35f5f83  add raw CRZ query
35f5f83 is described below

commit 35f5f8318b1395bdaf705d4ce2b0833cb645af19
Author: Florian Dold <address@hidden>
AuthorDate: Wed Mar 25 18:03:26 2020 +0530

    add raw CRZ query
---
 cli/python/libeufin-cli                           | 24 +++++++++++++++++++++++
 nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt | 23 ++++++++++++++++++++++
 2 files changed, 47 insertions(+)

diff --git a/cli/python/libeufin-cli b/cli/python/libeufin-cli
index 0fa5ce9..1c0399e 100755
--- a/cli/python/libeufin-cli
+++ b/cli/python/libeufin-cli
@@ -397,6 +397,30 @@ def c52(obj, account_id, date_range, nexus_base_url):
     resp = post(url, json=req)
     print(resp.content.decode("utf-8"))
 
+@ebics.command(help="Send CRZ message")
+@click.pass_obj
+@click.option(
+    "--account-id",
+    help="Numerical ID of the customer at the Nexus",
+    required=True
+)
+@click.option(
+    "--date-range",
+    help="Date range for the query",
+    nargs=2,
+    required=False,
+)
+@click.argument(
+  "nexus-base-url"
+)
+def crz(obj, account_id, date_range, nexus_base_url):
+    if date_range is not None and len(date_range) == 2:
+        req = dict(dateRange=dict(start=date_range[0], end=date_range[1]))
+    else:
+        req = dict()
+    url = urljoin(nexus_base_url, 
"/ebics/subscribers/{}/sendCRZ".format(account_id))
+    resp = post(url, json=req)
+    print(resp.content.decode("utf-8"))
 
 @ebics.command(help="Send C53 message")
 @click.pass_obj
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
index 87e5142..0fe67d4 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
@@ -661,6 +661,29 @@ fun main() {
                 }
             }
 
+            post("/ebics/subscribers/{id}/sendCRZ") {
+                val id = expectId(call.parameters["id"])
+                val paramsJson = call.receive<EbicsStandardOrderParamsJson>()
+                val orderParams = paramsJson.toOrderParams()
+                val subscriberData = getSubscriberDetailsFromId(id)
+                val response = doEbicsDownloadTransaction(client, 
subscriberData, "CRZ", orderParams)
+                when (response) {
+                    is EbicsDownloadSuccessResult -> {
+                        call.respondText(
+                            unzipOrderData(response.orderData),
+                            ContentType.Text.Plain,
+                            HttpStatusCode.OK
+                        )
+                    }
+                    is EbicsDownloadBankErrorResult -> {
+                        call.respond(
+                            HttpStatusCode.BadGateway,
+                            EbicsErrorJson(EbicsErrorDetailJson("bankError", 
response.returnCode.errorCode))
+                        )
+                    }
+                }
+            }
+
             post("/ebics/subscribers/{id}/sendC53") {
                 val id = expectId(call.parameters["id"])
                 val paramsJson = call.receive<EbicsStandardOrderParamsJson>()

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



reply via email to

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