fakebank_common_transact.h (2551B)
1 /* 2 This file is part of TALER 3 (C) 2016-2023 Taler Systems SA 4 5 TALER is free software; you can redistribute it and/or 6 modify it under the terms of the GNU General Public License 7 as published by the Free Software Foundation; either version 3, 8 or (at your option) any later version. 9 10 TALER is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public 16 License along with TALER; see the file COPYING. If not, 17 see <http://www.gnu.org/licenses/> 18 */ 19 /** 20 * @file bank-lib/fakebank_common_transact.h 21 * @brief actual transaction logic for FAKEBANK 22 * @author Christian Grothoff <christian@grothoff.org> 23 */ 24 #ifndef FAKEBANK_COMMON_TRANSACT_H 25 #define FAKEBANK_COMMON_TRANSACT_H 26 27 #include "taler/taler_fakebank_lib.h" 28 #include "taler/taler_bank_service.h" 29 #include "taler/taler_mhd_lib.h" 30 #include <gnunet/gnunet_mhd_compat.h> 31 #include "fakebank.h" 32 33 34 /** 35 * Add transaction to the debit and credit accounts, 36 * updating the balances as needed. 37 * 38 * The transaction @a t must already be locked 39 * when calling this function! 40 * 41 * @param[in,out] h bank handle 42 * @param[in,out] t transaction to add to account lists 43 */ 44 void 45 TALER_FAKEBANK_transact_ (struct TALER_FAKEBANK_Handle *h, 46 struct Transaction *t); 47 48 49 /** 50 * Tell the fakebank to create another wire transfer *from* an exchange. 51 * 52 * @param h fake bank handle 53 * @param debit_account account to debit 54 * @param credit_account account to credit 55 * @param amount amount to transfer 56 * @param subject wire transfer subject to use 57 * @param exchange_base_url exchange URL 58 * @param request_uid unique number to make the request unique, or NULL to create one 59 * @param[out] ret_row_id pointer to store the row ID of this transaction 60 * @param[out] timestamp set to the time of the transfer 61 * @return #GNUNET_YES if the transfer was successful, 62 * #GNUNET_SYSERR if the request_uid was reused for a different transfer 63 */ 64 enum GNUNET_GenericReturnValue 65 TALER_FAKEBANK_make_transfer_ ( 66 struct TALER_FAKEBANK_Handle *h, 67 const char *debit_account, 68 const char *credit_account, 69 const struct TALER_Amount *amount, 70 const struct TALER_WireTransferIdentifierRawP *subject, 71 const char *exchange_base_url, 72 const struct GNUNET_HashCode *request_uid, 73 uint64_t *ret_row_id, 74 struct GNUNET_TIME_Timestamp *timestamp); 75 76 #endif