lookup_transfer_by_deposit.h (3951B)
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/lookup_transfer_by_deposit.h 18 * @brief implementation of the lookup_transfer_by_deposit function for Postgres 19 * @author Christian Grothoff 20 */ 21 #ifndef EXCHANGE_DATABASE_LOOKUP_TRANSFER_BY_DEPOSIT_H 22 #define EXCHANGE_DATABASE_LOOKUP_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 * @param pg the database context 35 * @param h_contract_terms hash of the proposal data 36 * @param h_wire hash of merchant wire details 37 * @param coin_pub public key of deposited coin 38 * @param merchant_pub merchant public key 39 * @param[out] pending set to true if the transaction is still pending 40 * @param[out] wtid wire transfer identifier, only set if @a pending is false 41 * @param[out] exec_time when was the transaction done, or 42 * when we expect it to be done (if @a pending is false) 43 * @param[out] amount_with_fee set to the total deposited amount 44 * @param[out] deposit_fee set to how much the exchange did charge for the deposit 45 * @param[out] kyc set to the kyc status of the receiver (if @a pending) 46 * @param[out] account_pub set to public key that is authorized to start the KYC process; unchanged if no such key is known 47 * @return transaction status code 48 */ 49 enum GNUNET_DB_QueryStatus 50 TALER_EXCHANGEDB_lookup_transfer_by_deposit (struct 51 TALER_EXCHANGEDB_PostgresContext * 52 pg, 53 const struct 54 TALER_PrivateContractHashP * 55 h_contract_terms, 56 const struct 57 TALER_MerchantWireHashP * 58 h_wire, 59 const struct 60 TALER_CoinSpendPublicKeyP * 61 coin_pub, 62 const struct 63 TALER_MerchantPublicKeyP * 64 merchant_pub, 65 bool *pending, 66 struct 67 TALER_WireTransferIdentifierRawP * 68 wtid, 69 struct GNUNET_TIME_Timestamp * 70 exec_time, 71 struct TALER_Amount * 72 amount_with_fee, 73 struct TALER_Amount *deposit_fee, 74 struct TALER_EXCHANGEDB_KycStatus * 75 kyc, 76 union TALER_AccountPublicKeyP * 77 account_pub); 78 79 #endif