get_kyc_rules.h (3226B)
1 /* 2 This file is part of TALER 3 Copyright (C) 2022-2024 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_kyc_rules.h 18 * @brief implementation of the get_kyc_rules function for Postgres 19 * @author Christian Grothoff 20 */ 21 #ifndef EXCHANGE_DATABASE_GET_KYC_RULES_H 22 #define EXCHANGE_DATABASE_GET_KYC_RULES_H 23 24 #include "taler/taler_util.h" 25 #include "exchangedb_lib.h" 26 27 28 /** 29 * Return KYC rules that apply to the given account. 30 * 31 * @param pg the database context 32 * @param h_payto account identifier 33 * @param merchant_pub merchant public key used by the client, or NULL 34 * if not available; if multiple @a reserve_pub values could be returned, 35 * we should use this one 36 * @param[out] no_account_pub set to true if no @a account_pub is available 37 * @param[out] account_pub set to account public key the rules 38 * apply to (because this key was used in KYC auth) 39 * @param[out] no_reserve_pub set to true if no @a reserve_pub is available 40 * @param[out] reserve_pub set to last incoming reserve public key 41 * of a wire transfer to the exchange from the given @a h_payto 42 * apply to (because this key was used in KYC auth) 43 * @param[out] jrules set to the active KYC rules for the 44 * given account, set to NULL if no custom rules are active 45 * @return transaction status code 46 */ 47 enum GNUNET_DB_QueryStatus 48 TALER_EXCHANGEDB_get_kyc_rules (struct TALER_EXCHANGEDB_PostgresContext *pg, 49 const struct TALER_NormalizedPaytoHashP *h_payto 50 , 51 const struct TALER_MerchantPublicKeyP * 52 merchant_pub, 53 bool *no_account_pub, 54 union TALER_AccountPublicKeyP *account_pub, 55 bool *no_reserve_pub, 56 struct TALER_ReservePublicKeyP *reserve_pub, 57 json_t **jrules); 58 59 60 /** 61 * Return only the KYC rules that apply to the given account. 62 * 63 * @param pg the database context 64 * @param h_payto account identifier 65 * @param[out] jrules set to the active KYC rules for the 66 * given account, set to NULL if no custom rules are active 67 * @return transaction status code 68 */ 69 enum GNUNET_DB_QueryStatus 70 TALER_TALER_EXCHANGEDB_get_kyc_rules2 (struct TALER_EXCHANGEDB_PostgresContext * 71 pg, 72 const struct TALER_NormalizedPaytoHashP * 73 h_payto, 74 json_t **jrules); 75 76 #endif