commit 1adadeb17f48509b8dff6f17e560d2ff5dce1686
parent d7ed09726e13df4c8ef950ad29494795d11f81f9
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date: Sat, 11 Jan 2020 11:08:04 +0100
Make C52 return only today's entries.
Diffstat:
2 files changed, 6 insertions(+), 24 deletions(-)
diff --git a/nexus/src/main/kotlin/Helpers.kt b/nexus/src/main/kotlin/Helpers.kt
@@ -37,7 +37,6 @@ fun createDownloadInitializationPhase(
)
}
-
fun createDownloadInitializationPhase(
subscriberData: EbicsContainer,
orderType: String,
@@ -61,7 +60,6 @@ fun createDownloadInitializationPhase(
)
}
-
fun createUploadInitializationPhase(
subscriberData: EbicsContainer,
orderType: String,
@@ -257,8 +255,6 @@ suspend inline fun <reified T, reified S> HttpClient.postToBankSigned(
}
}
-
-
/**
* do NOT verify the bank's signature
*/
@@ -284,18 +280,4 @@ fun getNonce(size: Int): ByteArray {
val ret = ByteArray(size / 8)
sr.nextBytes(ret)
return ret
-}
-
-/* explicit point in time */
-fun getGregorianDate(year: Int, month: Int, day: Int): XMLGregorianCalendar {
- val gregorianCalendar = GregorianCalendar(year, month, day)
- val datatypeFactory = DatatypeFactory.newInstance()
- return datatypeFactory.newXMLGregorianCalendar(gregorianCalendar)
-}
-
-/* now */
-fun getGregorianDate(): XMLGregorianCalendar {
- val gregorianCalendar = GregorianCalendar()
- val datatypeFactory = DatatypeFactory.newInstance()
- return datatypeFactory.newXMLGregorianCalendar(gregorianCalendar)
-}
+}
+\ No newline at end of file
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt
@@ -111,15 +111,13 @@ private suspend fun ApplicationCall.respondEbicsKeyManagement(
respondText(text, ContentType.Application.Xml, HttpStatusCode.OK)
}
+/* intra-day account traffic */
private fun ApplicationCall.handleEbicsC52(header: EbicsRequest.Header): ByteArray {
val userId = header.static.userID!!
val od = header.static.orderDetails ?: throw Exception("Need 'OrderDetails'")
val op = od.orderParams ?: throw Exception("Need 'StandardOrderParams'")
- /**
- * (StandardOrderParams (DateRange (Start, End)))
- */
val subscriber = transaction {
EbicsSubscriberEntity.find {
@@ -129,8 +127,9 @@ private fun ApplicationCall.handleEbicsC52(header: EbicsRequest.Header): ByteArr
val history = extractHistoryForEach(
subscriber.bankCustomer.id.value,
- (op as EbicsRequest.StandardOrderParams).dateRange?.start.toString(),
- op.dateRange?.end.toString()) { println(it) }
+ getGregorianDate().toString(),
+ getGregorianDate().toString()
+ ) { println(it) }
val ret = constructXml(indent = true) {
namespace("foo", "bar")