gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-merchant] branch master updated (361833d6 -> 09e5b8f5)


From: gnunet
Subject: [taler-merchant] branch master updated (361833d6 -> 09e5b8f5)
Date: Fri, 02 Dec 2022 16:49:07 +0100

This is an automated email from the git hooks/post-receive script.

priscilla-huang pushed a change to branch master
in repository merchant.

    from 361833d6 fix #7499
     new 3be8637b update
     new 09e5b8f5 webhook

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/include/taler_merchant_service.h               | 295 ++++++++++++++++++++-
 ...te_template.c => merchant_api_delete_webhook.c} |  72 ++---
 src/lib/merchant_api_get_templates.c               |   4 +-
 ...i_get_template.c => merchant_api_get_webhook.c} | 112 ++++----
 ..._get_products.c => merchant_api_get_webhooks.c} | 112 ++++----
 ...tch_template.c => merchant_api_patch_webhook.c} | 112 ++++----
 src/lib/merchant_api_post_templates.c              |   2 +-
 ...st_templates.c => merchant_api_post_webhooks.c} | 114 ++++----
 8 files changed, 566 insertions(+), 257 deletions(-)
 copy src/lib/{merchant_api_delete_template.c => merchant_api_delete_webhook.c} 
(72%)
 copy src/lib/{merchant_api_get_template.c => merchant_api_get_webhook.c} (62%)
 copy src/lib/{merchant_api_get_products.c => merchant_api_get_webhooks.c} (66%)
 copy src/lib/{merchant_api_patch_template.c => merchant_api_patch_webhook.c} 
(68%)
 copy src/lib/{merchant_api_post_templates.c => merchant_api_post_webhooks.c} 
(66%)

diff --git a/src/include/taler_merchant_service.h 
b/src/include/taler_merchant_service.h
index ea9c8464..f7e9ebd9 100644
--- a/src/include/taler_merchant_service.h
+++ b/src/include/taler_merchant_service.h
@@ -4310,7 +4310,7 @@ TALER_MERCHANT_template_patch (
   const char *template_description,
   const char *image,
   const json_t *template_contract,
-  TALER_MERCHANT_ProductPatchCallback cb,
+  TALER_MERCHANT_TemplatePatchCallback cb,
   void *cb_cls);
 
 
@@ -4343,7 +4343,7 @@ typedef void
 
 
 /**
- * Make a DELETE /template/$ID request to delete a product.
+ * Make a DELETE /template/$ID request to delete a template.
  *
  * @param ctx the context
  * @param backend_url HTTP base URL for the backend
@@ -4364,11 +4364,300 @@ TALER_MERCHANT_template_delete (
 /**
  * Cancel DELETE /template/$ID operation.
  *
- * @param pdh operation to cancel
+ * @param tdh operation to cancel
  */
 void
 TALER_MERCHANT_template_delete_cancel (
   struct TALER_MERCHANT_TemplateDeleteHandle *tdh);
 
 
+/* ********************* /webhooks *********************** */
+
+
+/**
+ * Handle for a GET /webhooks operation.
+ */
+struct TALER_MERCHANT_WebhooksGetHandle;
+
+/**
+ * Individual webhook (minimal information
+ * returned via GET /webhooks).
+ */
+struct TALER_MERCHANT_WebhookEntry
+{
+  /**
+   * webhook identifier.
+   */
+  const char *webhook_id;
+
+};
+
+
+/**
+ * Function called with the result of the GET /webhooks operation.
+ *
+ * @param cls closure
+ * @param hr HTTP response details
+ * @param webhooks_length length of the @a webhooks array
+ * @param webhooks array of webhooks the requested instance offers
+ */
+typedef void
+(*TALER_MERCHANT_WebhooksGetCallback)(
+  void *cls,
+  const struct TALER_MERCHANT_HttpResponse *hr,
+  unsigned int webhooks_length,
+  const struct TALER_MERCHANT_WebhookEntry webhooks[]);
+
+
+/**
+ * Make a GET /webhooks request.
+ *
+ * @param ctx the context
+ * @param backend_url HTTP base URL for the backend
+ * @param cb function to call with the backend information
+ * @param cb_cls closure for @a cb
+ * @return the request handle; NULL upon error
+ */
+struct TALER_MERCHANT_WebhooksGetHandle *
+TALER_MERCHANT_webhooks_get (
+  struct GNUNET_CURL_Context *ctx,
+  const char *backend_url,
+  TALER_MERCHANT_WebhooksGetCallback cb,
+  void *cb_cls);
+
+
+/**
+ * Cancel GET /webhooks operation.
+ *
+ * @param tgh operation to cancel
+ */
+void
+TALER_MERCHANT_webhooks_get_cancel (
+  struct TALER_MERCHANT_WebhooksGetHandle *tgh);
+
+
+/**
+ * Handle for a GET /webhook/$ID operation. Gets details
+ * about a single webhook. Do not confused with a
+ * `struct TALER_MERCHANT_WebhooksGetHandle`, which
+ * obtains a list of all webhooks.
+ */
+struct TALER_MERCHANT_WebhookGetHandle;
+
+
+/**
+ * Function called with the result of the GET /webhooks operation.
+ *
+ * @param cls closure
+ * @param hr HTTP response details
+ * @param event_type event of the webhook
+ * @param url url use by ther customer
+ * @param http_method use by the merchant
+ * @param header_template header of the webhook
+ * @param body_template body of the webhook
+ */
+typedef void
+(*TALER_MERCHANT_WebhookGetCallback)(
+  void *cls,
+  const struct TALER_MERCHANT_HttpResponse *hr,
+  const char *event_type,
+  const char *url,
+  const char *http_method,
+  const char *header_template,
+  const char *body_template);
+
+
+/**
+ * Make a GET /webhook/$ID request to get details about an
+ * individual webhook.
+ *
+ * @param ctx the context
+ * @param backend_url HTTP base URL for the backend
+ * @param webhook_id identifier of the webhook to inquire about
+ * @param cb function to call with the backend's webhook information
+ * @param cb_cls closure for @a cb
+ * @return the request handle; NULL upon error
+ */
+struct TALER_MERCHANT_WebhookGetHandle *
+TALER_MERCHANT_webhook_get (
+  struct GNUNET_CURL_Context *ctx,
+  const char *backend_url,
+  const char *webhook_id,
+  TALER_MERCHANT_WebhookGetCallback cb,
+  void *cb_cls);
+
+
+/**
+ * Cancel GET /webhooks/$ID operation.
+ *
+ * @param tgh operation to cancel
+ */
+void
+TALER_MERCHANT_webhook_get_cancel (
+  struct TALER_MERCHANT_WebhookGetHandle *tgh);
+
+
+/**
+ * Handle for a POST /webhooks operation.
+ */
+struct TALER_MERCHANT_WebhooksPostHandle;
+
+
+/**
+ * Function called with the result of the POST /webhooks operation.
+ *
+ * @param cls closure
+ * @param hr HTTP response details
+ */
+typedef void
+(*TALER_MERCHANT_WebhooksPostCallback)(
+  void *cls,
+  const struct TALER_MERCHANT_HttpResponse *hr);
+
+
+/**
+ * Make a POST /webhooks request to add a webhook
+ *
+ * @param ctx the context
+ * @param backend_url HTTP base URL for the backend
+ * @param webhook_id identifier to use for the webhook
+ * @param event_type event of the webhook
+ * @param url url use by the customer
+ * @param http_method http method use by the merchant
+ * @param header_template header of the webhook
+ * @param body_template body of the webhook
+ * @param cb function to call with the backend's result
+ * @param cb_cls closure for @a cb
+ * @return the request handle; NULL upon error
+ */
+struct TALER_MERCHANT_TemplatesPostHandle *
+TALER_MERCHANT_templates_post (
+  struct GNUNET_CURL_Context *ctx,
+  const char *backend_url,
+  const char *webhook_id,
+  const char *event_type,
+  const char *url,
+  const char *http_method,
+  const char *header_template,
+  const char *body_template,
+  TALER_MERCHANT_WebhooksPostCallback cb,
+  void *cb_cls);
+
+
+/**
+ * Cancel POST /webhooks operation.
+ *
+ * @param wph operation to cancel
+ */
+void
+TALER_MERCHANT_webhooks_post_cancel (
+  struct TALER_MERCHANT_WebhooksPostHandle *wph);
+
+
+/**
+ * Handle for a PATCH /webhook operation.
+ */
+struct TALER_MERCHANT_WebhookPatchHandle;
+
+
+/**
+ * Function called with the result of the PATCH /webhook operation.
+ *
+ * @param cls closure
+ * @param hr HTTP response details
+ */
+typedef void
+(*TALER_MERCHANT_webhookPatchCallback)(
+  void *cls,
+  const struct TALER_MERCHANT_HttpResponse *hr);
+
+
+/**
+ * Make a PATCH /webhook request to update webhook details
+ *
+ * @param ctx the context
+ * @param backend_url HTTP base URL for the backend
+ * @param webhook_id identifier to use for the webhook; the webhook must exist,
+ *                    or the transaction will fail with a #MHD_HTTP_NOT_FOUND
+ *                    HTTP status code
+ * @param event_type event of the webhook
+ * @param url url use by the customer
+ * @param http_method http method use by the merchant
+ * @param header_template header of the webhook
+ * @param body_template body of the webhook
+ * @param cb function to call with the backend's result
+ * @param cb_cls closure for @a cb
+ * @return the request handle; NULL upon error
+ */
+struct TALER_MERCHANT_WebhookPatchHandle *
+TALER_MERCHANT_webhook_patch (
+  struct GNUNET_CURL_Context *ctx,
+  const char *backend_url,
+  const char *webhook_id,
+  const char *event_type,
+  const char *url,
+  const char *http_method,
+  const char *header_template,
+  const char *body_template,
+  TALER_MERCHANT_WebhookPatchCallback cb,
+  void *cb_cls);
+
+
+/**
+ * Cancel PATCH /webhook operation.
+ *
+ * @param wph operation to cancel
+ */
+void
+TALER_MERCHANT_webhook_patch_cancel (
+  struct TALER_MERCHANT_WebhookPatchHandle *wph);
+
+
+/**
+ * Handle for a DELETE /webhook$ID operation.
+ */
+struct TALER_MERCHANT_WebhookDeleteHandle;
+
+
+/**
+ * Function called with the result of the DELETE /webhook/$ID operation.
+ *
+ * @param cls closure
+ * @param hr HTTP response details
+ */
+typedef void
+(*TALER_MERCHANT_WebhookDeleteCallback)(
+  void *cls,
+  const struct TALER_MERCHANT_HttpResponse *hr);
+
+
+/**
+ * Make a DELETE /webhook/$ID request to delete a webhook.
+ *
+ * @param ctx the context
+ * @param backend_url HTTP base URL for the backend
+ * @param webhook_id identifier of the webhook
+ * @param cb function to call with the backend's deletion status
+ * @param cb_cls closure for @a cb
+ * @return the request handle; NULL upon error
+ */
+struct TALER_MERCHANT_WebhookDeleteHandle *
+TALER_MERCHANT_webhook_delete (
+  struct GNUNET_CURL_Context *ctx,
+  const char *backend_url,
+  const char *webhok_id,
+  TALER_MERCHANT_WebhookDeleteCallback cb,
+  void *cb_cls);
+
+
+/**
+ * Cancel DELETE /webhook/$ID operation.
+ *
+ * @param wdh operation to cancel
+ */
+void
+TALER_MERCHANT_template_webhook_cancel (
+  struct TALER_MERCHANT_WebhookDeleteHandle *wdh);
+
+
 #endif  /* _TALER_MERCHANT_SERVICE_H */
diff --git a/src/lib/merchant_api_delete_template.c 
b/src/lib/merchant_api_delete_webhook.c
similarity index 72%
copy from src/lib/merchant_api_delete_template.c
copy to src/lib/merchant_api_delete_webhook.c
index cf49eb4b..3825bc45 100644
--- a/src/lib/merchant_api_delete_template.c
+++ b/src/lib/merchant_api_delete_webhook.c
@@ -16,7 +16,7 @@
 */
 /**
  * @file merchant_api_delete_template.c
- * @brief Implementation of the DELETE /templates/$ID request of the 
merchant's HTTP API
+ * @brief Implementation of the DELETE /webhooks/$ID request of the merchant's 
HTTP API
  * @author Priscilla HUANG
  */
 #include "platform.h"
@@ -32,9 +32,9 @@
 
 
 /**
- * Handle for a DELETE /templates/$ID operation.
+ * Handle for a DELETE /webhooks/$ID operation.
  */
-struct TALER_MERCHANT_TemplateDeleteHandle
+struct TALER_MERCHANT_WebhookDeleteHandle
 {
   /**
    * The url for this request.
@@ -49,7 +49,7 @@ struct TALER_MERCHANT_TemplateDeleteHandle
   /**
    * Function to call with the result.
    */
-  TALER_MERCHANT_TemplateDeleteCallback cb;
+  TALER_MERCHANT_WebhookDeleteCallback cb;
 
   /**
    * Closure for @a cb.
@@ -66,18 +66,18 @@ struct TALER_MERCHANT_TemplateDeleteHandle
 
 /**
  * Function called when we're done processing the
- * HTTP GET /templates/$ID request.
+ * HTTP GET /webhooks/$ID request.
  *
- * @param cls the `struct TALER_MERCHANT_TemplateDeleteHandle`
+ * @param cls the `struct TALER_MERCHANT_WebhookDeleteHandle`
  * @param response_code HTTP response code, 0 on error
  * @param response response body, NULL if not in JSON
  */
 static void
-handle_delete_template_finished (void *cls,
+handle_delete_webhook_finished (void *cls,
                                 long response_code,
                                 const void *response)
 {
-  struct TALER_MERCHANT_TemplateDeleteHandle *tdh = cls;
+  struct TALER_MERCHANT_WebhookDeleteHandle *wdh = cls;
   const json_t *json = response;
   struct TALER_MERCHANT_HttpResponse hr = {
     .http_status = (unsigned int) response_code,
@@ -86,7 +86,7 @@ handle_delete_template_finished (void *cls,
 
   tdh->job = NULL;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Got /templates/$ID response with status code %u\n",
+              "Got /webhooks/$ID response with status code %u\n",
               (unsigned int) response_code);
   switch (response_code)
   {
@@ -115,70 +115,70 @@ handle_delete_template_finished (void *cls,
                 (int) hr.ec);
     break;
   }
-  tdh->cb (tdh->cb_cls,
+  wdh->cb (wdh->cb_cls,
            &hr);
-  TALER_MERCHANT_template_delete_cancel (tdh);
+  TALER_MERCHANT_webhook_delete_cancel (tdh);
 }
 
 
-struct TALER_MERCHANT_TemplateDeleteHandle *
-TALER_MERCHANT_template_delete (
+struct TALER_MERCHANT_WebhookDeleteHandle *
+TALER_MERCHANT_webhook_delete (
   struct GNUNET_CURL_Context *ctx,
   const char *backend_url,
-  const char *template_id,
-  TALER_MERCHANT_TemplateDeleteCallback cb,
+  const char *webhook_id,
+  TALER_MERCHANT_WebhookDeleteCallback cb,
   void *cb_cls)
 {
-  struct TALER_MERCHANT_TemplateDeleteHandle *tdh;
+  struct TALER_MERCHANT_WebhookDeleteHandle *wdh;
 
-  tdh = GNUNET_new (struct TALER_MERCHANT_TemplateDeleteHandle);
-  tdh->ctx = ctx;
-  tdh->cb = cb;
-  tdh->cb_cls = cb_cls;
+  wdh = GNUNET_new (struct TALER_MERCHANT_WebhookDeleteHandle);
+  wdh->ctx = ctx;
+  wdh->cb = cb;
+  wdh->cb_cls = cb_cls;
   {
     char *path;
 
     GNUNET_asprintf (&path,
-                     "private/templates/%s",
-                     template_id);
-    tdh->url = TALER_url_join (backend_url,
+                     "private/webhooks/%s",
+                     webhook_id);
+    wdh->url = TALER_url_join (backend_url,
                                path,
                                NULL);
     GNUNET_free (path);
   }
-  if (NULL == tdh->url)
+  if (NULL == wdh->url)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 "Could not construct request URL.\n");
-    GNUNET_free (tdh);
+    GNUNET_free (wdh);
     return NULL;
   }
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Requesting URL '%s'\n",
-              tdh->url);
+              wdh->url);
   {
     CURL *eh;
 
-    eh = TALER_MERCHANT_curl_easy_get_ (tdh->url);
+    eh = TALER_MERCHANT_curl_easy_get_ (wdh->url);
     GNUNET_assert (CURLE_OK ==
                    curl_easy_setopt (eh,
                                      CURLOPT_CUSTOMREQUEST,
                                      MHD_HTTP_METHOD_DELETE));
-    tdh->job = GNUNET_CURL_job_add (ctx,
+    wdh->job = GNUNET_CURL_job_add (ctx,
                                     eh,
                                     &handle_delete_template_finished,
-                                    tdh);
+                                    wdh);
   }
-  return tdh;
+  return wdh;
 }
 
 
 void
-TALER_MERCHANT_template_delete_cancel (
-  struct TALER_MERCHANT_TemplateDeleteHandle *tdh)
+TALER_MERCHANT_webhook_delete_cancel (
+  struct TALER_MERCHANT_WebhookDeleteHandle *wdh)
 {
-  if (NULL != tdh->job)
-    GNUNET_CURL_job_cancel (tdh->job);
-  GNUNET_free (tdh->url);
-  GNUNET_free (tdh);
+  if (NULL != wdh->job)
+    GNUNET_CURL_job_cancel (wdh->job);
+  GNUNET_free (wdh->url);
+  GNUNET_free (wdh);
 }
diff --git a/src/lib/merchant_api_get_templates.c 
b/src/lib/merchant_api_get_templates.c
index 5f74e7de..2dca928f 100644
--- a/src/lib/merchant_api_get_templates.c
+++ b/src/lib/merchant_api_get_templates.c
@@ -32,7 +32,7 @@
 
 
 /**
- * Handle for a GET /products operation.
+ * Handle for a GET /templates operation.
  */
 struct TALER_MERCHANT_TemplatesGetHandle
 {
@@ -68,7 +68,7 @@ struct TALER_MERCHANT_TemplatesGetHandle
  * Parse template information from @a ia.
  *
  * @param ia JSON array (or NULL!) with template data
- * @param pgh operation handle
+ * @param wgh operation handle
  * @return #GNUNET_OK on success
  */
 static int
diff --git a/src/lib/merchant_api_get_template.c 
b/src/lib/merchant_api_get_webhook.c
similarity index 62%
copy from src/lib/merchant_api_get_template.c
copy to src/lib/merchant_api_get_webhook.c
index 23c35d8b..3d8dfc57 100644
--- a/src/lib/merchant_api_get_template.c
+++ b/src/lib/merchant_api_get_webhook.c
@@ -15,8 +15,8 @@
   <http://www.gnu.org/licenses/>
 */
 /**
- * @file merchant_api_get_template.c
- * @brief Implementation of the GET /templates/$ID request of the merchant's 
HTTP API
+ * @file merchant_api_get_webhook.c
+ * @brief Implementation of the GET /webhooks/$ID request of the merchant's 
HTTP API
  * @author Priscilla HUANG
  */
 #include "platform.h"
@@ -32,9 +32,9 @@
 
 
 /**
- * Handle for a GET /templates/$ID operation.
+ * Handle for a GET /webhooks/$ID operation.
  */
-struct TALER_MERCHANT_TemplateGetHandle
+struct TALER_MERCHANT_WebhookGetHandle
 {
   /**
    * The url for this request.
@@ -49,7 +49,7 @@ struct TALER_MERCHANT_TemplateGetHandle
   /**
    * Function to call with the result.
    */
-  TALER_MERCHANT_TemplateGetCallback cb;
+  TALER_MERCHANT_WebhookGetCallback cb;
 
   /**
    * Closure for @a cb.
@@ -66,43 +66,49 @@ struct TALER_MERCHANT_TemplateGetHandle
 
 /**
  * Function called when we're done processing the
- * HTTP GET /templates/$ID request.
+ * HTTP GET /webhooks/$ID request.
  *
- * @param cls the `struct TALER_MERCHANT_TemplateGetHandle`
+ * @param cls the `struct TALER_MERCHANT_WebhookGetHandle`
  * @param response_code HTTP response code, 0 on error
  * @param response response body, NULL if not in JSON
  */
 static void
-handle_get_template_finished (void *cls,
+handle_get_webhook_finished (void *cls,
                              long response_code,
                              const void *response)
 {
-  struct TALER_MERCHANT_TemplateGetHandle *tgh = cls;
+  struct TALER_MERCHANT_WebhookGetHandle *wgh = cls;
   const json_t *json = response;
   struct TALER_MERCHANT_HttpResponse hr = {
     .http_status = (unsigned int) response_code,
     .reply = json
   };
 
-  tgh->job = NULL;
+  wgh->job = NULL;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Got /templates/$ID response with status code %u\n",
+              "Got /webhooks/$ID response with status code %u\n",
               (unsigned int) response_code);
   switch (response_code)
   {
   case MHD_HTTP_OK:
     {
-      const char *template_description;
-      const char *image;
-      json_t *template_contract;
+      const char *event_type;
+      const char *url;
+      const char *http_method;
+      const char *header_template;
+      const char *body_template;
       bool rst_ok = true;
       struct GNUNET_JSON_Specification spec[] = {
-        GNUNET_JSON_spec_string ("template_description",
-                                 &template_description),
-        GNUNET_JSON_spec_string ("image",
-                                 &image),
-        GNUNET_JSON_spec_json ("template_contract",
-                               &template_contract),
+        GNUNET_JSON_spec_string ("event_type",
+                                 &event_type),
+        GNUNET_JSON_spec_string ("url",
+                                 &url),
+        GNUNET_JSON_spec_string ("http_method",
+                                 &http_method),
+        GNUNET_JSON_spec_string ("header_template",
+                                 &header_template),
+        GNUNET_JSON_spec_string ("body_template",
+                                 &body_template),
         GNUNET_JSON_spec_end ()
       };
 
@@ -113,13 +119,15 @@ handle_get_template_finished (void *cls,
                                spec,
                                NULL, NULL)) )
       {
-        tgh->cb (tgh->cb_cls,
+        wgh->cb (wgh->cb_cls,
                  &hr,
-                 template_description,
-                 image,
-                 template_contract);
+                 event_type,
+                 url,
+                 http_method,
+                 header_template,
+                 body_template);
         GNUNET_JSON_parse_free (spec);
-        TALER_MERCHANT_template_get_cancel (tgh);
+        TALER_MERCHANT_webhook_get_cancel (wgh);
         return;
       }
       hr.http_status = 0;
@@ -146,66 +154,66 @@ handle_get_template_finished (void *cls,
                 (int) hr.ec);
     break;
   }
-  tgh->cb (tgh->cb_cls,
+  wgh->cb (wgh->cb_cls,
            &hr,
            NULL,
            NULL,
            NULL);
-  TALER_MERCHANT_template_get_cancel (tgh);
+  TALER_MERCHANT_webhook_get_cancel (wgh);
 }
 
 
-struct TALER_MERCHANT_TemplateGetHandle *
-TALER_MERCHANT_template_get (
+struct TALER_MERCHANT_WebhookGetHandle *
+TALER_MERCHANT_webhook_get (
   struct GNUNET_CURL_Context *ctx,
   const char *backend_url,
-  const char *template_id,
-  TALER_MERCHANT_TemplateGetCallback cb,
+  const char *webhook_id,
+  TALER_MERCHANT_WebhookGetCallback cb,
   void *cb_cls)
 {
-  struct TALER_MERCHANT_TemplateGetHandle *tgh;
+  struct TALER_MERCHANT_WebhookGetHandle *wgh;
   CURL *eh;
 
-  tgh = GNUNET_new (struct TALER_MERCHANT_TemplateGetHandle);
-  tgh->ctx = ctx;
-  tgh->cb = cb;
-  tgh->cb_cls = cb_cls;
+  wgh = GNUNET_new (struct TALER_MERCHANT_WebhookGetHandle);
+  wgh->ctx = ctx;
+  wgh->cb = cb;
+  wgh->cb_cls = cb_cls;
   {
     char *path;
 
     GNUNET_asprintf (&path,
-                     "private/templates/%s",
+                     "private/webhooks/%s",
                      template_id);
-    tgh->url = TALER_url_join (backend_url,
+    wgh->url = TALER_url_join (backend_url,
                                path,
                                NULL);
     GNUNET_free (path);
   }
-  if (NULL == tgh->url)
+  if (NULL == wgh->url)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 "Could not construct request URL.\n");
-    GNUNET_free (tgh);
+    GNUNET_free (wgh);
     return NULL;
   }
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Requesting URL '%s'\n",
-              tgh->url);
-  eh = TALER_MERCHANT_curl_easy_get_ (tgh->url);
-  tgh->job = GNUNET_CURL_job_add (ctx,
+              wgh->url);
+  eh = TALER_MERCHANT_curl_easy_get_ (wgh->url);
+  wgh->job = GNUNET_CURL_job_add (ctx,
                                   eh,
-                                  &handle_get_template_finished,
-                                  tgh);
-  return tgh;
+                                  &handle_get_webhook_finished,
+                                  wgh);
+  return wgh;
 }
 
 
 void
-TALER_MERCHANT_template_get_cancel (
-  struct TALER_MERCHANT_TemplateGetHandle *tgh)
+TALER_MERCHANT_webhook_get_cancel (
+  struct TALER_MERCHANT_WebhookGetHandle *wgh)
 {
-  if (NULL != tgh->job)
-    GNUNET_CURL_job_cancel (tgh->job);
-  GNUNET_free (tgh->url);
-  GNUNET_free (tgh);
+  if (NULL != wgh->job)
+    GNUNET_CURL_job_cancel (wgh->job);
+  GNUNET_free (wgh->url);
+  GNUNET_free (wgh);
 }
diff --git a/src/lib/merchant_api_get_products.c 
b/src/lib/merchant_api_get_webhooks.c
similarity index 66%
copy from src/lib/merchant_api_get_products.c
copy to src/lib/merchant_api_get_webhooks.c
index c3cc30e7..c80a94b9 100644
--- a/src/lib/merchant_api_get_products.c
+++ b/src/lib/merchant_api_get_webhooks.c
@@ -15,9 +15,9 @@
   <http://www.gnu.org/licenses/>
 */
 /**
- * @file merchant_api_get_products.c
- * @brief Implementation of the GET /products request of the merchant's HTTP 
API
- * @author Christian Grothoff
+ * @file merchant_api_get_webhooks.c
+ * @brief Implementation of the GET /webhooks request of the merchant's HTTP 
API
+ * @author Priscilla HUANG
  */
 #include "platform.h"
 #include <curl/curl.h>
@@ -32,9 +32,9 @@
 
 
 /**
- * Handle for a GET /products operation.
+ * Handle for a GET /webhooks operation.
  */
-struct TALER_MERCHANT_ProductsGetHandle
+struct TALER_MERCHANT_WebhooksGetHandle
 {
   /**
    * The url for this request.
@@ -49,7 +49,7 @@ struct TALER_MERCHANT_ProductsGetHandle
   /**
    * Function to call with the result.
    */
-  TALER_MERCHANT_ProductsGetCallback cb;
+  TALER_MERCHANT_WebhooksGetCallback cb;
 
   /**
    * Closure for @a cb.
@@ -65,28 +65,28 @@ struct TALER_MERCHANT_ProductsGetHandle
 
 
 /**
- * Parse product information from @a ia.
+ * Parse webhook information from @a ia.
  *
- * @param ia JSON array (or NULL!) with product data
- * @param pgh operation handle
+ * @param ia JSON array (or NULL!) with webhook data
+ * @param wgh operation handle
  * @return #GNUNET_OK on success
  */
 static int
-parse_products (const json_t *ia,
-                struct TALER_MERCHANT_ProductsGetHandle *pgh)
+parse_webhooks (const json_t *ia,
+                struct TALER_MERCHANT_webhooksGetHandle *wgh)
 {
   unsigned int ies_len = json_array_size (ia);
-  struct TALER_MERCHANT_InventoryEntry ies[ies_len];
+  struct TALER_MERCHANT_WebhookEntry ies[ies_len];
   size_t index;
   json_t *value;
   int ret;
 
   ret = GNUNET_OK;
   json_array_foreach (ia, index, value) {
-    struct TALER_MERCHANT_InventoryEntry *ie = &ies[index];
+    struct TALER_MERCHANT_WebhookEntry *ie = &ies[index];
     struct GNUNET_JSON_Specification spec[] = {
-      GNUNET_JSON_spec_string ("product_id",
-                               &ie->product_id),
+      GNUNET_JSON_spec_string ("webhook_id",
+                               &ie->webhook_id),
       GNUNET_JSON_spec_end ()
     };
 
@@ -108,11 +108,11 @@ parse_products (const json_t *ia,
       .http_status = MHD_HTTP_OK
     };
 
-    pgh->cb (pgh->cb_cls,
+    wgh->cb (tgh->cb_cls,
              &hr,
              ies_len,
              ies);
-    pgh->cb = NULL; /* just to be sure */
+    wgh->cb = NULL; /* just to be sure */
   }
   return ret;
 }
@@ -120,36 +120,36 @@ parse_products (const json_t *ia,
 
 /**
  * Function called when we're done processing the
- * HTTP /products request.
+ * HTTP /webhooks request.
  *
- * @param cls the `struct TALER_MERCHANT_ProductsGetHandle`
+ * @param cls the `struct TALER_MERCHANT_WebhooksGetHandle`
  * @param response_code HTTP response code, 0 on error
  * @param response response body, NULL if not in JSON
  */
 static void
-handle_get_products_finished (void *cls,
+handle_get_webhooks_finished (void *cls,
                               long response_code,
                               const void *response)
 {
-  struct TALER_MERCHANT_ProductsGetHandle *pgh = cls;
+  struct TALER_MERCHANT_WebhooksGetHandle *tgh = cls;
   const json_t *json = response;
   struct TALER_MERCHANT_HttpResponse hr = {
     .http_status = (unsigned int) response_code,
     .reply = json
   };
 
-  pgh->job = NULL;
+  wgh->job = NULL;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Got /products response with status code %u\n",
+              "Got /webhooks response with status code %u\n",
               (unsigned int) response_code);
   switch (response_code)
   {
   case MHD_HTTP_OK:
     {
-      json_t *products;
+      json_t *webhooks;
       struct GNUNET_JSON_Specification spec[] = {
-        GNUNET_JSON_spec_json ("products",
-                               &products),
+        GNUNET_JSON_spec_json ("webhooks",
+                               &webhooks),
         GNUNET_JSON_spec_end ()
       };
 
@@ -163,13 +163,13 @@ handle_get_products_finished (void *cls,
       }
       else
       {
-        if ( (! json_is_array (products)) ||
+        if ( (! json_is_array (webhooks)) ||
              (GNUNET_OK ==
-              parse_products (products,
-                              pgh)) )
+              parse_templates (webhooks,
+                              wgh)) )
         {
           GNUNET_JSON_parse_free (spec);
-          TALER_MERCHANT_products_get_cancel (pgh);
+          TALER_MERCHANT_webhooks_get_cancel (wgh);
           return;
         }
         else
@@ -196,56 +196,56 @@ handle_get_products_finished (void *cls,
                 (int) hr.ec);
     break;
   }
-  pgh->cb (pgh->cb_cls,
+  tgh->cb (wgh->cb_cls,
            &hr,
            0,
            NULL);
-  TALER_MERCHANT_products_get_cancel (pgh);
+  TALER_MERCHANT_webhooks_get_cancel (wgh);
 }
 
 
-struct TALER_MERCHANT_ProductsGetHandle *
-TALER_MERCHANT_products_get (
+struct TALER_MERCHANT_WebhooksGetHandle *
+TALER_MERCHANT_webhooks_get (
   struct GNUNET_CURL_Context *ctx,
   const char *backend_url,
-  TALER_MERCHANT_ProductsGetCallback cb,
+  TALER_MERCHANT_WebhooksGetCallback cb,
   void *cb_cls)
 {
-  struct TALER_MERCHANT_ProductsGetHandle *pgh;
+  struct TALER_MERCHANT_WebhooksGetHandle *wgh;
   CURL *eh;
 
-  pgh = GNUNET_new (struct TALER_MERCHANT_ProductsGetHandle);
-  pgh->ctx = ctx;
-  pgh->cb = cb;
-  pgh->cb_cls = cb_cls;
-  pgh->url = TALER_url_join (backend_url,
-                             "private/products",
+  wgh = GNUNET_new (struct TALER_MERCHANT_WebhooksGetHandle);
+  wgh->ctx = ctx;
+  wgh->cb = cb;
+  wgh->cb_cls = cb_cls;
+  wgh->url = TALER_url_join (backend_url,
+                             "private/webhooks",
                              NULL);
-  if (NULL == pgh->url)
+  if (NULL == wgh->url)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 "Could not construct request URL.\n");
-    GNUNET_free (pgh);
+    GNUNET_free (wgh);
     return NULL;
   }
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Requesting URL '%s'\n",
-              pgh->url);
-  eh = TALER_MERCHANT_curl_easy_get_ (pgh->url);
-  pgh->job = GNUNET_CURL_job_add (ctx,
+              wgh->url);
+  eh = TALER_MERCHANT_curl_easy_get_ (wgh->url);
+  wgh->job = GNUNET_CURL_job_add (ctx,
                                   eh,
-                                  &handle_get_products_finished,
-                                  pgh);
-  return pgh;
+                                  &handle_get_webhooks_finished,
+                                  wgh);
+  return wgh;
 }
 
 
 void
-TALER_MERCHANT_products_get_cancel (
-  struct TALER_MERCHANT_ProductsGetHandle *pgh)
+TALER_MERCHANT_webhooks_get_cancel (
+  struct TALER_MERCHANT_WebhooksGetHandle *wgh)
 {
-  if (NULL != pgh->job)
-    GNUNET_CURL_job_cancel (pgh->job);
-  GNUNET_free (pgh->url);
-  GNUNET_free (pgh);
+  if (NULL != wgh->job)
+    GNUNET_CURL_job_cancel (wgh->job);
+  GNUNET_free (wgh->url);
+  GNUNET_free (wgh);
 }
diff --git a/src/lib/merchant_api_patch_template.c 
b/src/lib/merchant_api_patch_webhook.c
similarity index 68%
copy from src/lib/merchant_api_patch_template.c
copy to src/lib/merchant_api_patch_webhook.c
index 01256f24..279a536f 100644
--- a/src/lib/merchant_api_patch_template.c
+++ b/src/lib/merchant_api_patch_webhook.c
@@ -17,8 +17,8 @@
   If not, see <http://www.gnu.org/licenses/>
 */
 /**
- * @file merchant_api_patch_template.c
- * @brief Implementation of the PATCH /templates/$ID request
+ * @file merchant_api_patch_webhook.c
+ * @brief Implementation of the PATCH /webhooks/$ID request
  *        of the merchant's HTTP API
  * @author Priscilla HUANG 
  */
@@ -34,9 +34,9 @@
 
 
 /**
- * Handle for a PATCH /templates/$ID operation.
+ * Handle for a PATCH /webhooks/$ID operation.
  */
-struct TALER_MERCHANT_TemplatePatchHandle
+struct TALER_MERCHANT_WebhookPatchHandle
 {
 
   /**
@@ -52,7 +52,7 @@ struct TALER_MERCHANT_TemplatePatchHandle
   /**
    * Function to call with the result.
    */
-  TALER_MERCHANT_TemplatePatchCallback cb;
+  TALER_MERCHANT_WebhookPatchCallback cb;
 
   /**
    * Closure for @a cb.
@@ -74,27 +74,27 @@ struct TALER_MERCHANT_TemplatePatchHandle
 
 /**
  * Function called when we're done processing the
- * HTTP PATCH /templates/$ID request.
+ * HTTP PATCH /webhooks/$ID request.
  *
- * @param cls the `struct TALER_MERCHANT_TemplatePatchHandle`
+ * @param cls the `struct TALER_MERCHANT_WebhookPatchHandle`
  * @param response_code HTTP response code, 0 on error
  * @param response response body, NULL if not in JSON
  */
 static void
-handle_patch_template_finished (void *cls,
+handle_patch_webhook_finished (void *cls,
                                long response_code,
                                const void *response)
 {
-  struct TALER_MERCHANT_TemplatePatchHandle *tph = cls;
+  struct TALER_MERCHANT_WebhookPatchHandle *wph = cls;
   const json_t *json = response;
   struct TALER_MERCHANT_HttpResponse hr = {
     .http_status = (unsigned int) response_code,
     .reply = json
   };
 
-  tph->job = NULL;
+  wph->job = NULL;
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              "PATCH /templates/$ID completed with response code %u\n",
+              "PATCH /webhooks/$ID completed with response code %u\n",
               (unsigned int) response_code);
   switch (response_code)
   {
@@ -149,69 +149,75 @@ handle_patch_template_finished (void *cls,
     GNUNET_break_op (0);
     break;
   }
-  tph->cb (tph->cb_cls,
+  wph->cb (wph->cb_cls,
            &hr);
-  TALER_MERCHANT_template_patch_cancel (tph);
+  TALER_MERCHANT_webhook_patch_cancel (wph);
 }
 
 
-struct TALER_MERCHANT_TemplatePatchHandle *
-TALER_MERCHANT_template_patch (
+struct TALER_MERCHANT_WebhookPatchHandle *
+TALER_MERCHANT_webhook_patch (
   struct GNUNET_CURL_Context *ctx,
   const char *backend_url,
-  const char *template_id,
-  const char *template_description,
-  const char *image,
-  const json_t *template_contract,
-  TALER_MERCHANT_TemplatePatchCallback cb,
+  const char *webhook_id,
+  const char *event_type,
+  const char *url,
+  const char *http_method,
+  const char *header_template,
+  const char *body_template,
+  TALER_MERCHANT_WebhookPatchCallback cb,
   void *cb_cls)
 {
-  struct TALER_MERCHANT_TemplatePatchHandle *tph;
+  struct TALER_MERCHANT_WebhookPatchHandle *wph;
   json_t *req_obj;
 
   req_obj = GNUNET_JSON_PACK (
-    GNUNET_JSON_pack_string ("template_description",
-                             template_description),
-    GNUNET_JSON_pack_string ("image",
-                             image),
-    GNUNET_JSON_pack_object_incref ("template_contract",
-                                    (json_t *) template_contract));
-  tph = GNUNET_new (struct TALER_MERCHANT_TemplatePatchHandle);
-  tph->ctx = ctx;
-  tph->cb = cb;
-  tph->cb_cls = cb_cls;
+    GNUNET_JSON_pack_string ("event_type",
+                             event_type),
+    GNUNET_JSON_pack_string ("url",
+                             url),
+    GNUNET_JSON_pack_string ("http_method",
+                             http_method),
+    GNUNET_JSON_pack_string ("header_template",
+                             header_template),
+    GNUNET_JSON_pack_string ("body_template",
+                             body_template));
+  wph = GNUNET_new (struct TALER_MERCHANT_WebhookPatchHandle);
+  wph->ctx = ctx;
+  wph->cb = cb;
+  wph->cb_cls = cb_cls;
   {
     char *path;
 
     GNUNET_asprintf (&path,
-                     "private/templates/%s",
-                     template_id);
-    tph->url = TALER_url_join (backend_url,
+                     "private/webhooks/%s",
+                     webhook_id);
+    wph->url = TALER_url_join (backend_url,
                                path,
                                NULL);
     GNUNET_free (path);
   }
-  if (NULL == tph->url)
+  if (NULL == wph->url)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 "Could not construct request URL.\n");
     json_decref (req_obj);
-    GNUNET_free (tph);
+    GNUNET_free (wph);
     return NULL;
   }
   {
     CURL *eh;
 
-    eh = TALER_MERCHANT_curl_easy_get_ (tph->url);
+    eh = TALER_MERCHANT_curl_easy_get_ (wph->url);
     if (GNUNET_OK !=
-        TALER_curl_easy_post (&tph->post_ctx,
+        TALER_curl_easy_post (&wph->post_ctx,
                               eh,
                               req_obj))
     {
       GNUNET_break (0);
       curl_easy_cleanup (eh);
       json_decref (req_obj);
-      GNUNET_free (tph);
+      GNUNET_free (wph);
       return NULL;
     }
     json_decref (req_obj);
@@ -219,29 +225,29 @@ TALER_MERCHANT_template_patch (
                    curl_easy_setopt (eh,
                                      CURLOPT_CUSTOMREQUEST,
                                      MHD_HTTP_METHOD_PATCH));
-    tph->job = GNUNET_CURL_job_add2 (ctx,
+    wph->job = GNUNET_CURL_job_add2 (ctx,
                                      eh,
-                                     tph->post_ctx.headers,
-                                     &handle_patch_template_finished,
-                                     tph);
+                                     wph->post_ctx.headers,
+                                     &handle_patch_webhook_finished,
+                                     wph);
   }
-  return tph;
+  return wph;
 }
 
 
 void
-TALER_MERCHANT_template_patch_cancel (
-  struct TALER_MERCHANT_TemplatePatchHandle *tph)
+TALER_MERCHANT_webhook_patch_cancel (
+  struct TALER_MERCHANT_WebhookPatchHandle *wph)
 {
-  if (NULL != tph->job)
+  if (NULL != wph->job)
   {
-    GNUNET_CURL_job_cancel (tph->job);
-    tph->job = NULL;
+    GNUNET_CURL_job_cancel (wph->job);
+    wph->job = NULL;
   }
-  TALER_curl_easy_post_finished (&tph->post_ctx);
-  GNUNET_free (tph->url);
-  GNUNET_free (tph);
+  TALER_curl_easy_post_finished (&wph->post_ctx);
+  GNUNET_free (wph->url);
+  GNUNET_free (wph);
 }
 
 
-/* end of merchant_api_patch_template.c */
+/* end of merchant_api_patch_webhook.c */
diff --git a/src/lib/merchant_api_post_templates.c 
b/src/lib/merchant_api_post_templates.c
index f34d040d..b4d286aa 100644
--- a/src/lib/merchant_api_post_templates.c
+++ b/src/lib/merchant_api_post_templates.c
@@ -74,7 +74,7 @@ struct TALER_MERCHANT_TemplatesPostHandle
 
 /**
  * Function called when we're done processing the
- * HTTP POST /products request.
+ * HTTP POST /templates request.
  *
  * @param cls the `struct TALER_MERCHANT_TemplatesPostHandle`
  * @param response_code HTTP response code, 0 on error
diff --git a/src/lib/merchant_api_post_templates.c 
b/src/lib/merchant_api_post_webhooks.c
similarity index 66%
copy from src/lib/merchant_api_post_templates.c
copy to src/lib/merchant_api_post_webhooks.c
index f34d040d..9d3b87e8 100644
--- a/src/lib/merchant_api_post_templates.c
+++ b/src/lib/merchant_api_post_webhooks.c
@@ -17,8 +17,8 @@
   If not, see <http://www.gnu.org/licenses/>
 */
 /**
- * @file merchant_api_post_templates.c
- * @brief Implementation of the POST /templates request
+ * @file merchant_api_post_webhooks.c
+ * @brief Implementation of the POST /webhooks request
  *        of the merchant's HTTP API
  * @author Priscilla HUANG
  */
@@ -34,9 +34,9 @@
 
 
 /**
- * Handle for a POST /templates/$ID operation.
+ * Handle for a POST /webhooks/$ID operation.
  */
-struct TALER_MERCHANT_TemplatesPostHandle
+struct TALER_MERCHANT_WebhooksPostHandle
 {
 
   /**
@@ -52,7 +52,7 @@ struct TALER_MERCHANT_TemplatesPostHandle
   /**
    * Function to call with the result.
    */
-  TALER_MERCHANT_TemplatesPostCallback cb;
+  TALER_MERCHANT_WebhooksPostCallback cb;
 
   /**
    * Closure for @a cb.
@@ -74,27 +74,27 @@ struct TALER_MERCHANT_TemplatesPostHandle
 
 /**
  * Function called when we're done processing the
- * HTTP POST /products request.
+ * HTTP POST /webhooks request.
  *
- * @param cls the `struct TALER_MERCHANT_TemplatesPostHandle`
+ * @param cls the `struct TALER_MERCHANT_WebhooksPostHandle`
  * @param response_code HTTP response code, 0 on error
  * @param response response body, NULL if not in JSON
  */
 static void
-handle_post_templates_finished (void *cls,
+handle_post_webhooks_finished (void *cls,
                                long response_code,
                                const void *response)
 {
-  struct TALER_MERCHANT_TemplatesPostHandle *tph = cls;
+  struct TALER_MERCHANT_WebhooksPostHandle *wph = cls;
   const json_t *json = response;
   struct TALER_MERCHANT_HttpResponse hr = {
     .http_status = (unsigned int) response_code,
     .reply = json
   };
 
-  tph->job = NULL;
+  wph->job = NULL;
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              "POST /templates completed with response code %u\n",
+              "POST /webhooks completed with response code %u\n",
               (unsigned int) response_code);
   switch (response_code)
   {
@@ -151,83 +151,89 @@ handle_post_templates_finished (void *cls,
     GNUNET_break_op (0);
     break;
   }
-  tph->cb (tph->cb_cls,
+  wph->cb (wph->cb_cls,
            &hr);
-  TALER_MERCHANT_templates_post_cancel (tph);
+  TALER_MERCHANT_webhooks_post_cancel (wph);
 }
 
 
-struct TALER_MERCHANT_TemplatesPostHandle *
-TALER_MERCHANT_templates_post (
+struct TALER_MERCHANT_WebhooksPostHandle *
+TALER_MERCHANT_webhooks_post (
   struct GNUNET_CURL_Context *ctx,
   const char *backend_url,
-  const char *template_id,
-  const char *template_description,
-  const char *image,
-  const json_t *template_contract,
-  TALER_MERCHANT_TemplatesPostCallback cb,
+  const char *webhook_id,
+  const char *event_type,
+  const char *url,
+  const char *http_method,
+  const char *header_template,
+  const char *body_template,
+  TALER_MERCHANT_WebhooksPostCallback cb,
   void *cb_cls)
 {
-  struct TALER_MERCHANT_TemplatesPostHandle *tph;
+  struct TALER_MERCHANT_WebhooksPostHandle *wph;
   json_t *req_obj;
 
   req_obj = GNUNET_JSON_PACK (
-    GNUNET_JSON_pack_string ("template_id",
-                             template_id),
-    GNUNET_JSON_pack_string ("template_description",
-                             template_description),
-    GNUNET_JSON_pack_string ("image",
-                             image),
-    GNUNET_JSON_pack_object_incref ("template_contract",
-                                    (json_t *) template_contract));
-  tph = GNUNET_new (struct TALER_MERCHANT_TemplatesPostHandle);
-  tph->ctx = ctx;
-  tph->cb = cb;
-  tph->cb_cls = cb_cls;
-  tph->url = TALER_url_join (backend_url,
-                             "private/templates",
+    GNUNET_JSON_pack_string ("webhook_id",
+                             webhook_id),
+    GNUNET_JSON_pack_string ("event_type",
+                             event_type),
+    GNUNET_JSON_pack_string ("url",
+                             url),
+    GNUNET_JSON_pack_string ("http_method",
+                             http_method),
+    GNUNET_JSON_pack_string ("header_template",
+                             header_template),
+    GNUNET_JSON_pack_string ("body_template",
+                             body_template));
+  tph = GNUNET_new (struct TALER_MERCHANT_WebhooksPostHandle);
+  wph->ctx = ctx;
+  wph->cb = cb;
+  wph->cb_cls = cb_cls;
+  wph->url = TALER_url_join (backend_url,
+                             "private/webhooks",
                              NULL);
-  if (NULL == tph->url)
+  if (NULL == wph->url)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 "Could not construct request URL.\n");
     json_decref (req_obj);
-    GNUNET_free (tph);
+    GNUNET_free (wph);
     return NULL;
   }
   {
     CURL *eh;
 
-    eh = TALER_MERCHANT_curl_easy_get_ (tph->url);
+    eh = TALER_MERCHANT_curl_easy_get_ (wph->url);
     GNUNET_assert (GNUNET_OK ==
-                   TALER_curl_easy_post (&tph->post_ctx,
+                   TALER_curl_easy_post (&wph->post_ctx,
                                          eh,
                                          req_obj));
     json_decref (req_obj);
-    tph->job = GNUNET_CURL_job_add2 (ctx,
+    wph->job = GNUNET_CURL_job_add2 (ctx,
                                      eh,
-                                     tph->post_ctx.headers,
-                                     &handle_post_templates_finished,
-                                     tph);
-    GNUNET_assert (NULL != tph->job);
+                                     wph->post_ctx.headers,
+                                     &handle_post_webhooks_finished,
+                                     wph);
+    GNUNET_assert (NULL != wph->job);
   }
-  return tph;
+  return wph;
 }
 
 
 void
-TALER_MERCHANT_templates_post_cancel (
-  struct TALER_MERCHANT_TemplatesPostHandle *tph)
+TALER_MERCHANT_webhooks_post_cancel (
+  struct TALER_MERCHANT_WebhooksPostHandle *wph)
 {
-  if (NULL != tph->job)
+  if (NULL != wph->job)
   {
-    GNUNET_CURL_job_cancel (tph->job);
-    tph->job = NULL;
+    GNUNET_CURL_job_cancel (wph->job);
+    wph->job = NULL;
   }
-  TALER_curl_easy_post_finished (&tph->post_ctx);
-  GNUNET_free (tph->url);
-  GNUNET_free (tph);
+  TALER_curl_easy_post_finished (&wph->post_ctx);
+  GNUNET_free (wph->url);
+  GNUNET_free (wph);
 }
 
 
-/* end of merchant_api_post_templates.c */
+/* end of merchant_api_post_webhooks.c */

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]