diff options
Diffstat (limited to 'src/include/taler_kyclogic_lib.h')
-rw-r--r-- | src/include/taler_kyclogic_lib.h | 74 |
1 files changed, 64 insertions, 10 deletions
diff --git a/src/include/taler_kyclogic_lib.h b/src/include/taler_kyclogic_lib.h index 494f7787d..4d0c18fa4 100644 --- a/src/include/taler_kyclogic_lib.h +++ b/src/include/taler_kyclogic_lib.h @@ -68,8 +68,17 @@ enum TALER_KYCLOGIC_KycTriggerEvent /** * Wallet balance exceeds threshold. */ - TALER_KYCLOGIC_KYC_TRIGGER_WALLET_BALANCE = 3 + TALER_KYCLOGIC_KYC_TRIGGER_WALLET_BALANCE = 3, + /** + * Reserve is being closed by force. + */ + TALER_KYCLOGIC_KYC_TRIGGER_RESERVE_CLOSE = 4, + + /** + * Customer withdraws coins via age-withdraw. + */ + TALER_KYCLOGIC_KYC_TRIGGER_AGE_WITHDRAW = 5, }; @@ -209,40 +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 */ @@ -285,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 @@ -317,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 |