exchange

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

pg_do_reserve_open.h (2485B)


      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 pg_do_reserve_open.h
     18  * @brief implementation of the do_reserve_open function
     19  * @author Christian Grothoff
     20  */
     21 #ifndef PG_DO_RESERVE_OPEN_H
     22 #define PG_DO_RESERVE_OPEN_H
     23 
     24 #include "taler/taler_util.h"
     25 #include "taler/taler_json_lib.h"
     26 #include "taler/taler_exchangedb_plugin.h"
     27 
     28 
     29 /**
     30  * Perform reserve open operation on database.
     31  *
     32  * @param cls closure
     33  * @param reserve_pub which reserve is this about?
     34  * @param total_paid total amount paid (coins and reserve)
     35  * @param reserve_payment amount to be paid from the reserve
     36  * @param min_purse_limit minimum number of purses we should be able to open
     37  * @param reserve_sig signature by the reserve for the operation
     38  * @param desired_expiration when should the reserve expire (earliest time)
     39  * @param now when did we the client initiate the action
     40  * @param open_fee annual fee to be charged for the open operation by the exchange
     41  * @param[out] no_funds set to true if reserve balance is insufficient
     42  * @param[out] reserve_balance set to the original reserve balance (at the start of this transaction)
     43  * @param[out] open_cost set to the actual cost
     44  * @param[out] final_expiration when will the reserve expire now
     45  * @return transaction status code
     46  */
     47 enum GNUNET_DB_QueryStatus
     48 TEH_PG_do_reserve_open (
     49   void *cls,
     50   const struct TALER_ReservePublicKeyP *reserve_pub,
     51   const struct TALER_Amount *total_paid,
     52   const struct TALER_Amount *reserve_payment,
     53   uint32_t min_purse_limit,
     54   const struct TALER_ReserveSignatureP *reserve_sig,
     55   struct GNUNET_TIME_Timestamp desired_expiration,
     56   struct GNUNET_TIME_Timestamp now,
     57   const struct TALER_Amount *open_fee,
     58   bool *no_funds,
     59   struct TALER_Amount *reserve_balance,
     60   struct TALER_Amount *open_cost,
     61   struct GNUNET_TIME_Timestamp *final_expiration);
     62 
     63 
     64 #endif