aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-07-16 17:47:35 +0200
committerChristian Grothoff <christian@grothoff.org>2024-07-29 12:18:45 +0200
commitaa04e4af568eb0599b8f4eb89f779ecd9d20cc25 (patch)
treefeabfbd487c74bc430340face9f48a6357ce1c8c /src
parentfa22c593f4c8ca85978329c22dcfdd5da9ba6d7b (diff)
skeleton
Diffstat (limited to 'src')
-rw-r--r--src/exchangedb/Makefile.am2
-rw-r--r--src/exchangedb/pg_kycauth_in_insert.c39
-rw-r--r--src/exchangedb/pg_kycauth_in_insert.h50
-rw-r--r--src/exchangedb/pg_wad_in_insert.c40
-rw-r--r--src/exchangedb/pg_wad_in_insert.h51
-rw-r--r--src/exchangedb/plugin_exchangedb_postgres.c6
6 files changed, 188 insertions, 0 deletions
diff --git a/src/exchangedb/Makefile.am b/src/exchangedb/Makefile.am
index 31ac50cf8..ae80a5123 100644
--- a/src/exchangedb/Makefile.am
+++ b/src/exchangedb/Makefile.am
@@ -221,6 +221,8 @@ libtaler_plugin_exchangedb_postgres_la_SOURCES = \
pg_lookup_auditor_status.h pg_lookup_auditor_status.c \
pg_insert_auditor.h pg_insert_auditor.c \
pg_lookup_wire_timestamp.h pg_lookup_wire_timestamp.c \
+ pg_wad_in_insert.h pg_wad_in_insert.c \
+ pg_kycauth_in_insert.h pg_kycauth_in_insert.c \
pg_insert_wire.h pg_insert_wire.c \
pg_update_wire.h pg_update_wire.c \
pg_get_wire_accounts.h pg_get_wire_accounts.c \
diff --git a/src/exchangedb/pg_kycauth_in_insert.c b/src/exchangedb/pg_kycauth_in_insert.c
new file mode 100644
index 000000000..506c4a011
--- /dev/null
+++ b/src/exchangedb/pg_kycauth_in_insert.c
@@ -0,0 +1,39 @@
+/*
+ This file is part of TALER
+ Copyright (C) 2024 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.
+
+ 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
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+/**
+ * @file exchangedb/pg_kycauth_in_insert.c
+ * @brief Implementation of the kycauth_in_insert function for Postgres
+ * @author Christian Grothoff
+ */
+#include "platform.h"
+#include "taler_error_codes.h"
+#include "taler_dbevents.h"
+#include "taler_pq_lib.h"
+#include "pg_kycauth_in_insert.h"
+#include "pg_helper.h"
+
+enum GNUNET_DB_QueryStatus
+TEH_PG_kycauth_in_insert (
+ void *cls,
+ const union TALER_AccountPublicKeyP *account_pub,
+ struct GNUNET_TIME_Timestamp execution_date,
+ const char *debit_account_uri,
+ const char *section_name,
+ uint64_t serial_id)
+{
+ // FIXME: not implemented
+ return -1;
+}
diff --git a/src/exchangedb/pg_kycauth_in_insert.h b/src/exchangedb/pg_kycauth_in_insert.h
new file mode 100644
index 000000000..2222a998b
--- /dev/null
+++ b/src/exchangedb/pg_kycauth_in_insert.h
@@ -0,0 +1,50 @@
+/*
+ This file is part of TALER
+ Copyright (C) 2024 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.
+
+ 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
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+/**
+ * @file exchangedb/pg_kycauth_in_insert.h
+ * @brief implementation of the kycauth_in_insert function for Postgres
+ * @author Christian Grothoff
+ */
+#ifndef PG_KYCAUTH_IN_INSERT_H
+#define PG_KYCAUTH_IN_INSERT_H
+
+#include "taler_util.h"
+#include "taler_json_lib.h"
+#include "taler_exchangedb_plugin.h"
+
+/**
+ * Insert an incoming KCYAUTH wire transfer into
+ * the database and update the authentication key
+ * for the origin account.
+ *
+ * @param cls the @e cls of this struct with the plugin-specific state
+ * @param account_pub public key of the account
+ * @param execution_date when was the transfer made
+ * @param debit_account_uri URI of the debit account
+ * @param section_name section of the exchange bank account that received the transfer
+ * @param serial_id bank-specific row identifying the transfer
+ */
+enum GNUNET_DB_QueryStatus
+TEH_PG_kycauth_in_insert (
+ void *cls,
+ const union TALER_AccountPublicKeyP *account_pub,
+ struct GNUNET_TIME_Timestamp execution_date,
+ const char *debit_account_uri,
+ const char *section_name,
+ uint64_t serial_id);
+
+
+#endif
diff --git a/src/exchangedb/pg_wad_in_insert.c b/src/exchangedb/pg_wad_in_insert.c
new file mode 100644
index 000000000..387273d35
--- /dev/null
+++ b/src/exchangedb/pg_wad_in_insert.c
@@ -0,0 +1,40 @@
+/*
+ This file is part of TALER
+ Copyright (C) 2024 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.
+
+ 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
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+/**
+ * @file exchangedb/pg_wad_in_insert.c
+ * @brief Implementation of the wad_in_insert function for Postgres
+ * @author Christian Grothoff
+ */
+#include "platform.h"
+#include "taler_error_codes.h"
+#include "taler_dbevents.h"
+#include "taler_pq_lib.h"
+#include "pg_wad_in_insert.h"
+#include "pg_helper.h"
+
+enum GNUNET_DB_QueryStatus
+TEH_PG_wad_in_insert (
+ void *cls,
+ const struct TALER_WadIdentifierP *wad_id,
+ const char *origin_exchange_url,
+ struct GNUNET_TIME_Timestamp execution_date,
+ const char *debit_account_uri,
+ const char *section_name,
+ uint64_t serial_id)
+{
+ // FIXME: not implemented
+ return -1;
+}
diff --git a/src/exchangedb/pg_wad_in_insert.h b/src/exchangedb/pg_wad_in_insert.h
new file mode 100644
index 000000000..0498412c0
--- /dev/null
+++ b/src/exchangedb/pg_wad_in_insert.h
@@ -0,0 +1,51 @@
+/*
+ This file is part of TALER
+ Copyright (C) 2024 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.
+
+ 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
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+/**
+ * @file exchangedb/pg_wad_in_insert.h
+ * @brief implementation of the wad_in_insert function for Postgres
+ * @author Christian Grothoff
+ */
+#ifndef PG_WAD_IN_INSERT_H
+#define PG_WAD_IN_INSERT_H
+
+#include "taler_util.h"
+#include "taler_json_lib.h"
+#include "taler_exchangedb_plugin.h"
+
+
+/**
+ * Insert an incoming WAD wire transfer into the database.
+ *
+ * @param cls the @e cls of this struct with the plugin-specific state
+ * @param wad_id WAD identifier
+ * @param origin_exchange_url exchange base URL originating the transfer
+ * @param execution_date when was the transfer made
+ * @param debit_account_uri URI of the debit account
+ * @param section_name section of the exchange bank account that received the transfer
+ * @param serial_id bank-specific row identifying the transfer
+ */
+enum GNUNET_DB_QueryStatus
+TEH_PG_wad_in_insert (
+ void *cls,
+ const struct TALER_WadIdentifierP *wad_id,
+ const char *origin_exchange_url,
+ struct GNUNET_TIME_Timestamp execution_date,
+ const char *debit_account_uri,
+ const char *section_name,
+ uint64_t serial_id);
+
+
+#endif
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c
index aad3e1cd9..c9ea6a752 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -70,6 +70,8 @@
#include "pg_preflight.h"
#include "pg_select_aml_statistics.h"
#include "pg_commit.h"
+#include "pg_wad_in_insert.h"
+#include "pg_kycauth_in_insert.h"
#include "pg_drop_tables.h"
#include "pg_get_kyc_rules.h"
#include "pg_select_aggregation_amounts_for_kyc_check.h"
@@ -593,6 +595,10 @@ libtaler_plugin_exchangedb_postgres_init (void *cls)
= &TEH_PG_do_age_withdraw;
plugin->get_age_withdraw
= &TEH_PG_get_age_withdraw;
+ plugin->wad_in_insert
+ = &TEH_PG_wad_in_insert;
+ plugin->kycauth_in_insert
+ = &TEH_PG_kycauth_in_insert;
plugin->get_policy_details
= &TEH_PG_get_policy_details;
plugin->persist_policy_details