libeufin

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

commit 96898782fa6809d9b680cbbc74086aaf036ee9c5
parent b31804f28e24b9a5399b52a75fc0e30645e588e6
Author: MS <ms@taler.net>
Date:   Thu, 14 May 2020 20:19:38 +0200

Default dates needed.

Diffstat:
Mintegration-tests/test-ebics-new.py | 16++++++++++------
Mnexus/src/main/kotlin/tech/libeufin/nexus/JSON.kt | 7++++---
Mnexus/src/main/kotlin/tech/libeufin/nexus/Main.kt | 2+-
3 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/integration-tests/test-ebics-new.py b/integration-tests/test-ebics-new.py @@ -246,18 +246,22 @@ assertResponse( ) ) -nexus.terminate() -sandbox.terminate() -exit(44) - #3, request history to Nexus assertResponse( post( - "http://localhost:5001/ebics/subscribers/{}/collect-transactions-c53".format(USERNAME), - json=dict() + "http://localhost:5001/bank-accounts/collected-transactions", + json=dict( + type="ebics", + name="my-ebics" + ), + headers=dict(Authorization=USER_AUTHORIZATION_HEADER) ) ) +nexus.terminate() +sandbox.terminate() +exit(44) + #4 resp = assertResponse( get( diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/JSON.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/JSON.kt @@ -1,5 +1,6 @@ package tech.libeufin.nexus +import org.joda.time.DateTime import tech.libeufin.util.* import java.time.LocalDate @@ -15,8 +16,8 @@ data class EbicsStandardOrderParamsJson(val dateRange: EbicsDateRangeJson?) { fun toOrderParams(): EbicsOrderParams { var dateRange: EbicsDateRange? = if (this.dateRange != null) { EbicsDateRange( - LocalDate.parse(this.dateRange.start), - LocalDate.parse(this.dateRange.end) + LocalDate.parse(this.dateRange.start ?: "1970-01-31"), + LocalDate.parse(this.dateRange.end ?: DateTime.now().toDashedDate()) ) } else { null @@ -158,7 +159,7 @@ data class SubmitPayment( /** Request type of "POST /collected-transactions" */ data class CollectedTransaction( - val transport: tech.libeufin.nexus.Transport?, + val transport: Transport?, val start: String?, val end: String? ) diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt @@ -376,7 +376,7 @@ fun main() { * the basis of a transport subscriber (regardless of their * bank account details) */ - post("/bank-accounts/{accountid}/collected-transactions") { + post("/bank-accounts/collected-transactions") { val userId = authenticateRequest(call.request.headers["Authorization"]) val body = call.receive<CollectedTransaction>() if (body.transport != null) {