merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit 6039e194e6024cfff822206a232a5aa8e46ccecc
parent e6968f9f4517bad36955b7c831b7815d339f2f32
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sat,  7 Mar 2026 09:59:11 +0100

expand /config with spa option data (#11200)

Diffstat:
Msrc/backend/taler-merchant-httpd.c | 31+++++++++++++++++++++++++++++++
Msrc/backend/taler-merchant-httpd.h | 5+++++
Msrc/backend/taler-merchant-httpd_get-config.c | 3+++
3 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c @@ -111,6 +111,8 @@ struct GNUNET_TIME_Relative TMH_legal_expiration; unsigned int TMH_num_cspecs; +json_t *TMH_global_spa_config_data; + struct TALER_CurrencySpecification *TMH_cspecs; struct GNUNET_CURL_Context *TMH_curl_ctx; @@ -1066,6 +1068,35 @@ run (void *cls, return; } + { + char *spa_data; + + if (GNUNET_OK == + GNUNET_CONFIGURATION_get_value_string (TMH_cfg, + "exchange", + "GLOBAL_SPA_CONFIG_DATA", + &spa_data)) + { + json_error_t err; + + TMH_global_spa_config_data = json_loads (spa_data, + JSON_REJECT_DUPLICATES, + &err); + GNUNET_free (spa_data); + if (NULL == TMH_global_spa_config_data) + { + GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, + "exchange", + "GLOBAL_SPA_CONFIG_DATA", + err.text); + global_ret = EXIT_NOTCONFIGURED; + GNUNET_SCHEDULER_shutdown (); + return; + } + } + } + + if (GNUNET_SYSERR == (TMH_strict_v19 = GNUNET_CONFIGURATION_get_value_yesno (TMH_cfg, diff --git a/src/backend/taler-merchant-httpd.h b/src/backend/taler-merchant-httpd.h @@ -718,6 +718,11 @@ extern char *TMH_helper_sms; extern char *TMH_phone_regex; /** + * Configuration data for the SPA. + */ +extern json_t *TMH_global_spa_config_data; + +/** * Compiled version of #TMH_phone_regex, only set if #TMH_phone_regex * is not NULL. */ diff --git a/src/backend/taler-merchant-httpd_get-config.c b/src/backend/taler-merchant-httpd_get-config.c @@ -189,6 +189,9 @@ MH_handler_config (const struct TMH_RequestHandler *rh, #endif GNUNET_JSON_pack_object_steal ("currencies", specs), + GNUNET_JSON_pack_allow_null ( + GNUNET_JSON_pack_object_steal ("spa_options", + TMH_global_spa_config_data)), GNUNET_JSON_pack_array_steal ("report_generators", rgs), GNUNET_JSON_pack_array_steal ("exchanges",