[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] 04/10: Nexus DB helper to get bank accounts.
From: |
gnunet |
Subject: |
[libeufin] 04/10: Nexus DB helper to get bank accounts. |
Date: |
Sat, 07 Jan 2023 13:49:03 +0100 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository libeufin.
commit 95d4c8e64fd20c3b35ed1c4cc53e7f7697eb2570
Author: MS <ms@taler.net>
AuthorDate: Sat Jan 7 13:18:09 2023 +0100
Nexus DB helper to get bank accounts.
---
.../kotlin/tech/libeufin/nexus/bankaccount/BankAccount.kt | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
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 6cd21c62..af72ab1f 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/bankaccount/BankAccount.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/bankaccount/BankAccount.kt
@@ -352,7 +352,20 @@ fun getPaymentInitiation(uuid: Long):
PaymentInitiationEntity {
"Payment '$uuid' not found"
)
}
-
+fun getBankAccount(label: String): NexusBankAccountEntity {
+ val maybeBankAccount = transaction {
+ NexusBankAccountEntity.findByName(label)
+ }
+ return maybeBankAccount ?:
+ throw NexusError(
+ HttpStatusCode.NotFound,
+ "Account $label not found"
+ )
+}
+fun addPaymentInitiation(paymentData: Pain001Data, debtorAccount: String):
PaymentInitiationEntity {
+ val bankAccount = getBankAccount(debtorAccount)
+ return addPaymentInitiation(paymentData, bankAccount)
+}
/**
* Insert one row in the database, and leaves it marked as non-submitted.
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libeufin] branch master updated (5ba09a22 -> 7dfef458), gnunet, 2023/01/07
- [libeufin] 02/10: comment, gnunet, 2023/01/07
- [libeufin] 04/10: Nexus DB helper to get bank accounts.,
gnunet <=
- [libeufin] 10/10: Test debit detection when serving EBICS., gnunet, 2023/01/07
- [libeufin] 09/10: fix loglevel, gnunet, 2023/01/07
- [libeufin] 08/10: Debit check at server side EBICS., gnunet, 2023/01/07
- [libeufin] 05/10: Nexus HTTP status codes review., gnunet, 2023/01/07
- [libeufin] 01/10: readme, gnunet, 2023/01/07
- [libeufin] 03/10: Fix accidental import., gnunet, 2023/01/07
- [libeufin] 07/10: Introduce debit check helper., gnunet, 2023/01/07
- [libeufin] 06/10: Nexus HTTP status codes review., gnunet, 2023/01/07