merchant

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

taler-merchant-httpd_contract.h (2019B)


      1 /*
      2   This file is part of TALER
      3   (C) 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 Lesser 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 General Public License for more details.
     12 
     13   You should have received a copy of the GNU 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_contract.h
     18  * @brief shared logic for contract terms handling
     19  * @author Christian Blättler
     20  */
     21 #ifndef TALER_MERCHANT_HTTPD_CONTRACT_H
     22 #define TALER_MERCHANT_HTTPD_CONTRACT_H
     23 
     24 #include "taler-merchant-httpd.h"
     25 #include <gnunet/gnunet_common.h>
     26 #include <gnunet/gnunet_time_lib.h>
     27 #include "taler_merchant_util.h"
     28 #include <jansson.h>
     29 
     30 
     31 /**
     32  * Find matching token family in @a families based on @a slug. Then use
     33  * @a valid_after to find the matching public key within it.
     34  *
     35  * @param slug slug of the token family
     36  * @param valid_after end time of the validity period of the key to find
     37  * @param families array of token families to search in
     38  * @param families_len length of the @a families array
     39  * @param[out] family found family, set to NULL to only check for existence
     40  * @param[out] key found key, set to NULL to only check for existence
     41  * @return #GNUNET_OK on success #GNUNET_NO if no key was found
     42  */
     43 // FIXME: awkward API, implementation duplicates code...
     44 enum GNUNET_GenericReturnValue
     45 TMH_find_token_family_key (
     46   const char *slug,
     47   struct GNUNET_TIME_Timestamp valid_after,
     48   const struct TALER_MERCHANT_ContractTokenFamily *families,
     49   unsigned int families_len,
     50   struct TALER_MERCHANT_ContractTokenFamily *family,
     51   struct TALER_MERCHANT_ContractTokenFamilyKey *key);
     52 
     53 #endif