aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-10-19 21:02:04 +0200
committerChristian Grothoff <christian@grothoff.org>2021-10-19 21:02:10 +0200
commit778a402d07706462818e9c9d01520fd3d8d238d8 (patch)
tree18ffbbb763cbeaf05de595e461317d2387ae60ec /src/exchangedb
parentfa30a132a53196eec1ac731e332a075ba8b93991 (diff)
-implement more of the KYC handlers
Diffstat (limited to 'src/exchangedb')
-rw-r--r--src/exchangedb/plugin_exchangedb_postgres.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c
index 0026829da..4b3ae19d7 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -360,6 +360,12 @@ prepare_statements (struct PostgresClosure *pg)
" LIMIT 1;",
1),
#if FIXME_DD23
+ /* Used in #postgres_set_kyc_ok() */
+ GNUNET_PQ_make_prepare ("set_kyc_ok",
+ "UPDATE wire_targets"
+ " SET kyc_ok=TRUE"
+ " WHERE wire_target_serial_id=$1",
+ 1),
/* Used in #postgres_get_kyc_status() */
GNUNET_PQ_make_prepare ("get_kyc_status",
"SELECT"
@@ -3556,6 +3562,31 @@ postgres_reserves_get (void *cls,
/**
+ * Set the KYC status to "OK" for a bank account.
+ *
+ * @param cls the @e cls of this struct with the plugin-specific state
+ * @param payment_target_uuid which account has been checked
+ * @param ... possibly additional data to persist (TODO)
+ * @return transaction status
+ */
+static enum GNUNET_DB_QueryStatus
+postgres_set_kyc_ok (void *cls,
+ uint64_t payment_target_uuid,
+ ...)
+{
+ struct PostgresClosure *pg = cls;
+ struct GNUNET_PQ_QueryParam params[] = {
+ GNUNET_PQ_query_param_uint64 (&payment_target_uuid),
+ GNUNET_PQ_query_param_end
+ };
+
+ return GNUNET_PQ_eval_prepared_non_select (pg->conn,
+ "set_kyc_ok",
+ params);
+}
+
+
+/**
* Get the KYC status for a bank account.
*
* @param cls the @e cls of this struct with the plugin-specific state
@@ -11261,6 +11292,7 @@ libtaler_plugin_exchangedb_postgres_init (void *cls)
plugin->iterate_auditor_denominations =
&postgres_iterate_auditor_denominations;
plugin->reserves_get = &postgres_reserves_get;
+ plugin->set_kyc_ok = &postgres_set_kyc_ok;
plugin->get_kyc_status = &postgres_get_kyc_status;
plugin->select_kyc_status = &postgres_select_kyc_status;
plugin->inselect_wallet_kyc_status = &postgres_inselect_wallet_kyc_status;