summaryrefslogtreecommitdiff
path: root/src/include/taler_merchantdb_plugin.h
diff options
context:
space:
mode:
authorJonathan Buchanan <jonathan.russ.buchanan@gmail.com>2020-06-09 19:49:10 -0400
committerJonathan Buchanan <jonathan.russ.buchanan@gmail.com>2020-06-09 19:49:10 -0400
commit7a9c8b206332c3500ffd733b79aa56b0ea01338a (patch)
treee0abca170eab3980d3beadc2892501c8c1242ca0 /src/include/taler_merchantdb_plugin.h
parent83bd17148ee72fd1110b192cbefee18b15a22f56 (diff)
downloadmerchant-7a9c8b206332c3500ffd733b79aa56b0ea01338a.tar.gz
merchant-7a9c8b206332c3500ffd733b79aa56b0ea01338a.tar.bz2
merchant-7a9c8b206332c3500ffd733b79aa56b0ea01338a.zip
created lookup_tips method for backenddb
Diffstat (limited to 'src/include/taler_merchantdb_plugin.h')
-rw-r--r--src/include/taler_merchantdb_plugin.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/include/taler_merchantdb_plugin.h b/src/include/taler_merchantdb_plugin.h
index 6f3db87c..29550c4b 100644
--- a/src/include/taler_merchantdb_plugin.h
+++ b/src/include/taler_merchantdb_plugin.h
@@ -581,6 +581,21 @@ typedef void
/**
+ * Typically called by `lookup_tips`.
+ *
+ * @param cls closure
+ * @param row_id row of the tip in the database
+ * @param tip_id id of the tip
+ * @param amount amount of the tip
+ */
+typedef void
+(*TALER_MERCHANTDB_TipsCallback)(void *cls,
+ uint64_t row_id,
+ struct GNUNET_HashCode tip_id,
+ struct TALER_Amount amount);
+
+
+/**
* Function called with information about a coin that was deposited.
*
* @param cls closure
@@ -1848,6 +1863,29 @@ struct TALER_MERCHANTDB_Plugin
/**
+ * Lookup tips
+ *
+ * @param cls closure, typically a connection to the db
+ * @param instance_id which instance should we lookup tips for
+ * @param expired should we include expired tips?
+ * @param limit maximum number of results to return, positive for
+ * ascending row id, negative for descending
+ * @param offset row id to start returning results from
+ * @param cb function to call with tip data
+ * @param cb_cls closure for @a cb
+ * @return transaction status
+ */
+ enum GNUNET_DB_QueryStatus
+ (*lookup_tips)(void *cls,
+ const char *instance_id,
+ enum TALER_MERCHANTDB_YesNoAll expired,
+ int64_t limit,
+ uint64_t offset,
+ TALER_MERCHANTDB_TipsCallback cb,
+ void *cb_cls);
+
+
+ /**
* Lookup tip details for tip @a tip_id.
*
* @param cls closure, typically a connection to the db