aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-05-13 13:27:40 +0200
committerChristian Grothoff <christian@grothoff.org>2024-05-13 13:27:40 +0200
commit0e0751a19096f2ab08e519c9d8735f14c658bbfb (patch)
tree08a85eaa2e7129e39e2ca58e98ee7d6abf4a76c5 /src/include
parenta97ee62dab172a39eab1bebdcd0d8512f5ce4dac (diff)
implement protocol spec v15
Diffstat (limited to 'src/include')
-rw-r--r--src/include/taler_merchant_service.h6
-rw-r--r--src/include/taler_merchantdb_plugin.h32
2 files changed, 35 insertions, 3 deletions
diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h
index 057c9eff..537a2485 100644
--- a/src/include/taler_merchant_service.h
+++ b/src/include/taler_merchant_service.h
@@ -1516,12 +1516,12 @@ struct TALER_MERCHANT_ProductGetResponse
struct TALER_Amount price;
/**
- * base64-encoded product image
+ * base64-encoded product image, can be NULL if none is set.
*/
const char *image;
/**
- * list of taxes paid by the merchant
+ * list of taxes paid by the merchant, can be NULL if no taxes were specified.
*/
const json_t *taxes;
@@ -1544,7 +1544,7 @@ struct TALER_MERCHANT_ProductGetResponse
uint64_t total_lost;
/**
- * where the product is in stock
+ * where the product is in stock, can be NULL if no location was given.
*/
const json_t *location;
diff --git a/src/include/taler_merchantdb_plugin.h b/src/include/taler_merchantdb_plugin.h
index 44fdc0ab..12b13e33 100644
--- a/src/include/taler_merchantdb_plugin.h
+++ b/src/include/taler_merchantdb_plugin.h
@@ -335,6 +335,22 @@ struct TALER_MERCHANTDB_ProductDetails
/**
+ * Typically called by `lookup_all_products`.
+ *
+ * @param cls a `json_t *` JSON array to build
+ * @param product_serial row ID of the product
+ * @param product_id ID of the product
+ * @param pd full product details
+ */
+typedef void
+(*TALER_MERCHANTDB_ProductCallback)(
+ void *cls,
+ uint64_t product_serial,
+ const char *product_id,
+ const struct TALER_MERCHANTDB_ProductDetails *pd);
+
+
+/**
* Typically called by `lookup_templates`.
*
* @param cls closure
@@ -1619,6 +1635,22 @@ struct TALER_MERCHANTDB_Plugin
TALER_MERCHANTDB_ProductsCallback cb,
void *cb_cls);
+
+ /**
+ * Lookup full details of all of the products the given instance has configured (expensive).
+ *
+ * @param cls closure
+ * @param instance_id instance to lookup products for
+ * @param cb function to call on all products found
+ * @param cb_cls closure for @a cb
+ * @return database result code
+ */
+ enum GNUNET_DB_QueryStatus
+ (*lookup_all_products)(void *cls,
+ const char *instance_id,
+ TALER_MERCHANTDB_ProductCallback cb,
+ void *cb_cls);
+
/**
* Lookup details about a particular product.
*