aboutsummaryrefslogtreecommitdiff
path: root/src/include/taler_merchantdb_plugin.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/taler_merchantdb_plugin.h')
-rw-r--r--src/include/taler_merchantdb_plugin.h99
1 files changed, 82 insertions, 17 deletions
diff --git a/src/include/taler_merchantdb_plugin.h b/src/include/taler_merchantdb_plugin.h
index 97079680..90681ac6 100644
--- a/src/include/taler_merchantdb_plugin.h
+++ b/src/include/taler_merchantdb_plugin.h
@@ -46,7 +46,7 @@ struct TALER_MERCHANTDB_AccountDetails
/**
* Salt value used for hashing @e payto_uri.
*/
- struct GNUNET_HashCode salt;
+ struct TALER_WireSalt salt;
/**
* Actual account address as a payto://-URI.
@@ -382,6 +382,29 @@ typedef void
/**
+ * Function called from ``account_kyc_get_status``
+ * with KYC status information for this merchant.
+ *
+ * @param cls closure
+ * @param h_wire hash of the wire account
+ * @param exchange_kyc_serial serial number for the KYC process at the exchange, 0 if unknown
+ * @param payto_uri payto:// URI of the merchant's bank account
+ * @param exchange_url base URL of the exchange for which this is a status
+ * @param last_check when did we last get an update on our KYC status from the exchange
+ * @param kyc_ok true if we satisfied the KYC requirements
+ */
+typedef void
+(*TALER_MERCHANTDB_KycCallback)(
+ void *cls,
+ const struct GNUNET_HashCode *h_wire,
+ uint64_t exchange_kyc_serial,
+ const char *payto_uri,
+ const char *exchange_url,
+ struct GNUNET_TIME_Absolute last_check,
+ bool kyc_ok);
+
+
+/**
* Results from trying to increase a refund.
*/
enum TALER_MERCHANTDB_RefundStatus
@@ -695,8 +718,8 @@ struct TALER_MERCHANTDB_Plugin
*
* @param cls closure
*/
- int
- (*connect) (void *cls);
+ enum GNUNET_GenericReturnValue
+ (*connect)(void *cls);
/**
* Drop merchant tables. Used for testcases and to reset the DB.
@@ -704,8 +727,8 @@ struct TALER_MERCHANTDB_Plugin
* @param cls closure
* @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure
*/
- int
- (*drop_tables) (void *cls);
+ enum GNUNET_GenericReturnValue
+ (*drop_tables)(void *cls);
/**
* Initialize merchant tables
@@ -713,8 +736,8 @@ struct TALER_MERCHANTDB_Plugin
* @param cls closure
* @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure
*/
- int
- (*create_tables) (void *cls);
+ enum GNUNET_GenericReturnValue
+ (*create_tables)(void *cls);
/**
* Register callback to be invoked on events of type @a es.
@@ -776,9 +799,9 @@ struct TALER_MERCHANTDB_Plugin
* must point to a constant
* @return #GNUNET_OK on success
*/
- int
- (*start) (void *cls,
- const char *name);
+ enum GNUNET_GenericReturnValue
+ (*start)(void *cls,
+ const char *name);
/**
* Start a transaction with isolation level 'read committed'.
@@ -788,9 +811,9 @@ struct TALER_MERCHANTDB_Plugin
* must point to a constant
* @return #GNUNET_OK on success
*/
- int
- (*start_read_committed) (void *cls,
- const char *name);
+ enum GNUNET_GenericReturnValue
+ (*start_read_committed)(void *cls,
+ const char *name);
/**
* Roll back the current transaction of a database connection.
@@ -928,10 +951,10 @@ struct TALER_MERCHANTDB_Plugin
* @return database result code
*/
enum GNUNET_DB_QueryStatus
- (*update_instance_auth)(void *cls,
- const char *merchant_id,
- const struct
- TALER_MERCHANTDB_InstanceAuthSettings *ias);
+ (*update_instance_auth)(
+ void *cls,
+ const char *merchant_id,
+ const struct TALER_MERCHANTDB_InstanceAuthSettings *ias);
/**
* Set an instance's account in our database to "inactive".
@@ -960,6 +983,48 @@ struct TALER_MERCHANTDB_Plugin
const char *merchant_id,
const struct GNUNET_HashCode *h_wire);
+
+ /**
+ * Check an instance's account's KYC status.
+ *
+ * @param cls closure
+ * @param merchant_id merchant backend instance ID
+ * @param h_wire hash of the wire account to check,
+ * NULL to check all accounts of the merchant
+ * @param exchange_url base URL of the exchange to check,
+ * NULL to check all exchanges
+ * @param kyc_cb KYC status callback to invoke
+ * @param kyc_cb_cls closure for @a kyc_cb
+ * @return database result code
+ */
+ enum GNUNET_DB_QueryStatus
+ (*account_kyc_get_status)(void *cls,
+ const char *merchant_id,
+ const struct GNUNET_HashCode *h_wire,
+ const char *exchange_url,
+ TALER_MERCHANTDB_KycCallback kyc_cb,
+ void *kyc_cb_cls);
+
+ /**
+ * Update an instance's account's KYC status.
+ *
+ * @param cls closure
+ * @param merchant_id merchant backend instance ID
+ * @param h_wire hash of the wire account to check
+ * @param exchange_url base URL of the exchange to check
+ * @param exchange_kyc_serial serial number for our account at the exchange (0 if unknown)
+ * @param kyc_ok current KYC status (true for satisfied)
+ * @return database result code
+ */
+ enum GNUNET_DB_QueryStatus
+ (*account_kyc_set_status)(void *cls,
+ const char *merchant_id,
+ const struct GNUNET_HashCode *h_wire,
+ const char *exchange_url,
+ uint64_t exchange_kyc_serial,
+ bool kyc_ok);
+
+
/**
* Lookup all of the products the given instance has configured.
*