exchange

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

commit 72c3c3b8df0ea1cd9354aabe4fd13c9e102ca752
parent 48bf24e2f03e7e2bef4a317ea06bc1ea3389939c
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun, 31 May 2026 14:31:19 +0200

implement protocol v36

Diffstat:
Msrc/exchange/exchange.conf | 5+++++
Msrc/exchange/taler-exchange-httpd.c | 14++++++++++++++
Msrc/exchange/taler-exchange-httpd.h | 7+++++++
Msrc/exchange/taler-exchange-httpd_get-keys.c | 2++
Msrc/include/taler/exchange/get-keys.h | 8++++++++
Msrc/lib/exchange_api_handle.c | 6++++++
6 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/src/exchange/exchange.conf b/src/exchange/exchange.conf @@ -23,6 +23,11 @@ ATTRIBUTE_ENCRYPTION_KEY = SET_ME_PLEASE # Set to YES to enable AML/KYC. ENABLE_KYC = NO +# Set to YES to signal to the merchant backend that it should +# swap the terms-of-service and KYC auth authentication steps +# in the user experience. +KYC_SWAP_TOS_ACCEPTANCE = NO + # Set to YES to disable direct deposits. DISABLE_DIRECT_DEPOSIT = NO diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c @@ -197,6 +197,13 @@ int TEH_enable_kyc; int TEH_disable_direct_deposit; /** + * Option set to #GNUNET_YES to signal to the merchant + * backend that it should swap the terms-of-service and + * KYC auth authentication steps in the user experience. + */ +int TEH_kyc_swap_tos_acceptance; + +/** * -I command-line flag given? */ int TEH_check_invariants_flag; @@ -2145,6 +2152,13 @@ exchange_serve_process_config (const char *cfg_fn) "Need YES or NO\n"); return GNUNET_SYSERR; } + TEH_kyc_swap_tos_acceptance + = GNUNET_CONFIGURATION_get_value_yesno ( + TEH_cfg, + "exchange", + "KYC_SWAP_TOS_ACCEPTANCE"); + if (GNUNET_SYSERR == TEH_kyc_swap_tos_acceptance) + TEH_kyc_swap_tos_acceptance = GNUNET_NO; if (GNUNET_OK != TALER_KYCLOGIC_kyc_init (TEH_cfg, cfg_fn)) diff --git a/src/exchange/taler-exchange-httpd.h b/src/exchange/taler-exchange-httpd.h @@ -86,6 +86,13 @@ extern int TEH_enable_kyc; extern int TEH_disable_direct_deposit; /** + * Option set to #GNUNET_YES to signal to the merchant + * backend that it should swap the terms-of-service and + * KYC auth authentication steps in the user experience. + */ +extern int TEH_kyc_swap_tos_acceptance; + +/** * Main directory with revocation data. */ extern char *TEH_revocation_directory; diff --git a/src/exchange/taler-exchange-httpd_get-keys.c b/src/exchange/taler-exchange-httpd_get-keys.c @@ -1836,6 +1836,8 @@ create_krd (struct TEH_KeyStateHandle *ksh, asset_type), GNUNET_JSON_pack_bool ("kyc_enabled", GNUNET_YES == TEH_enable_kyc), + GNUNET_JSON_pack_bool ("kyc_swap_tos_acceptance", + GNUNET_YES == TEH_kyc_swap_tos_acceptance), GNUNET_JSON_pack_bool ("disable_direct_deposit", GNUNET_YES == TEH_disable_direct_deposit), GNUNET_JSON_pack_bool ("rewards_allowed", diff --git a/src/include/taler/exchange/get-keys.h b/src/include/taler/exchange/get-keys.h @@ -767,6 +767,14 @@ struct TALER_EXCHANGE_Keys bool kyc_enabled; /** + * Set to true to signal to the merchant backend that + * it should swap the terms-of-service and KYC auth + * authentication steps in the user experience. + * Defaults to false if not provided by the exchange. + */ + bool kyc_swap_tos_acceptance; + + /** * Set to true if the @e tiny_amount field is valid. * @since protocol v21. */ diff --git a/src/lib/exchange_api_handle.c b/src/lib/exchange_api_handle.c @@ -1055,6 +1055,10 @@ TALER_EXCHANGE_decode_keys_json_ ( GNUNET_JSON_spec_bool ("disable_direct_deposit", &key_data->disable_direct_deposit), NULL), + GNUNET_JSON_spec_mark_optional ( + GNUNET_JSON_spec_bool ("kyc_swap_tos_acceptance", + &key_data->kyc_swap_tos_acceptance), + NULL), GNUNET_JSON_spec_end () }; const char *emsg; @@ -2319,6 +2323,8 @@ TALER_EXCHANGE_keys_to_json (const struct TALER_EXCHANGE_Keys *kd) kd->bank_compliance_language)), GNUNET_JSON_pack_bool ("disable_direct_deposit", kd->disable_direct_deposit), + GNUNET_JSON_pack_bool ("kyc_swap_tos_acceptance", + kd->kyc_swap_tos_acceptance), GNUNET_JSON_pack_data_auto ("master_public_key", &kd->master_pub), GNUNET_JSON_pack_time_rel ("reserve_closing_delay",