exchange

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

get_aggregation_deferral_by_wtid.h (2334B)


      1 /*
      2    This file is part of TALER
      3    Copyright (C) 2026 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/get_aggregation_deferral_by_wtid.h
     18  * @brief implementation of the get_aggregation_deferral_by_wtid function for Postgres
     19  * @author Christian Grothoff
     20  */
     21 #ifndef EXCHANGE_DATABASE_GET_AGGREGATION_DEFERRAL_BY_WTID_H
     22 #define EXCHANGE_DATABASE_GET_AGGREGATION_DEFERRAL_BY_WTID_H
     23 
     24 #include "taler/taler_util.h"
     25 #include "exchangedb_lib.h"
     26 
     27 /**
     28  * Obtain the exchange's most recent statement of why it has not executed the
     29  * wire transfer @a wtid.  Used by the auditor, which reads this out of its
     30  * replica; `aggregation_deferrals` is append-only, so the row with the
     31  * greatest serial ID is the claim in force.
     32  *
     33  * Returns #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS if the exchange never said
     34  * anything about @a wtid, which for a transfer that is still pending means
     35  * the exchange is simply not paying.
     36  *
     37  * @param pg the database context
     38  * @param wtid wire transfer to look up
     39  * @param[out] amount set to the amount the exchange said it was withholding
     40  * @param[out] reason set to the reason the exchange gave
     41  * @param[out] kyc_requirement_row set to the legitimization measure the
     42  *        exchange named, or 0 if it named none
     43  * @param[out] deferral_time set to when the exchange made the decision
     44  * @return transaction status
     45  */
     46 enum GNUNET_DB_QueryStatus
     47 TALER_EXCHANGEDB_get_aggregation_deferral_by_wtid (
     48   struct TALER_EXCHANGEDB_PostgresContext *pg,
     49   const struct TALER_WireTransferIdentifierRawP *wtid,
     50   struct TALER_Amount *amount,
     51   enum TALER_EXCHANGEDB_DeferralReason *reason,
     52   uint64_t *kyc_requirement_row,
     53   struct GNUNET_TIME_Timestamp *deferral_time);
     54 
     55 #endif