exchange

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

get_transfer_by_deposit.h (3939B)


      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 src/include/exchange-database/get_transfer_by_deposit.h
     18  * @brief implementation of the get_transfer_by_deposit function for Postgres
     19  * @author Christian Grothoff
     20  */
     21 #ifndef EXCHANGE_DATABASE_GET_TRANSFER_BY_DEPOSIT_H
     22 #define EXCHANGE_DATABASE_GET_TRANSFER_BY_DEPOSIT_H
     23 
     24 #include "taler/taler_util.h"
     25 #include "taler/taler_json_lib.h"
     26 #include "exchangedb_lib.h"
     27 
     28 
     29 /**
     30  * Try to find the wire transfer details for a deposit operation.
     31  * If we did not execute the deposit yet, return when it is supposed
     32  * to be executed.
     33  *
     34  * Primary test table: `aggregation_tracking` (see test_aggregation_tracking.c).
     35  *
     36  * @param pg the database context
     37  * @param h_contract_terms hash of the proposal data
     38  * @param h_wire hash of merchant wire details
     39  * @param coin_pub public key of deposited coin
     40  * @param merchant_pub merchant public key
     41  * @param[out] pending set to true if the transaction is still pending
     42  * @param[out] wtid wire transfer identifier, only set if @a pending is false
     43  * @param[out] exec_time when was the transaction done, or
     44  *         when we expect it to be done (if @a pending is false)
     45  * @param[out] amount_with_fee set to the total deposited amount
     46  * @param[out] deposit_fee set to how much the exchange did charge for the deposit
     47  * @param[out] kyc set to the kyc status of the receiver (if @a pending)
     48  * @param[out] account_pub set to public key that is authorized to start the KYC process; unchanged if no such key is known
     49  * @return transaction status code
     50  */
     51 enum GNUNET_DB_QueryStatus
     52 TALER_EXCHANGEDB_get_transfer_by_deposit (struct
     53                                           TALER_EXCHANGEDB_PostgresContext *
     54                                           pg,
     55                                           const struct
     56                                           TALER_PrivateContractHashP *
     57                                           h_contract_terms,
     58                                           const struct
     59                                           TALER_MerchantWireHashP *
     60                                           h_wire,
     61                                           const struct
     62                                           TALER_CoinSpendPublicKeyP *
     63                                           coin_pub,
     64                                           const struct
     65                                           TALER_MerchantPublicKeyP *
     66                                           merchant_pub,
     67                                           bool *pending,
     68                                           struct
     69                                           TALER_WireTransferIdentifierRawP *
     70                                           wtid,
     71                                           struct GNUNET_TIME_Timestamp *
     72                                           exec_time,
     73                                           struct TALER_Amount *
     74                                           amount_with_fee,
     75                                           struct TALER_Amount *deposit_fee,
     76                                           struct TALER_EXCHANGEDB_KycStatus *
     77                                           kyc,
     78                                           union TALER_AccountPublicKeyP *
     79                                           account_pub);
     80 
     81 #endif