From 0c959e75d109fc914ab8891518f7963ade74cff8 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 5 May 2016 22:57:55 +0200 Subject: working on #3641: more on /refund implementation --- src/include/taler_exchangedb_plugin.h | 42 ++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) (limited to 'src/include') diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h index 8e00be751..7dcdb698f 100644 --- a/src/include/taler_exchangedb_plugin.h +++ b/src/include/taler_exchangedb_plugin.h @@ -499,7 +499,12 @@ enum TALER_EXCHANGEDB_TransactionType /** * /refresh/melt operation. */ - TALER_EXCHANGEDB_TT_REFRESH_MELT = 1 + TALER_EXCHANGEDB_TT_REFRESH_MELT = 1, + + /** + * /refund operation. + */ + TALER_EXCHANGEDB_TT_REFUND = 2 }; @@ -536,6 +541,11 @@ struct TALER_EXCHANGEDB_TransactionList */ struct TALER_EXCHANGEDB_RefreshMelt *melt; + /** + * Details if transaction was a /refund operation. + */ + struct TALER_EXCHANGEDB_Refund *refund; + } details; }; @@ -953,6 +963,20 @@ struct TALER_EXCHANGEDB_Plugin const struct TALER_EXCHANGEDB_Deposit *deposit); + /** + * Insert information about refunded coin into the database. + * + * @param cls the @e cls of this struct with the plugin-specific state + * @param session connection to the database + * @param refund refund information to store + * @return #GNUNET_OK on success, #GNUNET_SYSERR on error + */ + int + (*insert_refund) (void *cls, + struct TALER_EXCHANGEDB_Session *session, + const struct TALER_EXCHANGEDB_Refund *refund); + + /** * Mark a deposit as tiny, thereby declaring that it cannot be * executed by itself and should no longer be returned by @@ -969,6 +993,22 @@ struct TALER_EXCHANGEDB_Plugin unsigned long long rowid); + /** + * Test if a deposit was marked as done, thereby declaring that it cannot be + * refunded anymore. + * + * @param cls the @e cls of this struct with the plugin-specific state + * @param session connection to the database + * @param deposit the deposit to check + * @return #GNUNET_YES if is is marked done done, #GNUNET_NO if not, + * #GNUNET_SYSERR on error (deposit unknown) + */ + int + (*test_deposit_done) (void *cls, + struct TALER_EXCHANGEDB_Session *session, + const struct TALER_EXCHANGEDB_Deposit *deposit); + + /** * Mark a deposit as done, thereby declaring that it cannot be * executed at all anymore, and should no longer be returned by -- cgit v1.2.3