summaryrefslogtreecommitdiff
path: root/src/include/taler_kyclogic_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/taler_kyclogic_lib.h')
-rw-r--r--src/include/taler_kyclogic_lib.h87
1 files changed, 56 insertions, 31 deletions
diff --git a/src/include/taler_kyclogic_lib.h b/src/include/taler_kyclogic_lib.h
index 60a7c23d2..4d0c18fa4 100644
--- a/src/include/taler_kyclogic_lib.h
+++ b/src/include/taler_kyclogic_lib.h
@@ -73,8 +73,12 @@ enum TALER_KYCLOGIC_KycTriggerEvent
/**
* Reserve is being closed by force.
*/
- TALER_KYCLOGIC_KYC_TRIGGER_RESERVE_CLOSE = 4
+ TALER_KYCLOGIC_KYC_TRIGGER_RESERVE_CLOSE = 4,
+ /**
+ * Customer withdraws coins via age-withdraw.
+ */
+ TALER_KYCLOGIC_KYC_TRIGGER_AGE_WITHDRAW = 5,
};
@@ -214,43 +218,48 @@ typedef enum GNUNET_DB_QueryStatus
* amounts involved in this type of operation
* at the given account
* @param ai_cls closure for @a ai
- * @return NULL if no check is needed,
+ * @param[out] required set to NULL if no check is needed,
* otherwise space-separated list of required checks
+ * @return transaction status
*/
-const char *
+enum GNUNET_DB_QueryStatus
TALER_KYCLOGIC_kyc_test_required (enum TALER_KYCLOGIC_KycTriggerEvent event,
const struct TALER_PaytoHashP *h_payto,
TALER_KYCLOGIC_KycSatisfiedIterator ki,
void *ki_cls,
TALER_KYCLOGIC_KycAmountIterator ai,
- void *ai_cls);
+ void *ai_cls,
+ char **required);
/**
* Check if the @a requirements are now satsified for
* @a h_payto account.
*
- * @param requirements space-spearated list of requirements
+ * @param[in,out] requirements space-spearated list of requirements,
+ * already satisfied requirements are removed from the list
* @param h_payto hash over the account
* @param[out] kyc_details if satisfied, set to what kind of
* KYC information was collected
* @param ki iterator over satisfied providers
* @param ki_cls closure for @a ki
- * @return true if the KYC check was satisfied
+ * @param[out] satisfied set to true if the KYC check was satisfied
+ * @return transaction status (from @a ki)
*/
-bool
-TALER_KYCLOGIC_check_satisfied (const char *requirements,
+enum GNUNET_DB_QueryStatus
+TALER_KYCLOGIC_check_satisfied (char **requirements,
const struct TALER_PaytoHashP *h_payto,
json_t **kyc_details,
TALER_KYCLOGIC_KycSatisfiedIterator ki,
- void *ki_cls);
+ void *ki_cls,
+ bool *satisfied);
/**
* Iterate over all thresholds that are applicable
* to a particular type of @a event
*
- * @param event tresholds to look up
+ * @param event thresholds to look up
* @param it function to call on each
* @param it_cls closure for @a it
*/
@@ -293,6 +302,29 @@ TALER_KYCLOGIC_kyc_get_details (
/**
+ * Check if a given @a check_name is a legal name (properly
+ * configured) and can be satisfied in principle.
+ *
+ * @param check_name name of the check to see if it is configured
+ * @return #GNUNET_OK if the check can be satisfied,
+ * #GNUNET_NO if the check can never be satisfied,
+ * #GNUNET_SYSERR if the type of the check is unknown
+ */
+enum GNUNET_GenericReturnValue
+TALER_KYCLOGIC_check_satisfiable (
+ const char *check_name);
+
+
+/**
+ * Return list of all KYC checks that are possible.
+ *
+ * @return JSON array of strings with the allowed KYC checks
+ */
+json_t *
+TALER_KYCLOGIC_get_satisfiable (void);
+
+
+/**
* Obtain the provider logic for a given set of @a requirements.
*
* @param requirements space-separated list of required checks
@@ -310,27 +342,6 @@ TALER_KYCLOGIC_requirements_to_logic (const char *requirements,
/**
- * Obtain attributes we collected about a user from a
- * provider.
- *
- * @param provider_section configuration section of a
- * provider that triggered KYC process for a user
- * @param provider_user_id user ID of the user at the provider
- * @param legitimization_id legitimizatin ID of a process
- * of that user at the provider
- * @param[out] attr_expiration set to when the @a attrs expire
- * @param[out] attrs attributes we have about the user
- * @return error code, #TALER_EC_NONE on success
- */
-enum TALER_ErrorCode
-TALER_KYCLOGIC_user_to_attributes (const char *provider_section,
- const char *provider_user_id,
- const char *legitimization_id,
- struct GNUNET_TIME_Timestamp *attr_expiration,
- json_t **attrs);
-
-
-/**
* Obtain the provider logic for a given @a name.
*
* @param name name of the logic or provider section
@@ -346,4 +357,18 @@ TALER_KYCLOGIC_lookup_logic (const char *name,
const char **configuration_section);
+/**
+ * Obtain array of KYC checks provided by the provider
+ * configured in @a section_name.
+ *
+ * @param section_name configuration section name
+ * @param[out] num_checks set to the length of the array
+ * @param[out] provided_checks set to an array with the
+ * names of the checks provided by this KYC provider
+ */
+void
+TALER_KYCLOGIC_lookup_checks (const char *section_name,
+ unsigned int *num_checks,
+ char ***provided_checks);
+
#endif