aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-02-21 17:43:11 +0100
committerChristian Grothoff <christian@grothoff.org>2023-02-21 17:43:11 +0100
commit165c5337b1fc1df42521ab1cba520b7ddede6fdd (patch)
treec54051690eeef748157df657c6367e4bac5c5bf2 /src/include
parent7f4626d3c5ec3d4cafe6a8992741c085537a3037 (diff)
add algorithm identifier to client API
Diffstat (limited to 'src/include')
-rw-r--r--src/include/taler_merchant_service.h72
-rw-r--r--src/include/taler_merchantdb_plugin.h5
2 files changed, 64 insertions, 13 deletions
diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h
index 8237b47a..b748309e 100644
--- a/src/include/taler_merchant_service.h
+++ b/src/include/taler_merchant_service.h
@@ -4177,21 +4177,63 @@ struct TALER_MERCHANT_TemplateGetHandle;
/**
- * Function called with the result of the GET /templates operation.
+ * Details in a response to a GET /templates request.
+ */
+struct TALER_MERCHANT_TemplateGetResponse
+{
+ /**
+ * HTTP response details.
+ */
+ struct TALER_MERCHANT_HttpResponse hr;
+
+ /**
+ * Response details depending on the HTTP status.
+ */
+ union
+ {
+ /**
+ * Information returned if the status was #MHD_HTTP_OK.
+ */
+ struct
+ {
+
+ /**
+ * description of the template
+ */
+ const char *template_description;
+
+ /**
+ * Shared key with the POS
+ */
+ const char *pos_key;
+
+ /**
+ * Template for the contract.
+ */
+ const json_t *template_contract;
+
+ /**
+ * Algorithm used to generate confirmations for the merchant.
+ */
+ enum TALER_MerchantConfirmationAlgorithm mca;
+
+ } success;
+
+ } details;
+
+};
+
+
+/**
+ * Function called with the result of the GET /template/$ID operation.
*
* @param cls closure
- * @param hr HTTP response details
- * @param template_description description of the template
- * @param image base64-encoded product image
- * @param template_contract is the contract of the company
+ * @param tgr HTTP response details
*/
typedef void
(*TALER_MERCHANT_TemplateGetCallback)(
void *cls,
- const struct TALER_MERCHANT_HttpResponse *hr,
- const char *template_description,
- const char *image,
- const json_t *template_contract);
+ const struct TALER_MERCHANT_TemplateGetResponse *tgr);
/**
@@ -4249,7 +4291,8 @@ typedef void
* @param backend_url HTTP base URL for the backend
* @param template_id identifier to use for the template
* @param template_description description of the template
- * @param image base64-encoded product image
+ * @param pos_key shared key with the POS
+ * @param mca algorithm used to generate confirmations
* @param template_contract is the contract of the company
* @param cb function to call with the backend's result
* @param cb_cls closure for @a cb
@@ -4261,7 +4304,8 @@ TALER_MERCHANT_templates_post (
const char *backend_url,
const char *template_id,
const char *template_description,
- const char *image,
+ const char *pos_key,
+ enum TALER_MerchantConfirmationAlgorithm mca,
const json_t *template_contract,
TALER_MERCHANT_TemplatesPostCallback cb,
void *cb_cls);
@@ -4304,7 +4348,8 @@ typedef void
* or the transaction will fail with a #MHD_HTTP_NOT_FOUND
* HTTP status code
* @param template_description description of the template
- * @param image base64-encoded product image
+ * @param pos shared key with the POS
+ * @param mca algorithm used to generate confirmations
* @param template_contract is the contract of the company
* @param cb function to call with the backend's result
* @param cb_cls closure for @a cb
@@ -4316,7 +4361,8 @@ TALER_MERCHANT_template_patch (
const char *backend_url,
const char *template_id,
const char *template_description,
- const char *image,
+ const char *pos_key,
+ enum TALER_MerchantConfirmationAlgorithm mca,
json_t *template_contract,
TALER_MERCHANT_TemplatePatchCallback cb,
void *cb_cls);
diff --git a/src/include/taler_merchantdb_plugin.h b/src/include/taler_merchantdb_plugin.h
index 0cedf3ee..1ca27844 100644
--- a/src/include/taler_merchantdb_plugin.h
+++ b/src/include/taler_merchantdb_plugin.h
@@ -335,6 +335,11 @@ struct TALER_MERCHANTDB_TemplateDetails
* In this template contract, we can have additional information.
*/
json_t *template_contract;
+
+ /**
+ * Algorithm used to compute purchase confirmations.
+ */
+ enum TALER_MerchantConfirmationAlgorithm pos_algorithm;
};