gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: list accounts under custom name


From: gnunet
Subject: [libeufin] branch master updated: list accounts under custom name
Date: Sun, 21 Jun 2020 00:11:59 +0200

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 d7dc764  list accounts under custom name
d7dc764 is described below

commit d7dc764e1c19022a5d1fd3a73c02096c3cd75af4
Author: MS <ms@taler.net>
AuthorDate: Sun Jun 21 00:11:47 2020 +0200

    list accounts under custom name
---
 cli/libeufin-cli-new                                     | 16 ++++++++++++++++
 .../main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt  | 14 +++++++++++++-
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/cli/libeufin-cli-new b/cli/libeufin-cli-new
index 513d51f..43bab5b 100755
--- a/cli/libeufin-cli-new
+++ b/cli/libeufin-cli-new
@@ -175,6 +175,22 @@ def download_bank_accounts(obj, connection_name, 
nexus_user_id, nexus_password,
     print(resp.content.decode("utf-8"))
 
 
+@bank_connection.command(help="list imported bank accounts")
+@click.option("--connection-name", help="Connection ID", required=True)
+@click.option("--nexus-user-id", help="Nexus user ID", required=True)
+@click.option("--nexus-password", help="Nexus password", required=True)
+@click.argument("nexus-base-url")
+@click.pass_obj
+def list_imported_bank_accounts(obj, connection_name, nexus_user_id, 
nexus_password, nexus_base_url):
+    # FIXME/NOTE: the 'ebics' part will soon go away.
+    url = urljoin(nexus_base_url, 
"/bank-connections/{}/ebics/accounts/imported".format(connection_name))
+    try:
+        resp = get(url, json=dict(), auth = auth.HTTPBasicAuth(nexus_user_id, 
nexus_password))
+    except Exception:
+        print("Could not reach nexus")
+        return
+    print(resp.content.decode("utf-8"))
+
 @bank_connection.command(help="list raw bank account information locally 
stored")
 @click.option("--connection-name", help="Connection ID", required=True)
 @click.option("--nexus-user-id", help="Nexus user ID", required=True)
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 9a8cabe..77557f4 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt
@@ -422,6 +422,18 @@ fun Route.ebicsBankConnectionRoutes(client: HttpClient) {
         }
         call.respond(object {})
     }
+    get("/accounts/imported") {
+        var ret = BankAccounts()
+        transaction {
+            val conn = requireBankConnection(call, "connid")
+            NexusBankAccountEntity.find {
+                NexusBankAccountsTable.defaultBankConnection eq conn.id.value
+            }.forEach { ret.accounts.add(
+                BankAccount(holder = it.accountHolder, iban = it.iban, bic = 
it.bankCode, account = it.id.value)
+            ) }
+        }
+        call.respond(ret)
+    }
     get("/accounts") {
         val ret = BankAccounts()
         transaction {
@@ -453,7 +465,7 @@ fun Route.ebicsBankConnectionRoutes(client: HttpClient) {
     post("/accounts/import") {
         val body = call.receive<ImportBankAccount>()
         transaction {
-            val conn = requireBankConnection(call, "callid")
+            val conn = requireBankConnection(call, "connid")
             val hasXml = RawHTDResponseEntity.findById(conn.id.value) ?: throw 
NexusError(
                 HttpStatusCode.NotFound, "Could not found raw bank account 
data for connection '${conn.id.value}'"
             )

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