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 (1d81c99 -> 4630d92)


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch master updated (1d81c99 -> 4630d92)
Date: Tue, 10 Jul 2018 15:56:33 +0200

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

marcello pushed a change to branch master
in repository exchange.

    from 1d81c99  note
     new dd9837f  Put logic to delete KYC events for merchant
     new 4630d92  Test last change.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/exchangedb/plugin_exchangedb_postgres.c | 37 +++++++++++++++++++++++++++++
 src/exchangedb/test_exchangedb.c            |  4 ++++
 src/include/taler_exchangedb_plugin.h       | 16 +++++++++++++
 3 files changed, 57 insertions(+)

diff --git a/src/exchangedb/plugin_exchangedb_postgres.c 
b/src/exchangedb/plugin_exchangedb_postgres.c
index a9ffbba..8aac5e4 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -1301,6 +1301,12 @@ postgres_prepare (PGconn *db_conn)
      * 7 Change KYC status flag for a merchant. V
      */
 
+    GNUNET_PQ_make_prepare ("clean_kyc_events",
+                            "DELETE"
+                            " FROM kyc_events"
+                            " WHERE merchant_serial_id=$1",
+                            1),
+
     /* Assume a merchant _unchecked_ if their events
      * are stored into the table queried below.  */
     GNUNET_PQ_make_prepare ("get_kyc_events",
@@ -6565,8 +6571,38 @@ postgres_select_deposits_missing_wire (void *cls,
 }
 
 /**
+ * Delete wire transfer records related to a particular merchant.
+ * This method would be called by the logic once that merchant
+ * gets successfully KYC checked.
+ *
+ * @param cls closure
+ * @param session DB session
+ * @param merchant_serial_id serial id of the merchant whose
+ *        KYC records have to be deleted.
+ * @return DB transaction status.
+ */
+static enum GNUNET_DB_QueryStatus
+postgres_clean_kyc_events (void *cls,
+                           struct TALER_EXCHANGEDB_Session *session,
+                           uint64_t merchant_serial_id)
+{
+  struct GNUNET_PQ_QueryParam params[] = {
+    GNUNET_PQ_query_param_uint64 (&merchant_serial_id),
+    GNUNET_PQ_query_param_end
+  };
+
+  return GNUNET_PQ_eval_prepared_non_select (session->conn,
+                                             "clean_kyc_events",
+                                             params);
+
+}
+
+
+/**
  * Mark a merchant as NOT KYC-checked.
  *
+ * @param cls closure
+ * @param session DB session
  * @param payto_url payto:// URL indentifying the merchant
  *        to unmark.  Note, different banks may have different
  *        policies to check their customers.
@@ -6944,6 +6980,7 @@ libtaler_plugin_exchangedb_postgres_init (void *cls)
   plugin->get_kyc_status = postgres_get_kyc_status;
   plugin->insert_kyc_event = postgres_insert_kyc_event;
   plugin->get_kyc_events = postgres_get_kyc_events;
+  plugin->clean_kyc_events = postgres_clean_kyc_events;
 
   return plugin;
 }
diff --git a/src/exchangedb/test_exchangedb.c b/src/exchangedb/test_exchangedb.c
index 07372cf..0bff60f 100644
--- a/src/exchangedb/test_exchangedb.c
+++ b/src/exchangedb/test_exchangedb.c
@@ -390,6 +390,10 @@ kcs (void *cls,
 
   FAILIF ((50 != sum.value) || (70 != sum.fraction));
 
+  FAILIF (2 != plugin->clean_kyc_events (NULL,
+                                         session,
+                                         merchant_serial_id));
+
   drop:
     return;
 }
diff --git a/src/include/taler_exchangedb_plugin.h 
b/src/include/taler_exchangedb_plugin.h
index c0fcdae..60d1221 100644
--- a/src/include/taler_exchangedb_plugin.h
+++ b/src/include/taler_exchangedb_plugin.h
@@ -2340,6 +2340,22 @@ struct TALER_EXCHANGEDB_Plugin
                     struct TALER_EXCHANGEDB_Session *session,
                     uint64_t merchant_serial_id,
                     struct TALER_Amount *amount);
+
+  /**
+   * Delete wire transfer records related to a particular merchant.
+   * This method would be called by the logic once that merchant
+   * gets successfully KYC checked.
+   *
+   * @param cls closure
+   * @param session DB session
+   * @param merchant_serial_id serial id of the merchant whose
+   *        KYC records have to be deleted.
+   * @return DB transaction status.
+   */
+  enum GNUNET_DB_QueryStatus
+  (*clean_kyc_events)(void *cls,
+                      struct TALER_EXCHANGEDB_Session *session,
+                      uint64_t merchant_serial_id);
 };
 
 #endif /* _TALER_EXCHANGE_DB_H */

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



reply via email to

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