libeufin

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

commit c7e8b73d9bc438c3aac270084e5f259323306064
parent 18abe977d1b92a032cf6728fe99ce4b4777d6380
Author: ms <ms@taler.net>
Date:   Sun, 19 Sep 2021 08:16:51 +0200

Define suggested Exchange

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

diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt @@ -81,6 +81,7 @@ import kotlin.system.exitProcess private val logger: Logger = LoggerFactory.getLogger("tech.libeufin.sandbox") private val hostName: String? = getValueFromEnv("LIBEUFIN_SANDBOX_HOSTNAME") private val currencyEnv: String? = getValueFromEnv("LIBEUFIN_SANDBOX_CURRENCY") +private val envName: String? = getValueFromEnv("TALER_ENV_NAME") const val SANDBOX_DB_ENV_VAR_NAME = "LIBEUFIN_SANDBOX_DB_CONNECTION" data class SandboxError( @@ -1008,10 +1009,15 @@ fun serverMain(dbName: String, port: Int) { "Withdrawal operation: $wopid not found" ) } + SandboxAssert( + envName != null, + "Env name not found, cannot suggest Exchange." + ) val ret = TalerWithdrawalStatus( selection_done = wo.selectionDone, transfer_done = wo.transferDone, - amount = "${currencyEnv}:1" + amount = "${currencyEnv}:1", + suggested_exchange = "https://exchange.${envName}.taler.net/" ) call.respond(ret) return@get @@ -1021,7 +1027,7 @@ fun serverMain(dbName: String, port: Int) { * as the wire transfer subject, and pays the exchange - which * is as well collected in this request. */ - post("/withdrawal-operation/{wopid}") { + post("/api/withdrawal-operation/{wopid}") { val wopid: String = ensureNonNull(call.parameters["wopid"]) val body = call.receiveJson<TalerWithdrawalConfirmation>()