gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: make sure only one Camt is responded


From: gnunet
Subject: [libeufin] branch master updated: make sure only one Camt is responded
Date: Fri, 15 Jan 2021 17:19:01 +0100

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 ad85d90  make sure only one Camt is responded
ad85d90 is described below

commit ad85d90d5cdf71e57401f4071316c84bb499a5bb
Author: ms <ms@taler.net>
AuthorDate: Fri Jan 15 17:18:32 2021 +0100

    make sure only one Camt is responded
---
 .../kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt   | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git 
a/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt 
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt
index 541bfde..8c506e7 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt
@@ -441,7 +441,7 @@ fun buildCamtString(type: Int, subscriberIban: String, 
history: List<RawPayment>
  *
  * @param type 52 or 53.
  */
-private fun constructCamtResponse(type: Int, header: EbicsRequest.Header, 
subscriber: EbicsSubscriberEntity): MutableList<String> {
+private fun constructCamtResponse(type: Int, header: EbicsRequest.Header, 
subscriber: EbicsSubscriberEntity): String {
     val dateRange = (header.static.orderDetails?.orderParams as 
EbicsRequest.StandardOrderParams).dateRange
     val (start: LocalDateTime, end: LocalDateTime) = if (dateRange != null) {
         Pair(
@@ -452,7 +452,7 @@ private fun constructCamtResponse(type: Int, header: 
EbicsRequest.Header, subscr
     val bankAccount = getBankAccountFromSubscriber(subscriber)
     logger.info("getting history for account with iban ${bankAccount.iban}")
     val history = historyForAccount(bankAccount.iban)
-    return mutableListOf(buildCamtString(type, bankAccount.iban, history))
+    return buildCamtString(type, bankAccount.iban, history)
 }
 
 /**
@@ -591,15 +591,11 @@ private fun handleEbicsC53(requestContext: 
RequestContext): ByteArray {
         requestContext.requestObject.header,
         requestContext.subscriber
     )
-    // FIXME: this function should be replaced with one that fills only
-    // *one* CAMT document with multiple "Ntry" elements.
-    return camt.map {
-        if (!XMLUtil.validateFromString(it)) throw SandboxError(
+   if (!XMLUtil.validateFromString(camt)) throw SandboxError(
             HttpStatusCode.InternalServerError,
             "CAMT document was generated invalid"
-        )
-        it.toByteArray(Charsets.UTF_8)
-    }.zip()
+   )
+    return listOf(camt.toByteArray(Charsets.UTF_8)).zip()
 }
 
 private suspend fun ApplicationCall.handleEbicsHia(header: 
EbicsUnsecuredRequest.Header, orderData: ByteArray) {

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