libeufin

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

commit eda347129bb27eb75089e84f48d9afc10d79f497
parent b4afc11a0bd1804520d93253abf7b610c5e2354f
Author: ms <ms@taler.net>
Date:   Fri,  5 Nov 2021 23:55:13 +0100

adapt after wallet tests harness

Diffstat:
Msandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt | 8++++----
Msandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt | 11++++++++---
2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt @@ -303,11 +303,11 @@ fun getBankAccountFromLabel(label: String, demobank: DemobankConfigEntity): Bank return transaction { BankAccountEntity.find( BankAccountsTable.label eq label and (BankAccountsTable.demoBank eq demobank.id) + ).firstOrNull() ?: throw SandboxError( + HttpStatusCode.NotFound, + "Did not find a bank account for label ${label}" ) - }.firstOrNull() ?: throw SandboxError( - HttpStatusCode.NotFound, - "Did not find a bank account for label ${label}" - ) + } } fun getBankAccountFromSubscriber(subscriber: EbicsSubscriberEntity): BankAccountEntity { diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt @@ -1111,11 +1111,11 @@ val sandboxApp: Application.() -> Unit = { "taler".plus(if (baseUrl.protocol.lowercase() == "http") "+http" else ""), -1 ) - pathComponents(baseUrl.path, "access-api", wo.wopid.toString()) + pathComponents(baseUrl.path, wo.wopid.toString()) encodedPath += "/" } call.respond(object { - val withdrawal_id = wo.id.value + val withdrawal_id = wo.id.value.toString() val taler_withdraw_uri = withdrawUri }) return@post @@ -1271,7 +1271,12 @@ val sandboxApp: Application.() -> Unit = { transaction { BankAccountEntity.new { iban = getIban() - label = req.username + "-acct" // multiple accounts per username not allowed. + /** + * For now, keep same semantics of Pybank: a username + * is AS WELL a bank account label. In other words, it + * identifies a customer AND a bank account. + */ + label = req.username owner = req.username this.demoBank = demobank }