get_kyc_rules.h (3774B)
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 * Primary test table: `legitimization_outcomes` (see test_legitimization_outcomes.c). 32 * 33 * @param pg the database context 34 * @param h_payto account identifier 35 * @param merchant_pub merchant public key used by the client, or NULL 36 * if not available; if multiple @a reserve_pub values could be returned, 37 * we should use this one 38 * @param[out] no_account_pub set to true if no @a account_pub is available 39 * @param[out] account_pub set to account public key the rules 40 * apply to (because this key was used in KYC auth) 41 * @param[out] no_reserve_pub set to true if no @a reserve_pub is available 42 * @param[out] reserve_pub set to last incoming reserve public key 43 * of a wire transfer to the exchange from the given @a h_payto 44 * apply to (because this key was used in KYC auth) 45 * @param[out] jrules set to the active KYC rules for the 46 * given account, set to NULL if no custom rules are active 47 * @return transaction status code 48 */ 49 enum GNUNET_DB_QueryStatus 50 TALER_EXCHANGEDB_get_kyc_rules_with_account (struct 51 TALER_EXCHANGEDB_PostgresContext * 52 pg, 53 const struct 54 TALER_NormalizedPaytoHashP *h_payto 55 , 56 const struct 57 TALER_MerchantPublicKeyP * 58 merchant_pub, 59 bool *no_account_pub, 60 union TALER_AccountPublicKeyP * 61 account_pub, 62 bool *no_reserve_pub, 63 struct TALER_ReservePublicKeyP * 64 reserve_pub, 65 json_t **jrules); 66 67 68 /** 69 * Return only the KYC rules that apply to the given account. 70 * 71 * Primary test table: `legitimization_outcomes` (see test_legitimization_outcomes.c). 72 * 73 * @param pg the database context 74 * @param h_payto account identifier 75 * @param[out] jrules set to the active KYC rules for the 76 * given account, set to NULL if no custom rules are active 77 * @return transaction status code 78 */ 79 enum GNUNET_DB_QueryStatus 80 TALER_EXCHANGEDB_get_kyc_rules (struct TALER_EXCHANGEDB_PostgresContext * 81 pg, 82 const struct TALER_NormalizedPaytoHashP * 83 h_payto, 84 json_t **jrules); 85 86 #endif