exchange

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

taler-exchange-httpd_config.c (2812B)


      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       /* Deprecated in v24 */
     49       GNUNET_JSON_pack_array_steal (
     50         "supported_kyc_requirements",
     51         json_array ()),
     52       GNUNET_JSON_pack_object_steal (
     53         "currency_specification",
     54         TALER_JSON_currency_specs_to_json (TEH_cspec)),
     55       GNUNET_JSON_pack_string (
     56         "currency",
     57         TEH_currency),
     58       GNUNET_JSON_pack_string (
     59         "name",
     60         "taler-exchange"),
     61       GNUNET_JSON_pack_allow_null (
     62         GNUNET_JSON_pack_string (
     63           "aml_spa_dialect",
     64           TEH_aml_spa_dialect)),
     65       GNUNET_JSON_pack_allow_null (
     66         GNUNET_JSON_pack_string ("shopping_url",
     67                                  TEH_shopping_url)),
     68       GNUNET_JSON_pack_allow_null (
     69         GNUNET_JSON_pack_string (
     70           "open_banking_gateway",
     71           TEH_obg_url)),
     72       GNUNET_JSON_pack_string (
     73         "implementation",
     74         "urn:net:taler:specs:taler-exchange:c-reference"),
     75       GNUNET_JSON_pack_string (
     76         "version",
     77         EXCHANGE_PROTOCOL_VERSION));
     78   }
     79   return MHD_queue_response (rc->connection,
     80                              MHD_HTTP_OK,
     81                              resp);
     82 }
     83 
     84 
     85 /* end of taler-exchange-httpd_config.c */