[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] 87/151: skeleton
From: |
gnunet |
Subject: |
[taler-exchange] 87/151: skeleton |
Date: |
Tue, 30 Jul 2024 23:37:37 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
commit aa04e4af568eb0599b8f4eb89f779ecd9d20cc25
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue Jul 16 17:47:35 2024 +0200
skeleton
---
src/exchangedb/Makefile.am | 2 ++
src/exchangedb/pg_kycauth_in_insert.c | 39 ++++++++++++++++++++++
src/exchangedb/pg_kycauth_in_insert.h | 50 ++++++++++++++++++++++++++++
src/exchangedb/pg_wad_in_insert.c | 40 ++++++++++++++++++++++
src/exchangedb/pg_wad_in_insert.h | 51 +++++++++++++++++++++++++++++
src/exchangedb/plugin_exchangedb_postgres.c | 6 ++++
6 files changed, 188 insertions(+)
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
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-exchange] 57/151: handle POST aml /decision, (continued)
- [taler-exchange] 57/151: handle POST aml /decision, gnunet, 2024/07/30
- [taler-exchange] 61/151: work on more GET handlers, gnunet, 2024/07/30
- [taler-exchange] 25/151: get reserves_purse to compile, gnunet, 2024/07/30
- [taler-exchange] 26/151: fix kyc-wallet handler, gnunet, 2024/07/30
- [taler-exchange] 40/151: work on kyc API, gnunet, 2024/07/30
- [taler-exchange] 84/151: add account_sig for authorization, gnunet, 2024/07/30
- [taler-exchange] 19/151: -fix comment, gnunet, 2024/07/30
- [taler-exchange] 60/151: implement TALER_EXCHANGE_lookup_kyc_attributes, gnunet, 2024/07/30
- [taler-exchange] 36/151: store provider_name, instead of provider_section, gnunet, 2024/07/30
- [taler-exchange] 48/151: add spa logic, gnunet, 2024/07/30
- [taler-exchange] 87/151: skeleton,
gnunet <=
- [taler-exchange] 78/151: WIP: kyc-start, gnunet, 2024/07/30
- [taler-exchange] 47/151: -towards having 3 SPAs, gnunet, 2024/07/30
- [taler-exchange] 112/151: more bugfixes, gnunet, 2024/07/30
- [taler-exchange] 24/151: fix purses_merge, gnunet, 2024/07/30
- [taler-exchange] 22/151: basic refactoring of httpd for new AML, incomplete, gnunet, 2024/07/30
- [taler-exchange] 27/151: -fix more build issues, gnunet, 2024/07/30
- [taler-exchange] 98/151: add logic to parse measures from configuration, gnunet, 2024/07/30
- [taler-exchange] 35/151: fix FTBFS, gnunet, 2024/07/30
- [taler-exchange] 79/151: -bump gana, gnunet, 2024/07/30
- [taler-exchange] 89/151: -improve logging, gnunet, 2024/07/30