merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

get_fountain_withdraw.h (2686B)


      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/merchant-database/get_fountain_withdraw.h
     18  * @brief look up the signatures of a completed fountain withdrawal
     19  */
     20 #ifndef MERCHANT_DATABASE_GET_FOUNTAIN_WITHDRAW_H
     21 #define MERCHANT_DATABASE_GET_FOUNTAIN_WITHDRAW_H
     22 #include "merchantdb_lib.h"
     23 
     24 /**
     25  * Called once per stored signature, ordered by grant and then by
     26  * position within the grant, so the response can be rebuilt by
     27  * appending.
     28  *
     29  * @param cls closure
     30  * @param grant_index offset of the grant in the original request
     31  * @param token_family_slug token family the grant refers to
     32  * @param h_issue hash of the issue key the signature was made with
     33  * @param blind_sig the blind signature handed out originally
     34  */
     35 typedef void
     36 (*TALER_MERCHANTDB_FountainWithdrawSigCallback)(
     37   void *cls,
     38   uint32_t grant_index,
     39   const char *token_family_slug,
     40   const struct TALER_TokenIssuePublicKeyHashP *h_issue,
     41   const struct GNUNET_CRYPTO_BlindedSignature *blind_sig);
     42 
     43 /**
     44  * Lock the fountain and hand back the signatures of an earlier
     45  * withdrawal of the same request, if there was one.  Must run in a
     46  * READ COMMITTED transaction.  The lock is held until commit or
     47  * rollback; looking the signatures up after taking it is what makes a
     48  * concurrent withdrawal of the same request visible here instead of
     49  * being counted twice.
     50  *
     51  * @param pg database context with the instance selected
     52  * @param fountain_serial authenticated fountain
     53  * @param h_request hash of the request's grants array
     54  * @param[out] not_found true if the fountain was deleted
     55  * @param cb called for each stored signature, in response order
     56  * @param cb_cls closure for @a cb
     57  * @return database result code; no result if the request is new
     58  */
     59 enum GNUNET_DB_QueryStatus
     60 TALER_MERCHANTDB_get_fountain_withdraw (
     61   struct TALER_MERCHANTDB_PostgresContext *pg,
     62   uint64_t fountain_serial,
     63   const struct GNUNET_HashCode *h_request,
     64   bool *not_found,
     65   TALER_MERCHANTDB_FountainWithdrawSigCallback cb,
     66   void *cb_cls);
     67 
     68 #endif