taler-exchange-httpd_config.c (2554B)
1 /* 2 This file is part of TALER 3 Copyright (C) 2015-2024 Taler Systems SA 4 5 TALER is free software; you can redistribute it and/or modify it under the 6 terms of the GNU Affero General Public License as published by the Free Software 7 Foundation; either version 3, or (at your option) any later version. 8 9 TALER is distributed in the hope that it will be useful, but WITHOUT ANY 10 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 11 A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. 12 13 You should have received a copy of the GNU Affero General Public License along with 14 TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 15 */ 16 /** 17 * @file taler-exchange-httpd_config.c 18 * @brief Handle /config requests 19 * @author Christian Grothoff 20 */ 21 #include "taler/platform.h" 22 #include <gnunet/gnunet_json_lib.h> 23 #include "taler/taler_dbevents.h" 24 #include "taler-exchange-httpd_config.h" 25 #include "taler/taler_json_lib.h" 26 #include "taler/taler_kyclogic_lib.h" 27 #include "taler/taler_mhd_lib.h" 28 #include <jansson.h> 29 30 31 MHD_RESULT 32 TEH_handler_config (struct TEH_RequestContext *rc, 33 const char *const args[]) 34 { 35 static struct MHD_Response *resp; 36 37 (void) args; 38 if (NULL == resp) 39 { 40 resp = TALER_MHD_MAKE_JSON_PACK ( 41 GNUNET_JSON_pack_allow_null ( 42 GNUNET_JSON_pack_array_steal ( 43 "wallet_balance_limit_without_kyc", 44 TALER_KYCLOGIC_get_wallet_thresholds ())), 45 GNUNET_JSON_pack_allow_null ( 46 GNUNET_JSON_pack_string ("shopping_url", 47 TEH_shopping_url)), 48 GNUNET_JSON_pack_object_steal ( 49 "currency_specification", 50 TALER_JSON_currency_specs_to_json (TEH_cspec)), 51 GNUNET_JSON_pack_string ( 52 "currency", 53 TEH_currency), 54 GNUNET_JSON_pack_string ( 55 "name", 56 "taler-exchange"), 57 GNUNET_JSON_pack_allow_null ( 58 GNUNET_JSON_pack_string ( 59 "aml_spa_dialect", 60 TEH_aml_spa_dialect)), 61 GNUNET_JSON_pack_allow_null ( 62 GNUNET_JSON_pack_string ("shopping_url", 63 TEH_shopping_url)), 64 GNUNET_JSON_pack_string ( 65 "implementation", 66 "urn:net:taler:specs:taler-exchange:c-reference"), 67 GNUNET_JSON_pack_string ( 68 "version", 69 EXCHANGE_PROTOCOL_VERSION)); 70 } 71 return MHD_queue_response (rc->connection, 72 MHD_HTTP_OK, 73 resp); 74 } 75 76 77 /* end of taler-exchange-httpd_config.c */