exchange

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

select_batch_deposits_missing_wire.h (3691B)


      1 /*
      2    This file is part of TALER
      3    Copyright (C) 2022-2023 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/select_batch_deposits_missing_wire.h
     18  * @brief implementation of the select_batch_deposits_missing_wire function for Postgres
     19  * @author Christian Grothoff
     20  */
     21 #ifndef EXCHANGE_DATABASE_SELECT_BATCH_DEPOSITS_MISSING_WIRE_H
     22 #define EXCHANGE_DATABASE_SELECT_BATCH_DEPOSITS_MISSING_WIRE_H
     23 
     24 #include "taler/taler_util.h"
     25 #include "taler/taler_json_lib.h"
     26 #include "exchangedb_lib.h"
     27 
     28 
     29 /**
     30  * Function called on (batch) deposits will need a wire
     31  * transfer.
     32  *
     33  * @param cls closure
     34  * @param batch_deposit_serial_id where in the table are we
     35  * @param total_amount value of all missing deposits, including fees
     36  * @param wire_target_h_payto hash of the recipient account's payto URI
     37  * @param deadline what was the earliest requested wire transfer deadline
     38  */
     39 #ifndef TALER_EXCHANGEDB_WIRE_MISSING_RESULT_CLOSURE
     40 /**
     41  * Type of the closure for #TALER_EXCHANGEDB_WireMissingCallback.
     42  */
     43 #define TALER_EXCHANGEDB_WIRE_MISSING_RESULT_CLOSURE void
     44 #endif
     45 typedef void
     46 (*TALER_EXCHANGEDB_WireMissingCallback)(
     47   TALER_EXCHANGEDB_WIRE_MISSING_RESULT_CLOSURE *cls,
     48   uint64_t batch_deposit_serial_id,
     49   const struct TALER_Amount *total_amount,
     50   const struct TALER_FullPaytoHashP *wire_target_h_payto,
     51   struct GNUNET_TIME_Timestamp deadline);
     52 
     53 
     54 /* Callback typedefs */
     55 /**
     56  * Function called on (batch) deposits will need a wire
     57  * transfer.
     58  *
     59  * @param cls closure
     60  * @param batch_deposit_serial_id where in the table are we
     61  * @param total_amount value of all missing deposits, including fees
     62  * @param wire_target_h_payto hash of the recipient account's payto URI
     63  * @param deadline what was the earliest requested wire transfer deadline
     64  */
     65 typedef void
     66 (*TALER_EXCHANGEDB_WireMissingCallback)(
     67   TALER_EXCHANGEDB_WIRE_MISSING_RESULT_CLOSURE *cls,
     68   uint64_t batch_deposit_serial_id,
     69   const struct TALER_Amount *total_amount,
     70   const struct TALER_FullPaytoHashP *wire_target_h_payto,
     71   struct GNUNET_TIME_Timestamp deadline);
     72 
     73 /**
     74  * Select all of those batch deposits in the database
     75  * above the given serial ID.
     76  *
     77  * @param pg the database context
     78  * @param min_batch_deposit_serial_id select all batch deposits above this ID
     79  * @param cb function to call on all such deposits
     80  * @param cb_cls closure for @a cb
     81  * @return transaction status code
     82  */
     83 enum GNUNET_DB_QueryStatus
     84 TALER_EXCHANGEDB_select_batch_deposits_missing_wire (struct
     85                                                      TALER_EXCHANGEDB_PostgresContext
     86                                                      *pg,
     87                                                      uint64_t
     88                                                      min_batch_deposit_serial_id,
     89                                                      TALER_EXCHANGEDB_WireMissingCallback
     90                                                      cb,
     91                                                      TALER_EXCHANGEDB_WIRE_MISSING_RESULT_CLOSURE
     92                                                      *cb_cls);
     93 
     94 #endif