summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorJonathan Buchanan <jonathan.russ.buchanan@gmail.com>2020-06-08 18:28:36 -0400
committerJonathan Buchanan <jonathan.russ.buchanan@gmail.com>2020-06-08 18:28:36 -0400
commitcb8cb51cbda0eb3255754ea87c0098280a1b4286 (patch)
tree24c9ce292a540e36cd74329c160fe5eca329b2f5 /src/include
parentfcf60499c3ab3e23c458cecdf8f51dd7cf5e16d3 (diff)
downloadmerchant-cb8cb51cbda0eb3255754ea87c0098280a1b4286.tar.gz
merchant-cb8cb51cbda0eb3255754ea87c0098280a1b4286.tar.bz2
merchant-cb8cb51cbda0eb3255754ea87c0098280a1b4286.zip
headers and empty source files for GET /private/tips
Diffstat (limited to 'src/include')
-rw-r--r--src/include/taler_merchant_service.h93
1 files changed, 93 insertions, 0 deletions
diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h
index 19f059b6..4c0fa0c7 100644
--- a/src/include/taler_merchant_service.h
+++ b/src/include/taler_merchant_service.h
@@ -2820,6 +2820,99 @@ TALER_MERCHANT_tip_get_cancel (struct TALER_MERCHANT_TipGetHandle *tqh);
/**
+ * Handle for a GET /private/tips request.
+ */
+struct TALER_MERCHANT_TipsGetHandle;
+
+
+/**
+ * Database entry information of a tip.
+ */
+struct TALER_MERCHANT_TipEntry
+{
+ /**
+ * Row number of the tip in the database.
+ */
+ unsigned int row_id;
+
+
+ /**
+ * Identifier for the tip.
+ */
+ struct GNUNET_HashCode tip_id;
+
+ /**
+ * Total value of the tip (including fees).
+ */
+ struct TALER_Amount tip_amount;
+
+};
+
+
+/**
+ * Callback to process a GET /private/tips request.
+ *
+ * @param cls closure
+ * @param hr HTTP response details
+ * @param tips_length length of the @a tips array
+ * @param tips the array of tips, NULL on error
+ */
+typedef void
+(*TALER_MERCHANT_TipsGetCallback) (
+ void *cls,
+ const struct TALER_MERCHANT_HttpResponse *hr,
+ unsigned int tips_length,
+ const struct TALER_MERCHANT_TipEntry tips[]);
+
+
+/**
+ * Issue a GET /private/tips request to the backend.
+ *
+ * @param ctx execution context
+ * @param backend_url base URL of the merchant backend
+ * @param cb function to call with the result
+ * @param cb_cls closure for @a cb
+ * @return handle for this operation, NULL upon errors
+ */
+struct TALER_MERCHANT_TipsGetHandle *
+TALER_MERCHANT_tips_get (struct GNUNET_CURL_Context *ctx,
+ const char *backend_url,
+ TALER_MERCHANT_TipsGetCallback cb,
+ void *cb_cls);
+
+
+/**
+ * Issue a GET /private/tips request with filters to the backend.
+ *
+ * @param ctx execution context
+ * @param backend_url base URL of the merchant backend
+ * @param include_expired whether to return all tips or only unexpired tips
+ * @param limit number of results to return, negative for descending row id, positive for ascending
+ * @param offset row id to start returning results from
+ * @param cb function to call with the result
+ * @param cb_cls closure for @a cb
+ * @return handle for this operation, NULL upon errors
+ */
+struct TALER_MERCHANT_TipsGetHandle *
+TALER_MERCHANT_tips_get2 (struct GNUNET_CURL_Context *ctx,
+ const char *backend_url,
+ bool include_expired,
+ int limit,
+ unsigned int offset,
+ TALER_MERCHANT_TipsGetCallback cb,
+ void *cb_cls);
+
+
+/**
+ * Cancel a GET /private/tips request.
+ *
+ * @param
+ */
+void
+TALER_MERCHANT_tips_get_cancel (struct TALER_MERCHANT_TipsGetHandle *);
+
+
+/**
* Handle for a POST /tips/$TIP_ID/pickup operation.
*/
struct TALER_MERCHANT_TipPickupHandle;