From 2c0f428f9c2c551b5825bb81600ab436e966f7d7 Mon Sep 17 00:00:00 2001 From: priscilla Date: Fri, 25 Nov 2022 04:26:02 -0500 Subject: webhook --- src/backenddb/merchant-0004.sql | 12 +++--------- src/backenddb/plugin_merchantdb_postgres.c | 27 +++++++++++++++++++++++++++ 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. -- cgit v1.2.3