aboutsummaryrefslogtreecommitdiff
path: root/src/include/taler_merchant_testing_lib.h
diff options
context:
space:
mode:
authorpriscilla <priscilla.huang@efrei.net>2022-12-05 07:11:28 -0500
committerpriscilla <priscilla.huang@efrei.net>2022-12-05 07:11:55 -0500
commit4d093eb54beda349e95de54421ea44d66476273e (patch)
treeb5d01882e335c6592867b2977131128791e51b43 /src/include/taler_merchant_testing_lib.h
parent489f6665155d9db9982c3285fe61e818214f18da (diff)
downloadmerchant-4d093eb54beda349e95de54421ea44d66476273e.tar.gz
merchant-4d093eb54beda349e95de54421ea44d66476273e.tar.bz2
merchant-4d093eb54beda349e95de54421ea44d66476273e.zip
update
Diffstat (limited to 'src/include/taler_merchant_testing_lib.h')
-rw-r--r--src/include/taler_merchant_testing_lib.h137
1 files changed, 136 insertions, 1 deletions
diff --git a/src/include/taler_merchant_testing_lib.h b/src/include/taler_merchant_testing_lib.h
index 9a4a8372..a77def75 100644
--- a/src/include/taler_merchant_testing_lib.h
+++ b/src/include/taler_merchant_testing_lib.h
@@ -1599,7 +1599,7 @@ TALER_TESTING_cmd_merchant_get_template (const char *label,
/**
- * Define a "DELETE product" CMD.
+ * Define a "DELETE template" CMD.
*
* @param label command label.
* @param merchant_url base URL of the merchant serving the
@@ -1614,6 +1614,141 @@ TALER_TESTING_cmd_merchant_delete_template (const char *label,
const char *template_id,
unsigned int http_status);
+/* ****** Webhooks ******* */
+
+
+/**
+ * Define a "POST /webhooks" CMD.
+ *
+ * @param label command label.
+ * @param merchant_url base URL of the merchant serving the
+ * POST /webhooks request.
+ * @param webhook_id the ID of the webhook to query
+ * @param event_type event of the webhook
+ * @param url use by the customer
+ * @param http_method use by the merchant
+ * @param header_template of the webhook
+ * @param body_template of the webhook
+ * @param http_status expected HTTP response code.
+ * @return the command.
+ */
+struct TALER_TESTING_Command
+TALER_TESTING_cmd_merchant_post_webhooks2 (
+ const char *label,
+ const char *merchant_url,
+ const char *webhook_id,
+ const char *event_type,
+ const char *url,
+ const char *http_method,
+ const char *header_template,
+ const char *body_template,
+ unsigned int http_status);
+
+
+/**
+ * Define a "POST /webhooks" CMD, simple version
+ *
+ * @param label command label.
+ * @param merchant_url base URL of the merchant serving the
+ * POST /webhooks request.
+ * @param webhook_id the ID of the webhook to query
+ * @param event_type event of the webhook
+ * @param http_status expected HTTP response code.
+ * @return the command.
+ */
+struct TALER_TESTING_Command
+TALER_TESTING_cmd_merchant_post_webhooks (const char *label,
+ const char *merchant_url,
+ const char *webhook_id,
+ const char *event_type,
+ unsigned int http_status);
+
+
+/**
+ * Define a "PATCH /webhooks/$ID" CMD.
+ *
+ * @param label command label.
+ * @param merchant_url base URL of the merchant serving the
+ * PATCH /webhook request.
+ * @param webhook_id the ID of the webhook to query
+ * @param event_type event of the webhook
+ * @param url use by the customer
+ * @param http_method use by the merchant
+ * @param header_template of the webhook
+ * @param body_template of the webhook
+ * @param http_status expected HTTP response code.
+ * @return the command.
+ */
+struct TALER_TESTING_Command
+TALER_TESTING_cmd_merchant_patch_webhook (
+ const char *label,
+ const char *merchant_url,
+ const char *webhook_id,
+ const char *event_type,
+ const char *url,
+ const char *http_method,
+ const char *header_template,
+ const char *body_template,
+ unsigned int http_status);
+
+
+/**
+ * Define a "GET /webhooks" CMD.
+ *
+ * @param label command label.
+ * @param merchant_url base URL of the merchant serving the
+ * GET /webhooks request.
+ * @param http_status expected HTTP response code.
+ * @param ... NULL-terminated list of labels (const char *) of
+ * webhook (commands) we expect to be returned in the list
+ * (assuming @a http_code is #MHD_HTTP_OK)
+ * @return the command.
+ */
+struct TALER_TESTING_Command
+TALER_TESTING_cmd_merchant_get_webhooks (const char *label,
+ const char *merchant_url,
+ unsigned int http_status,
+ ...);
+
+
+/**
+ * Define a "GET webhook" CMD.
+ *
+ * @param label command label.
+ * @param merchant_url base URL of the merchant serving the
+ * GET /templates/$ID request.
+ * @param webhook_id the ID of the webhook to query
+ * @param http_status expected HTTP response code.
+ * @param webhook_reference reference to a "POST /webhooks" or "PATCH /webhooks/$ID" CMD
+ * that will provide what we expect the backend to return to us
+ * @return the command.
+ */
+struct TALER_TESTING_Command
+TALER_TESTING_cmd_merchant_get_webhook (const char *label,
+ const char *merchant_url,
+ const char *webhook_id,
+ unsigned int http_status,
+ const char *webhook_reference);
+
+
+
+/**
+ * Define a "DELETE webhook" CMD.
+ *
+ * @param label command label.
+ * @param merchant_url base URL of the merchant serving the
+ * DELETE /webhooks/$ID request.
+ * @param webhook_id the ID of the webhook to query
+ * @param http_status expected HTTP response code.
+ * @return the command.
+ */
+struct TALER_TESTING_Command
+TALER_TESTING_cmd_merchant_delete_webhook (const char *label,
+ const char *merchant_url,
+ const char *webhook_id,
+ unsigned int http_status);
+
+
/* ****** Specific traits supported by this component ******* */