lookup_kyc_history.h (4117B)
1 /* 2 This file is part of TALER 3 Copyright (C) 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/lookup_kyc_history.h 18 * @brief implementation of the lookup_kyc_history function for Postgres 19 * @author Christian Grothoff 20 */ 21 #ifndef EXCHANGE_DATABASE_LOOKUP_KYC_HISTORY_H 22 #define EXCHANGE_DATABASE_LOOKUP_KYC_HISTORY_H 23 24 #include "taler/taler_util.h" 25 #include "taler/taler_json_lib.h" 26 #include "exchangedb_lib.h" 27 28 29 /** 30 * Function called with historic KYC events of an 31 * account. 32 * 33 * @param cls closure 34 * @param provider_name name of the KYC provider 35 * @param finished did the KYC process finish 36 * @param error_code error code from the KYC process 37 * @param error_message error message from the KYC process, 38 * or NULL for none 39 * @param provider_user_id user ID at the provider 40 * or NULL for none 41 * @param provider_legitimization_id legitimization process ID at the provider 42 * or NULL for none 43 * @param collection_time when was the data collected 44 * @param expiration_time when does the collected data expire 45 * @param encrypted_attributes_len number of bytes in @a encrypted_attributes 46 * @param encrypted_attributes encrypted KYC attributes 47 */ 48 typedef void 49 (*TALER_EXCHANGEDB_KycHistoryCallback) ( 50 void *cls, 51 const char *provider_name, 52 bool finished, 53 enum TALER_ErrorCode error_code, 54 const char *error_message, 55 const char *provider_user_id, 56 const char *provider_legitimization_id, 57 struct GNUNET_TIME_Timestamp collection_time, 58 struct GNUNET_TIME_Absolute expiration_time, 59 size_t encrypted_attributes_len, 60 const void *encrypted_attributes); 61 62 63 /* Callback typedefs */ 64 /** 65 * Function called with historic KYC events of an 66 * account. 67 * 68 * @param cls closure 69 * @param provider_name name of the KYC provider 70 * @param finished did the KYC process finish 71 * @param error_code error code from the KYC process 72 * @param error_message error message from the KYC process, 73 * or NULL for none 74 * @param provider_user_id user ID at the provider 75 * or NULL for none 76 * @param provider_legitimization_id legitimization process ID at the provider 77 * or NULL for none 78 * @param collection_time when was the data collected 79 * @param expiration_time when does the collected data expire 80 * @param encrypted_attributes_len number of bytes in @a encrypted_attributes 81 * @param encrypted_attributes encrypted KYC attributes 82 */ 83 typedef void 84 (*TALER_EXCHANGEDB_KycHistoryCallback) ( 85 void *cls, 86 const char *provider_name, 87 bool finished, 88 enum TALER_ErrorCode error_code, 89 const char *error_message, 90 const char *provider_user_id, 91 const char *provider_legitimization_id, 92 struct GNUNET_TIME_Timestamp collection_time, 93 struct GNUNET_TIME_Absolute expiration_time, 94 size_t encrypted_attributes_len, 95 const void *encrypted_attributes); 96 97 /** 98 * Lookup KYC history for an account identified via 99 * @a h_payto. 100 * 101 * @param pg the database context 102 * @param h_payto hash of account to lookup history for 103 * @param cb function to call on results 104 * @param cb_cls closure for @a cb 105 * @return database transaction status 106 */ 107 enum GNUNET_DB_QueryStatus 108 TALER_EXCHANGEDB_lookup_kyc_history (struct TALER_EXCHANGEDB_PostgresContext *pg 109 , 110 const struct TALER_NormalizedPaytoHashP * 111 h_payto, 112 TALER_EXCHANGEDB_KycHistoryCallback cb, 113 void *cb_cls); 114 115 #endif