aboutsummaryrefslogtreecommitdiff
path: root/src/include/taler_mintdb_plugin.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-09-19 20:02:21 +0200
committerChristian Grothoff <christian@grothoff.org>2015-09-19 20:02:21 +0200
commitf8a730a0ab6db9ca37c652493b844a7a5ff503e0 (patch)
treeffbe4ed079303081dfc5db2e43391fa8ee84a68b /src/include/taler_mintdb_plugin.h
parent37a84c5af7b466bef1d4ca4b18999e8b6ef590f2 (diff)
fixing #3816: adding 'id' field to uniquely identify each deposit
Diffstat (limited to 'src/include/taler_mintdb_plugin.h')
-rw-r--r--src/include/taler_mintdb_plugin.h52
1 files changed, 50 insertions, 2 deletions
diff --git a/src/include/taler_mintdb_plugin.h b/src/include/taler_mintdb_plugin.h
index 14518d284..4e06fc86f 100644
--- a/src/include/taler_mintdb_plugin.h
+++ b/src/include/taler_mintdb_plugin.h
@@ -517,6 +517,31 @@ struct TALER_MINTDB_Session;
/**
+ * Function called with details about deposits that
+ * have been made, with the goal of executing the
+ * corresponding wire transaction.
+ *
+ * @param cls closure
+ * @param id transaction ID (used as future `min_id` to avoid
+ * iterating over transactions more than once)
+ * @param amount_with_fee amount that was deposited including fee
+ * @param deposit_fee amount the mint gets to keep as transaction fees
+ * @param transaction_id unique transaction ID chosen by the merchant
+ * @param h_contract hash of the contract between merchant and customer
+ * @param wire wire details for the merchant
+ * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
+ */
+typedef int
+(*TALER_MINTDB_DepositIterator)(void *cls,
+ uint64_t id,
+ const struct TALER_Amount *amount_with_fee,
+ const struct TALER_Amount *deposit_fee,
+ uint64_t transaction_id,
+ const struct GNUNET_HashCode *h_contract,
+ const char *wire);
+
+
+/**
* Function called with the session hashes and transfer secret
* information for a given coin.
*
@@ -780,8 +805,7 @@ struct TALER_MINTDB_Plugin
/**
- * Insert information about deposited coin into the
- * database.
+ * Insert information about deposited coin into the database.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param sesssion connection to the database
@@ -795,6 +819,30 @@ struct TALER_MINTDB_Plugin
/**
+ * Obtain information about deposits. Iterates over all deposits
+ * above a certain ID. Use a @a min_id of 0 to start at the beginning.
+ * This operation is executed in its own transaction in transaction
+ * mode "READ COMMITTED", i.e. we should only see valid deposits.
+ *
+ * @param cls the @e cls of this struct with the plugin-specific state
+ * @param sesssion connection to the database
+ * @param min_id deposit to start at
+ * @param limit maximum number of transactions to fetch
+ * @param deposit_cb function to call for each deposit
+ * @param deposit_cb_cls closure for @a deposit_cb
+ * @return number of rows processed, 0 if none exist,
+ * #GNUNET_SYSERR on error
+ */
+ int
+ (*iterate_deposits) (void *cls,
+ struct TALER_MINTDB_Session *sesssion,
+ uint64_t min_id,
+ unsigned int limit,
+ TALER_MINTDB_DepositIterator deposit_cb,
+ void *deposit_cb_cls);
+
+
+ /**
* Lookup refresh session data under the given @a session_hash.
*
* @param cls the @e cls of this struct with the plugin-specific state