exchange

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

select_pending_deposits.h (4125B)


      1 /*
      2    This file is part of TALER
      3    Copyright (C) 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/auditor-database/select_pending_deposits.h
     18  * @brief implementation of the select_pending_deposits function for Postgres
     19  * @author Christian Grothoff
     20  */
     21 #ifndef AUDITOR_DATABASE_SELECT_PENDING_DEPOSITS_H
     22 #define AUDITOR_DATABASE_SELECT_PENDING_DEPOSITS_H
     23 
     24 #include "taler/taler_util.h"
     25 #include "taler/taler_json_lib.h"
     26 #include "auditordb_lib.h"
     27 
     28 
     29 /**
     30  * Function called on deposits that are past their due date
     31  * and have not yet seen a wire transfer.
     32  *
     33  * @param cls closure
     34  * @param row_id row ID of the alert in the auditor database
     35  * @param batch_deposit_serial_id where in the exchange table are we
     36  * @param total_amount value of all missing deposits, including fees
     37  * @param wire_target_h_payto hash of the recipient account's payto URI
     38  * @param deadline what was the earliest requested wire transfer deadline
     39  * @param suppressed true if this report was suppressed
     40  */
     41 #ifndef TALER_AUDITORDB_WIRE_MISSING_RESULT_CLOSURE
     42 /**
     43  * Type of the closure for #TALER_AUDITORDB_WireMissingCallback.
     44  */
     45 #define TALER_AUDITORDB_WIRE_MISSING_RESULT_CLOSURE void
     46 #endif
     47 typedef void
     48 (*TALER_AUDITORDB_WireMissingCallback) (
     49   TALER_AUDITORDB_WIRE_MISSING_RESULT_CLOSURE *cls,
     50   uint64_t row_id,
     51   uint64_t batch_deposit_serial_id,
     52   const struct TALER_Amount *total_amount,
     53   const struct TALER_FullPaytoHashP *wire_target_h_payto,
     54   struct GNUNET_TIME_Timestamp deadline,
     55   bool suppressed);
     56 
     57 
     58 /* Callback typedefs */
     59 /**
     60  * Function called on deposits that are past their due date
     61  * and have not yet seen a wire transfer.
     62  *
     63  * @param cls closure
     64  * @param row_id row ID of the alert in the auditor database
     65  * @param batch_deposit_serial_id where in the exchange table are we
     66  * @param total_amount value of all missing deposits, including fees
     67  * @param wire_target_h_payto hash of the recipient account's payto URI
     68  * @param deadline what was the earliest requested wire transfer deadline
     69  * @param suppressed true if this report was suppressed
     70  */
     71 typedef void
     72 (*TALER_AUDITORDB_WireMissingCallback) (
     73   TALER_AUDITORDB_WIRE_MISSING_RESULT_CLOSURE *cls,
     74   uint64_t row_id,
     75   uint64_t batch_deposit_serial_id,
     76   const struct TALER_Amount *total_amount,
     77   const struct TALER_FullPaytoHashP *wire_target_h_payto,
     78   struct GNUNET_TIME_Timestamp deadline,
     79   bool suppressed);
     80 
     81 /**
     82  * Return (batch) deposits for which we have not yet
     83  * seen the required wire transfer.
     84  *
     85  * @param pg the database context
     86  * @param deadline only return up to this deadline
     87  * @param limit number of rows to return, negative to iterate backwards
     88  * @param offset starting offset, exclusive
     89  * @param return_suppressed true to also return suppressed events
     90  * @param cb function to call on each entry
     91  * @param cb_cls closure for @a cb
     92  * @return transaction status code
     93  */
     94 enum GNUNET_DB_QueryStatus
     95 TALER_AUDITORDB_select_pending_deposits (struct
     96                                          TALER_AUDITORDB_PostgresContext *pg,
     97                                          struct GNUNET_TIME_Absolute deadline,
     98                                          int64_t limit,
     99                                          uint64_t offset,
    100                                          bool return_suppressed,
    101                                          TALER_AUDITORDB_WireMissingCallback cb,
    102                                          TALER_AUDITORDB_WIRE_MISSING_RESULT_CLOSURE
    103                                          *cb_cls);
    104 
    105 #endif