exchange

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

lookup_wire_fee_by_time.h (2228B)


      1 /*
      2    This file is part of TALER
      3    Copyright (C) 2022 Taler Systems SA
      4 
      5    TALER is free software; you can redistribute it and/or modify it under the
      6    terms of the GNU 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 src/include/exchange-database/lookup_wire_fee_by_time.h
     18  * @brief implementation of the lookup_wire_fee_by_time function for Postgres
     19  * @author Christian Grothoff
     20  */
     21 #ifndef EXCHANGE_DATABASE_LOOKUP_WIRE_FEE_BY_TIME_H
     22 #define EXCHANGE_DATABASE_LOOKUP_WIRE_FEE_BY_TIME_H
     23 
     24 #include "taler/taler_util.h"
     25 #include "exchangedb_lib.h"
     26 
     27 
     28 /**
     29  * Lookup information about known wire fees.  Finds all applicable
     30  * fees in the given range. If they are identical, returns the
     31  * respective @a fees. If any of the fees
     32  * differ between @a start_time and @a end_time, the transaction
     33  * succeeds BUT returns an invalid amount for both fees.
     34  *
     35  * @param pg the database context
     36  * @param wire_method the wire method to lookup fees for
     37  * @param start_time starting time of fee
     38  * @param end_time end time of fee
     39  * @param[out] fees wire fees for that time period; if
     40  *             different fees exists within this time
     41  *             period, an 'invalid' amount is returned.
     42  * @return transaction status code
     43  */
     44 enum GNUNET_DB_QueryStatus
     45 TALER_EXCHANGEDB_lookup_wire_fee_by_time (struct
     46                                           TALER_EXCHANGEDB_PostgresContext *pg,
     47                                           const char *wire_method,
     48                                           struct GNUNET_TIME_Timestamp
     49                                           start_time,
     50                                           struct GNUNET_TIME_Timestamp end_time,
     51                                           struct TALER_WireFeeSet *fees);
     52 
     53 #endif