pg_lookup_order_charity.h (2345B)
1 /* 2 This file is part of TALER 3 Copyright (C) 2025 Taler Systems SA 4 5 TALER is free software; you can redistribute it and/or modify it 6 under the terms of the GNU General Public License as published by the 7 Free Software Foundation; either version 3, or (at your option) any 8 later version. 9 10 TALER is distributed in the hope that it will be useful, but WITHOUT 11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 12 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 13 License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with TALER; see the file COPYING. If not, see 17 <http://www.gnu.org/licenses/> 18 */ 19 /** 20 * @file backenddb/pg_lookup_order_charity.h 21 * @brief Header for retrieving Donau charity_id and corresponding private key 22 * by Donau URL. 23 * @author Bohdan Potuzhnyi 24 * @author Vlada Svirsh 25 */ 26 27 #ifndef PG_LOOKUP_ORDER_CHARITY_H 28 #define PG_LOOKUP_ORDER_CHARITY_H 29 30 #include "platform.h" 31 #include <taler/taler_error_codes.h> 32 #include <taler/taler_dbevents.h> 33 #include <taler/taler_pq_lib.h> 34 #include "donau/donau_service.h" 35 #include "pg_helper.h" 36 37 38 /** 39 * Retrieve the charity’s ID and private key for a given Donau URL. 40 * 41 * @param cls plugin closure (the Postgres DB handle / struct PostgresClosure *) 42 * @param instance_id the instance ID of the merchant 43 * @param donau_url base URL of the Donau instance 44 * @param[out] charity_id set to the `charity_id` from `merchant_donau_instances` 45 * @param[out] charity_priv set to the private key (32 bytes) 46 * @param[out] charity_max_per_year set to the maximum amount that can be donated 47 * per year to this charity 48 * @param[out] charity_receipts_to_date set to the total amount of receipts 49 * issued to date 50 * @param[out] donau_keys_json set to the JSON object containing the Donau keys 51 * @param[out] donau_instance_serial set to the serial number of the Donau instance in DB 52 */ 53 enum GNUNET_DB_QueryStatus 54 TMH_PG_lookup_order_charity ( 55 void *cls, 56 const char *instance_id, 57 const char *donau_url, 58 uint64_t *charity_id, 59 struct DONAU_CharityPrivateKeyP *charity_priv, 60 struct TALER_Amount *charity_max_per_year, 61 struct TALER_Amount *charity_receipts_to_date, 62 json_t **donau_keys_json, 63 uint64_t *donau_instance_serial); 64 65 #endif /* PG_LOOKUP_ORDER_CHARITY_H */