summaryrefslogtreecommitdiff
path: root/src/include/taler_kyclogic_plugin.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/taler_kyclogic_plugin.h')
-rw-r--r--src/include/taler_kyclogic_plugin.h43
1 files changed, 29 insertions, 14 deletions
diff --git a/src/include/taler_kyclogic_plugin.h b/src/include/taler_kyclogic_plugin.h
index 7c0ebbc43..a9a4dd97a 100644
--- a/src/include/taler_kyclogic_plugin.h
+++ b/src/include/taler_kyclogic_plugin.h
@@ -99,7 +99,13 @@ enum TALER_KYCLOGIC_KycStatus
* Return code set to not update the KYC status
* at all.
*/
- TALER_KYCLOGIC_STATUS_KEEP = 16
+ TALER_KYCLOGIC_STATUS_KEEP = 16,
+
+ /**
+ * We had an internal logic failure.
+ */
+ TALER_KYCLOGIC_STATUS_INTERNAL_ERROR = 32
+
};
@@ -156,6 +162,7 @@ typedef void
* @param status KYC status
* @param provider_user_id set to user ID at the provider, or NULL if not supported or unknown
* @param provider_legitimization_id set to legitimization process ID at the provider, or NULL if not supported or unknown
+ * @param attributes user attributes returned by the provider
* @param expiration until when is the KYC check valid
* @param http_status HTTP status code of @a response
* @param[in] response to return to the HTTP client
@@ -167,6 +174,7 @@ typedef void
const char *provider_user_id,
const char *provider_legitimization_id,
struct GNUNET_TIME_Absolute expiration,
+ const json_t *attributes,
unsigned int http_status,
struct MHD_Response *response);
@@ -178,39 +186,42 @@ typedef void
* MUST NOT be done by the plugin!
*
* @param cls closure
- * @param legi_row legitimization request the webhook was about
+ * @param process_row legitimization process the webhook was about
* @param account_id account the webhook was about
+ * @param provider_section name of the configuration section of the logic that was run
* @param provider_user_id set to user ID at the provider, or NULL if not supported or unknown
* @param provider_legitimization_id set to legitimization process ID at the provider, or NULL if not supported or unknown
* @param status KYC status
* @param expiration until when is the KYC check valid
+ * @param attributes user attributes returned by the provider
* @param http_status HTTP status code of @a response
* @param[in] response to return to the HTTP client
*/
typedef void
(*TALER_KYCLOGIC_WebhookCallback)(
void *cls,
- uint64_t legi_row,
+ uint64_t process_row,
const struct TALER_PaytoHashP *account_id,
+ const char *provider_section,
const char *provider_user_id,
const char *provider_legitimization_id,
enum TALER_KYCLOGIC_KycStatus status,
struct GNUNET_TIME_Absolute expiration,
+ const json_t *attributes,
unsigned int http_status,
struct MHD_Response *response);
/**
- * Function the plugin can use to lookup an
- * @a h_payto by @a provider_legitimization_id.
- * Must match the `kyc_provider_account_lookup`
+ * Function the plugin can use to lookup an @a h_payto by @a
+ * provider_legitimization_id. Must match the `kyc_provider_account_lookup`
* of the exchange's database plugin.
*
* @param cls closure
* @param provider_section
* @param provider_legitimization_id legi to look up
* @param[out] h_payto where to write the result
- * @param[out] legi_row where to write the row of the entry
+ * @param[out] process_row where to write the row of the entry
* @return database transaction status
*/
typedef enum GNUNET_DB_QueryStatus
@@ -219,7 +230,7 @@ typedef enum GNUNET_DB_QueryStatus
const char *provider_section,
const char *provider_legitimization_id,
struct TALER_PaytoHashP *h_payto,
- uint64_t *legi_row);
+ uint64_t *process_row);
/**
@@ -241,6 +252,12 @@ struct TALER_KYCLOGIC_Plugin
char *library_name;
/**
+ * Name of the logic, for webhook matching. Set by the
+ * plugin loader.
+ */
+ char *name;
+
+ /**
* Load the configuration of the KYC provider.
*
* @param cls closure
@@ -266,7 +283,7 @@ struct TALER_KYCLOGIC_Plugin
* @param cls the @e cls of this struct with the plugin-specific state
* @param pd provider configuration details
* @param account_id which account to trigger process for
- * @param legitimization_uuid unique ID for the legitimization process
+ * @param process_row unique ID for the legitimization process
* @param cb function to call with the result
* @param cb_cls closure for @a cb
* @return handle to cancel operation early
@@ -275,7 +292,7 @@ struct TALER_KYCLOGIC_Plugin
(*initiate)(void *cls,
const struct TALER_KYCLOGIC_ProviderDetails *pd,
const struct TALER_PaytoHashP *account_id,
- uint64_t legitimization_uuid,
+ uint64_t process_row,
TALER_KYCLOGIC_InitiateCallback cb,
void *cb_cls);
@@ -294,10 +311,9 @@ struct TALER_KYCLOGIC_Plugin
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param pd provider configuration details
- * @param url_path rest of the URL after `/kyc-webhook/$H_PAYTO/$LOGIC`
* @param connection MHD connection object (for HTTP headers)
* @param account_id which account to trigger process for
- * @param legi_row row in the table the legitimization is for
+ * @param process_row row in the legitimization processes table the legitimization is for
* @param provider_user_id user ID (or NULL) the proof is for
* @param provider_legitimization_id legitimization ID the proof is for
* @param cb function to call with the result
@@ -307,10 +323,9 @@ struct TALER_KYCLOGIC_Plugin
struct TALER_KYCLOGIC_ProofHandle *
(*proof)(void *cls,
const struct TALER_KYCLOGIC_ProviderDetails *pd,
- const char *const url_path[],
struct MHD_Connection *connection,
const struct TALER_PaytoHashP *account_id,
- uint64_t legi_row,
+ uint64_t process_row,
const char *provider_user_id,
const char *provider_legitimization_id,
TALER_KYCLOGIC_ProofCallback cb,