aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpriscilla <priscilla.huang@efrei.net>2022-11-25 04:26:02 -0500
committerpriscilla <priscilla.huang@efrei.net>2022-11-25 04:26:02 -0500
commit2c0f428f9c2c551b5825bb81600ab436e966f7d7 (patch)
tree4da3b2994450ce740b561c676ac9c9641c6f178a
parent6874f45896dfe00d5106c69fa9312cbac216899a (diff)
webhook
-rw-r--r--src/backenddb/merchant-0004.sql12
-rw-r--r--src/backenddb/plugin_merchantdb_postgres.c27
2 files changed, 30 insertions, 9 deletions
diff --git a/src/backenddb/merchant-0004.sql b/src/backenddb/merchant-0004.sql
index 0b2cc349..f7412a24 100644
--- a/src/backenddb/merchant-0004.sql
+++ b/src/backenddb/merchant-0004.sql
@@ -1,10 +1,4 @@
---
--- This file is part of TALER
--- Copyright (C) 2021 Taler Systems SA
---
--- TALER is free software; you can redistribute it and/or modify it under the
--- terms of the GNU General Public License as published by the Free Software
--- Foundation; either version 3, or (at your option) any later version.
+ version.
--
-- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
@@ -51,10 +45,10 @@ COMMIT;
CREATE TABLE IF NOT EXISTS merchant_webhooks
- (webhooks_serial BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY
+ (webhook_serial BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY
,merchant_serial BIGINT NOT NULL
REFERENCES merchant_instances (merchant_serial) ON DELETE CASCADE
- ,webhooks_id VARCHAR NOT NULL
+ ,webhook_id VARCHAR NOT NULL
,event_type VARCHAR NOT NULL
,url VARCHAR NOT NULL
,methods VARCHAR NOT NULL
diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c
index 970ddfed..6a2bcb65 100644
--- a/src/backenddb/plugin_merchantdb_postgres.c
+++ b/src/backenddb/plugin_merchantdb_postgres.c
@@ -7074,6 +7074,33 @@ postgres_lookup_template (void *cls,
}
}
+ /**
+ * Delete information about a webhook.
+ *
+ * @param cls closure
+ * @param instance_id instance to delete webhook of
+ * @param webhook_id webhook to delete
+ * @return DB status code, #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS
+ * if webhook unknown.
+ *
+static enum GNUNET_DB_QueryStatus
+postgres_delete_template (void *cls,
+ const char *instance_id,
+ const char *template_id)
+{
+ struct PostgresClosure *pg = cls;
+ struct GNUNET_PQ_QueryParam params[] = {
+ GNUNET_PQ_query_param_string (instance_id),
+ GNUNET_PQ_query_param_string (template_id),
+ GNUNET_PQ_query_param_end
+ };
+
+ check_connection (pg);
+ return GNUNET_PQ_eval_prepared_non_select (pg->conn,
+ "delete_template",
+ params);
+}
+ */
/**
* Establish connection to the database.