merchant

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

taler-merchant-httpd_terms.c (2290B)


      1 /*
      2   This file is part of TALER
      3   Copyright (C) 2019, 2021, 2025 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-merchant-httpd_terms.c
     18  * @brief Handle /terms requests to return the terms of service
     19  * @author Christian Grothoff
     20  */
     21 #include "taler-merchant-httpd_terms.h"
     22 
     23 /**
     24  * Our terms of service.
     25  */
     26 static struct TALER_MHD_Legal *tos;
     27 
     28 
     29 /**
     30  * Our privacy policy.
     31  */
     32 static struct TALER_MHD_Legal *pp;
     33 
     34 
     35 MHD_RESULT
     36 TMH_handler_terms (const struct TMH_RequestHandler *rh,
     37                    struct MHD_Connection *connection,
     38                    struct TMH_HandlerContext *rc)
     39 {
     40   (void) rh;
     41   (void) rc;
     42   return TALER_MHD_reply_legal (connection,
     43                                 tos);
     44 }
     45 
     46 
     47 MHD_RESULT
     48 TMH_handler_privacy (const struct TMH_RequestHandler *rh,
     49                      struct MHD_Connection *connection,
     50                      struct TMH_HandlerContext *rc)
     51 {
     52   (void) rh;
     53   (void) rc;
     54   return TALER_MHD_reply_legal (connection,
     55                                 pp);
     56 }
     57 
     58 
     59 void
     60 TMH_load_terms (const struct GNUNET_CONFIGURATION_Handle *cfg)
     61 {
     62   tos = TALER_MHD_legal_load (cfg,
     63                               "merchant",
     64                               "TERMS_DIR",
     65                               "TERMS_ETAG");
     66   if (NULL == tos)
     67     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
     68                 "Terms of service not configured\n");
     69   pp = TALER_MHD_legal_load (cfg,
     70                              "merchant",
     71                              "PRIVACY_DIR",
     72                              "PRIVACY_ETAG");
     73   if (NULL == pp)
     74     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
     75                 "Privacy policy not configured\n");
     76 }
     77 
     78 
     79 /* end of taler-merchant-httpd_terms.c */