gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: account information


From: gnunet
Subject: [libeufin] branch master updated: account information
Date: Fri, 29 May 2020 09:18:21 +0200

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 52429d6  account information
52429d6 is described below

commit 52429d64ae36b5058cf2a333ffa76e75c21b32ad
Author: Florian Dold <florian.dold@gmail.com>
AuthorDate: Fri May 29 12:48:16 2020 +0530

    account information
---
 nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
index e2edd8b..f42af71 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
@@ -64,6 +64,7 @@ import org.slf4j.event.Level
 import tech.libeufin.util.*
 import tech.libeufin.util.CryptoUtil.hashpw
 import tech.libeufin.util.ebics_h004.HTDResponseOrderData
+import java.net.URLEncoder
 import java.util.*
 import java.util.zip.InflaterInputStream
 import javax.crypto.EncryptedPrivateKeyInfo
@@ -376,6 +377,23 @@ fun serverMain(dbName: String) {
                 return@get
             }
 
+            get("/bank-accounts/{accountid}") {
+                val accountId = ensureNonNull(call.parameters["accountid"])
+                val res = transaction {
+                    val user = authenticateRequest(call.request)
+                    val bankAccount = 
NexusBankAccountEntity.findById(accountId)
+                    if (bankAccount == null) {
+                        throw NexusError(HttpStatusCode.NotFound, "unknown 
bank account")
+                    }
+                    val holderEnc = 
URLEncoder.encode(bankAccount.accountHolder, "UTF-8")
+                    return@transaction object {
+                        val defaultBankConnection = 
bankAccount.defaultBankConnection?.id?.value
+                        val accountPaytoUri = 
"payto://iban/${bankAccount.iban}?receiver-name=$holderEnc"
+                    }
+                }
+                call.respond(res)
+            }
+
             /**
              * Submit one particular payment to the bank.
              */

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