exchange

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

do_reserve_open.h (3073B)


      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 do_reserve_open.h
     18  * @brief implementation of the do_reserve_open function
     19  * @author Christian Grothoff
     20  */
     21 #ifndef EXCHANGE_DATABASE_DO_RESERVE_OPEN_H
     22 #define EXCHANGE_DATABASE_DO_RESERVE_OPEN_H
     23 
     24 #include "taler/taler_util.h"
     25 #include "taler/taler_json_lib.h"
     26 #include "exchangedb_lib.h"
     27 
     28 
     29 /**
     30  * Perform reserve open operation on database.
     31  *
     32  * @param pg the database context
     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 TALER_EXCHANGEDB_do_reserve_open (struct TALER_EXCHANGEDB_PostgresContext *pg,
     49                                   const struct TALER_ReservePublicKeyP *
     50                                   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 *
     55                                   reserve_sig,
     56                                   struct GNUNET_TIME_Timestamp
     57                                   desired_expiration,
     58                                   struct GNUNET_TIME_Timestamp now,
     59                                   const struct TALER_Amount *open_fee,
     60                                   bool *no_funds,
     61                                   struct TALER_Amount *reserve_balance,
     62                                   struct TALER_Amount *open_cost,
     63                                   struct GNUNET_TIME_Timestamp *final_expiration
     64                                   );
     65 
     66 
     67 #endif