libeufin

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

commit 6e1837c6680eb6d32153961d89ff992712af33f2
parent 0e95165db58f183559364624561cf1c169692ff4
Author: ms <ms@taler.net>
Date:   Sun, 19 Dec 2021 22:04:04 +0100

move default exchange selection at /confirm

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

diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt @@ -1064,7 +1064,7 @@ val sandboxApp: Application.() -> Unit = { ) wo.reservePub = body.reserve_pub val demobank = ensureDemobank(call) - wo.selectedExchangePayto = body.selected_exchange ?: demobank.suggestedExchangePayto + wo.selectedExchangePayto = body.selected_exchange wo.selectionDone = true wo.confirmationDone // == false } @@ -1217,6 +1217,13 @@ val sandboxApp: Application.() -> Unit = { "Cannot confirm a unselected withdrawal: " + "specify exchange and reserve public key via Integration API first." ) + /** + * The wallet chose not to select any exchange, use the default. + */ + val demobank = ensureDemobank(call) + if (wo.selectedExchangePayto == null) { + wo.selectedExchangePayto = demobank.suggestedExchangePayto + } val exchangeBankAccount = getBankAccountFromPayto( wo.selectedExchangePayto ?: throw internalServerError( "Cannot withdraw without an exchange."