From 01158a48171d6dbfddec1cf274b70d2e730a1a04 Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Mon, 9 Jul 2018 10:55:31 +0200 Subject: Method to mark a merchant as NOT KYC-checked. --- src/exchangedb/plugin_exchangedb_postgres.c | 46 +++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 5 deletions(-) (limited to 'src/exchangedb/plugin_exchangedb_postgres.c') diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c index 6d0889c80..dbd29481b 100644 --- a/src/exchangedb/plugin_exchangedb_postgres.c +++ b/src/exchangedb/plugin_exchangedb_postgres.c @@ -1294,7 +1294,7 @@ postgres_prepare (PGconn *db_conn) * * 1 Sum money flow for a (unchecked) merchant. * 2 Change KYC status for a merchant. - * 3 Get KYC status for a merchant. -- + * 3 Get KYC status for a merchant. V * 4 Put money flow event for a merchant. * 5 Delete money flow records for a fresh-checked merchant. * 6 Put a merchant. V @@ -1314,6 +1314,14 @@ postgres_prepare (PGconn *db_conn) "($1, FALSE)", 1), + GNUNET_PQ_make_prepare ("unmark_kyc_merchant", + "UPDATE kyc_merchants" + " SET" + " kyc_checked=FALSE" + " WHERE" + " payto_url=$1", + 1), + GNUNET_PQ_make_prepare ("mark_kyc_merchant", "UPDATE kyc_merchants" " SET" @@ -6531,18 +6539,45 @@ postgres_select_deposits_missing_wire (void *cls, return qs; } +/** + * Mark a merchant as NOT KYC-checked. + * + * @param payto_url payto:// URL indentifying the merchant + * to unmark. Note, different banks may have different + * policies to check their customers. + * @return database transaction status. + */ +static enum GNUNET_DB_QueryStatus +postgres_unmark_kyc_merchant + (void *cls, + struct TALER_EXCHANGEDB_Session *session, + const char *payto_url) +{ + + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_string (payto_url), + GNUNET_PQ_query_param_end + }; + + return GNUNET_PQ_eval_prepared_non_select + (session->conn, + "unmark_kyc_merchant", + params); +} + /** * Mark a merchant as KYC-checked. * * @param payto_url payto:// URL indentifying the merchant - * to check. Note, different banks may have different + * to mark. Note, different banks may have different * policies to check their customers. * @return database transaction status. */ static enum GNUNET_DB_QueryStatus -postgres_mark_kyc_merchant (void *cls, - struct TALER_EXCHANGEDB_Session *session, - const char *payto_url) +postgres_mark_kyc_merchant + (void *cls, + struct TALER_EXCHANGEDB_Session *session, + const char *payto_url) { struct GNUNET_PQ_QueryParam params[] = { @@ -6747,6 +6782,7 @@ libtaler_plugin_exchangedb_postgres_init (void *cls) plugin->insert_kyc_merchant = postgres_insert_kyc_merchant; plugin->mark_kyc_merchant = postgres_mark_kyc_merchant; + plugin->unmark_kyc_merchant = postgres_unmark_kyc_merchant; plugin->get_kyc_status = postgres_get_kyc_status; return plugin; -- cgit v1.2.3