[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] branch master updated: Ebics C53 handler takes the response f
From: |
gnunet |
Subject: |
[libeufin] branch master updated: Ebics C53 handler takes the response from the DB. |
Date: |
Tue, 31 Aug 2021 11:40:11 +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 92f8e94 Ebics C53 handler takes the response from the DB.
92f8e94 is described below
commit 92f8e94155b8e8063e636e009dd06f3e03e45690
Author: MS <ms@taler.net>
AuthorDate: Mon Aug 30 22:38:34 2021 -1100
Ebics C53 handler takes the response from the DB.
It used to generate it on the fly. The next step is
to make it accept a date range parameter.
---
.../tech/libeufin/sandbox/EbicsProtocolBackend.kt | 25 +++++++++++++---------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git
a/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt
index bc79dcc..739b3e7 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt
@@ -467,17 +467,22 @@ private fun constructCamtResponse(type: Int, subscriber:
EbicsSubscriberEntity):
} else Pair(parseDashedDate("1970-01-01"), LocalDateTime.now())
*/
+ /**
+ * FIXME: when this function throws an exception, it makes a JSON response
being responded.
+ * That is bad, because here we're inside a Ebics handler and only XML
should
+ * be returned to the requester. This problem makes the (unhelpful) "bank
didn't
+ * return XML" message appear in the Nexus logs.
+ */
val bankAccount = getBankAccountFromSubscriber(subscriber)
- logger.info("getting history for account with iban ${bankAccount.iban}")
- val history = historyForAccount(bankAccount)
- val baseBalance = BigDecimal.ZERO
- return buildCamtString(
- type,
- bankAccount.iban,
- history,
- balancePrcd = baseBalance,
- balanceClbd = balanceForAccount(history, baseBalance)
- ).camtMessage
+ val camtMessage = transaction {
+ BankAccountStatementEntity.find {
+ BankAccountStatementsTable.bankAccount eq bankAccount.id
+ }.lastOrNull()?.xmlMessage ?: throw EbicsRequestError(
+ "[EBICS_NO_DOWNLOAD_DATA_AVAILABE]",
+ "090005"
+ )
+ }
+ return camtMessage
}
/**
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libeufin] branch master updated: Ebics C53 handler takes the response from the DB.,
gnunet <=