libeufin

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

commit a8a3d0bc5f18a3ca404483bede17a58f1f46c88a
parent d1257925553816bd333549b6dbbfced7c2d9eb62
Author: ms <ms@taler.net>
Date:   Sat, 23 Oct 2021 09:46:34 +0200

take currency from demobank

Diffstat:
Msandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt | 9+++++----
Mutil/src/main/kotlin/JSON.kt | 4++++
2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt @@ -415,10 +415,10 @@ val sandboxApp: Application.() -> Unit = { logger.error("Exception while handling '${call.request.uri}'", cause) call.respondText( "Invalid arithmetic attempted.", - io.ktor.http.ContentType.Text.Plain, + ContentType.Text.Plain, // here is always the bank's fault, as it should always check // the operands. - io.ktor.http.HttpStatusCode.InternalServerError + HttpStatusCode.InternalServerError ) } exception<SandboxError> { cause -> @@ -618,12 +618,11 @@ val sandboxApp: Application.() -> Unit = { this.account = account direction = "CRDT" this.demobank = demobank + currency = demobank.currency } } call.respond(object {}) } - - // Associates a new bank account with an existing Ebics subscriber. post("/admin/ebics/bank-accounts") { val username = call.request.basicAuth() @@ -758,6 +757,7 @@ val sandboxApp: Application.() -> Unit = { this.account = account direction = "CRDT" this.demobank = demobank + currency = demobank.currency } } @@ -778,6 +778,7 @@ val sandboxApp: Application.() -> Unit = { this.account = account direction = "DBIT" this.demobank = demobank + currency = demobank.currency } } } diff --git a/util/src/main/kotlin/JSON.kt b/util/src/main/kotlin/JSON.kt @@ -51,6 +51,10 @@ data class IncomingPaymentInfo( val debtorIban: String, val debtorBic: String?, val debtorName: String, + /** + * A stringified number, no currency required. This + * one will be extracted from the demobank configuration. + */ val amount: String, val subject: String )