From eebc030f6cf61d36b80e3273709fd9f254b155c3 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 15 Oct 2022 10:43:26 +0200 Subject: add logic to return information about purse refunds in coin histories --- src/include/taler_exchangedb_plugin.h | 38 ++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'src/include/taler_exchangedb_plugin.h') diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h index 0df32241c..a12c2ac3f 100644 --- a/src/include/taler_exchangedb_plugin.h +++ b/src/include/taler_exchangedb_plugin.h @@ -1788,6 +1788,31 @@ struct TALER_EXCHANGEDB_PurseDepositListEntry }; +/** + * @brief Specification for a purse refund operation in a coin's transaction list. + */ +struct TALER_EXCHANGEDB_PurseRefundListEntry +{ + + /** + * Public key of the purse. + */ + struct TALER_PurseContractPublicKeyP purse_pub; + + /** + * Fraction of the original deposit's value to be refunded, including + * refund fee (if any). The coin is identified by @e coin_pub. + */ + struct TALER_Amount refund_amount; + + /** + * Refund fee to be covered by the customer. + */ + struct TALER_Amount refund_fee; + +}; + + /** * Information about a /reserves/$RID/open operation in a coin transaction history. */ @@ -1974,10 +1999,15 @@ enum TALER_EXCHANGEDB_TransactionType */ TALER_EXCHANGEDB_TT_PURSE_DEPOSIT = 6, + /** + * Purse deposit operation. + */ + TALER_EXCHANGEDB_TT_PURSE_REFUND = 7, + /** * Reserve open deposit operation. */ - TALER_EXCHANGEDB_TT_RESERVE_OPEN = 7 + TALER_EXCHANGEDB_TT_RESERVE_OPEN = 8 }; @@ -2053,6 +2083,12 @@ struct TALER_EXCHANGEDB_TransactionList */ struct TALER_EXCHANGEDB_PurseDepositListEntry *purse_deposit; + /** + * Coin was refunded upon purse expiration + * (#TALER_EXCHANGEDB_TT_PURSE_REFUND) + */ + struct TALER_EXCHANGEDB_PurseRefundListEntry *purse_refund; + /** * Coin was used to pay to open a reserve. * (#TALER_EXCHANGEDB_TT_RESERVE_OPEN) -- cgit v1.2.3