libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit 5bc40ce0dab5114766d9a4ae227c786ed381889c
parent 17c9189d3f80b995aa1df4dc8161fffd49877087
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date:   Tue, 14 Jan 2020 14:09:13 +0100

Tolerating missing dates range.

Diffstat:
Msandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt | 16++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt @@ -126,12 +126,16 @@ private fun ApplicationCall.handleEbicsC52(header: EbicsRequest.Header): ByteArr val history = extractHistoryForEach( subscriber.bankCustomer.id.value, - getGregorianDate().toString(), - getGregorianDate().toString() - /* Previous style where dates were fetched from the request: - op as EbicsRequest.StandardOrderParams).dateRange?.start.toString(), -- op.dateRange?.end.toString() - */ + try { + (op as EbicsRequest.StandardOrderParams).dateRange?.start.toString() + } catch (e: Exception) { + getGregorianDate().toString() + }, + try { + (op as EbicsRequest.StandardOrderParams).dateRange?.end.toString() + } catch (e: Exception) { + getGregorianDate().toString() + } ) { println(it) } val ret = constructXml(indent = true) {