libeufin

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

commit 626244533fe50ca49675673951e19ead34af349c
parent f74f261260ea46d68e5d4f37a49319eb13a9fd96
Author: MS <ms@taler.net>
Date:   Tue, 31 Oct 2023 14:16:15 +0100

implementing ebics-submit --transient flag

Diffstat:
Mnexus/src/main/kotlin/tech/libeufin/nexus/EbicsSubmit.kt | 12++++++++++++
Mutil/src/main/kotlin/ebics_h004/EbicsRequest.kt | 2+-
2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/EbicsSubmit.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/EbicsSubmit.kt @@ -20,6 +20,7 @@ package tech.libeufin.nexus import com.github.ajalt.clikt.core.CliktCommand +import com.github.ajalt.clikt.parameters.options.flag import com.github.ajalt.clikt.parameters.options.option import io.ktor.client.* import kotlinx.coroutines.runBlocking @@ -168,6 +169,12 @@ class EbicsSubmit : CliktCommand("Submits any initiated payment found in the dat "--config", "-c", help = "set the configuration file" ) + private val transient by option( + "--transient", + help = "This flag submits what is found in the database and returns, " + + "ignoring the 'frequency' value found in the configuration" + ).flag(default = true) + /** * Submits any initiated payment that was not submitted * so far and -- according to the configuration -- returns @@ -192,6 +199,11 @@ class EbicsSubmit : CliktCommand("Submits any initiated payment found in the dat logger.error("Client private keys not found at: ${cfg.clientPrivateKeysFilename}") exitProcess(1) } + if (transient) { + logger.info("Transient mode: submitting what found and returning.") + submitBatch(cfg, db, httpClient, clientKeys, bankKeys) + return + } if (frequency == 0) { logger.warn("Long-polling not implemented, submitting what is found and exit") submitBatch(cfg, db, httpClient, clientKeys, bankKeys) diff --git a/util/src/main/kotlin/ebics_h004/EbicsRequest.kt b/util/src/main/kotlin/ebics_h004/EbicsRequest.kt @@ -160,7 +160,7 @@ class EbicsRequest { lateinit var orderType: String /** - * Only present if this ebicsRequest is a upload order + * Only present if this ebicsRequest is an upload order * relating to an already existing order. */ @get:XmlElement(name = "OrderID", required = true)