gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-exchange] branch master updated: Method to mark a me


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch master updated: Method to mark a merchant as NOT KYC-checked.
Date: Mon, 09 Jul 2018 10:55:53 +0200

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 01158a4  Method to mark a merchant as NOT KYC-checked.
01158a4 is described below

commit 01158a48171d6dbfddec1cf274b70d2e730a1a04
Author: Marcello Stanisci <address@hidden>
AuthorDate: Mon Jul 9 10:55:31 2018 +0200

    Method to mark a merchant as NOT KYC-checked.
---
 src/exchangedb/plugin_exchangedb_postgres.c | 46 +++++++++++++++++++++++++----
 src/exchangedb/test_exchangedb.c            | 14 ++++++++-
 src/include/taler_exchangedb_plugin.h       | 15 ++++++++++
 3 files changed, 69 insertions(+), 6 deletions(-)

diff --git a/src/exchangedb/plugin_exchangedb_postgres.c 
b/src/exchangedb/plugin_exchangedb_postgres.c
index 6d0889c..dbd2948 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"
@@ -6532,17 +6540,44 @@ postgres_select_deposits_missing_wire (void *cls,
 }
 
 /**
+ * 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;
diff --git a/src/exchangedb/test_exchangedb.c b/src/exchangedb/test_exchangedb.c
index 06b0372..535077f 100644
--- a/src/exchangedb/test_exchangedb.c
+++ b/src/exchangedb/test_exchangedb.c
@@ -2199,9 +2199,21 @@ run (void *cls)
                                     session,
                                     "payto://mock",
                                     &kyc_checked));
-    FAILIF (GNUNET_YES != kyc_checked);
+    FAILIF (GNUNET_NO == kyc_checked); 
 
+    FAILIF (GNUNET_OK !=
+            plugin->unmark_kyc_merchant (NULL,
+                                         session,
+                                         "payto://mock"));
+    FAILIF (GNUNET_OK !=
+            plugin->get_kyc_status (NULL,
+                                    session,
+                                    "payto://mock",
+                                    &kyc_checked));
+
+    FAILIF (GNUNET_YES == kyc_checked); 
   }
+
   plugin->preflight (plugin->cls,
                      session);
 
diff --git a/src/include/taler_exchangedb_plugin.h 
b/src/include/taler_exchangedb_plugin.h
index 8c67d97..80814ef 100644
--- a/src/include/taler_exchangedb_plugin.h
+++ b/src/include/taler_exchangedb_plugin.h
@@ -2248,6 +2248,21 @@ struct TALER_EXCHANGEDB_Plugin
                         struct TALER_EXCHANGEDB_Session *session,
                         const char *payto_url);
 
+
+  /**
+   * 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.
+   */
+  enum GNUNET_DB_QueryStatus
+  (*unmark_kyc_merchant) (void *cls,
+                          struct TALER_EXCHANGEDB_Session *session,
+                          const char *payto_url);
+
+
   /**
    * Retrieve KYC-check status related to a particular merchant.
    *

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]