exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit e6a50ff981459c8f634acdb7a06d2ad60080335d
parent f3e67ba34312909ca5600ead77b3eb5a58b40620
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Wed, 30 Jul 2025 13:02:23 +0200

implement #10207

Diffstat:
Msrc/exchange/taler-exchange-httpd.c | 25+++++++++++++++++++++++++
Msrc/exchange/taler-exchange-httpd.h | 6++++++
Msrc/exchange/taler-exchange-httpd_config.c | 7+++++++
Msrc/exchange/taler-exchange-httpd_config.h | 4++--
Msrc/exchange/taler-exchange-httpd_keys.c | 4++++
5 files changed, 44 insertions(+), 2 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c @@ -200,6 +200,12 @@ json_t *TEH_zero_limits; char *TEH_shopping_url; /** + * URL where wallets can find an open banking gateway API to + * initiate wire transfers to withdraw money from this exchange. Can be NULL. + */ +char *TEH_obg_url; + +/** * Where to redirect users from "/"? */ static char *toplevel_redirect_url; @@ -2338,6 +2344,25 @@ exchange_serve_process_config (const char *cfg_fn) "invalid URL"); return GNUNET_SYSERR; } + if (GNUNET_OK != + GNUNET_CONFIGURATION_get_value_string (TEH_cfg, + "exchange", + "OPEN_BANKING_GATEWAY_URL", + &TEH_obg_url)) + { + GNUNET_log_config_missing (GNUNET_ERROR_TYPE_INFO, + "exchange", + "OPEN_BANKING_GATEWAY_URL"); + } + if ( (NULL != TEH_obg_url) && + (! TALER_is_web_url (TEH_obg_url)) ) + { + GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, + "exchange", + "OPEN_BANKING_GATEWAY_URL", + "invalid URL"); + return GNUNET_SYSERR; + } { char *master_public_key_str; diff --git a/src/exchange/taler-exchange-httpd.h b/src/exchange/taler-exchange-httpd.h @@ -149,6 +149,12 @@ extern struct TALER_Amount TEH_tiny_amount; extern char *TEH_shopping_url; /** + * URL where wallets can find an open banking gateway API to + * initiate wire transfers to withdraw money from this exchange. Can be NULL. + */ +extern char *TEH_obg_url; + +/** * Linear STEFAN parameter. */ extern float TEH_stefan_lin; diff --git a/src/exchange/taler-exchange-httpd_config.c b/src/exchange/taler-exchange-httpd_config.c @@ -62,6 +62,13 @@ TEH_handler_config (struct TEH_RequestContext *rc, GNUNET_JSON_pack_string ( "aml_spa_dialect", TEH_aml_spa_dialect)), + GNUNET_JSON_pack_allow_null ( + GNUNET_JSON_pack_string ("shopping_url", + TEH_shopping_url)), + GNUNET_JSON_pack_allow_null ( + GNUNET_JSON_pack_string ( + "open_banking_gateway", + TEH_obg_url)), GNUNET_JSON_pack_string ( "implementation", "urn:net:taler:specs:taler-exchange:c-reference"), diff --git a/src/exchange/taler-exchange-httpd_config.h b/src/exchange/taler-exchange-httpd_config.h @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2023 Taler Systems SA + (C) 2025 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -41,7 +41,7 @@ * * Returned via both /config and /keys endpoints. */ -#define EXCHANGE_PROTOCOL_VERSION "30:2:8" +#define EXCHANGE_PROTOCOL_VERSION "30:3:8" /** diff --git a/src/exchange/taler-exchange-httpd_keys.c b/src/exchange/taler-exchange-httpd_keys.c @@ -2491,6 +2491,10 @@ create_krd (struct TEH_KeyStateHandle *ksh, GNUNET_JSON_pack_string ("shopping_url", TEH_shopping_url)), GNUNET_JSON_pack_allow_null ( + GNUNET_JSON_pack_string ( + "open_banking_gateway", + TEH_obg_url)), + GNUNET_JSON_pack_allow_null ( TALER_amount_is_zero (&TEH_tiny_amount) ? GNUNET_JSON_pack_string ("dummy", NULL)