aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-11-05 21:47:58 +0100
committerFlorian Dold <florian@dold.me>2024-11-05 21:48:01 +0100
commite5001ea41d835956f67c9cc389669dd3f167489b (patch)
tree504805cfb4723158d27ab8a7fd1ab4f7a830bf03
parent971b2cadc024ece5b8ff1d54664c1c5e140a648e (diff)
merge variants of TEH_kyc_finished
This will make refactoring a bit easier, and likely TEH_kyc_finished will be replaced by two more specific variants (to run measures for a process or instantly) anyway.
-rw-r--r--src/exchange/taler-exchange-httpd_aml-decision.c2
-rw-r--r--src/exchange/taler-exchange-httpd_common_kyc.c35
-rw-r--r--src/exchange/taler-exchange-httpd_common_kyc.h45
-rw-r--r--src/exchange/taler-exchange-httpd_kyc-proof.c1
-rw-r--r--src/exchange/taler-exchange-httpd_kyc-upload.c1
-rw-r--r--src/exchange/taler-exchange-httpd_kyc-webhook.c1
6 files changed, 9 insertions, 76 deletions
diff --git a/src/exchange/taler-exchange-httpd_aml-decision.c b/src/exchange/taler-exchange-httpd_aml-decision.c
index 4f6848524..78056b28f 100644
--- a/src/exchange/taler-exchange-httpd_aml-decision.c
+++ b/src/exchange/taler-exchange-httpd_aml-decision.c
@@ -431,7 +431,7 @@ TEH_handler_post_aml_decision (
}
/* FIXME: Insert start time of KYC process' AML program */
adc->kat
- = TEH_kyc_finished2 (
+ = TEH_kyc_finished (
&rc->async_scope_id,
process_row,
instant_ms,
diff --git a/src/exchange/taler-exchange-httpd_common_kyc.c b/src/exchange/taler-exchange-httpd_common_kyc.c
index 8023c096d..4cdc5639e 100644
--- a/src/exchange/taler-exchange-httpd_common_kyc.c
+++ b/src/exchange/taler-exchange-httpd_common_kyc.c
@@ -483,7 +483,7 @@ add_kyc_history_entry (
struct TEH_KycAmlTrigger *
-TEH_kyc_finished2 (
+TEH_kyc_finished (
const struct GNUNET_AsyncScopeId *scope,
uint64_t process_row,
const struct TALER_KYCLOGIC_Measure *instant_ms,
@@ -612,37 +612,6 @@ TEH_kyc_finished2 (
}
-struct TEH_KycAmlTrigger *
-TEH_kyc_finished (
- const struct GNUNET_AsyncScopeId *scope,
- uint64_t process_row,
- const struct TALER_NormalizedPaytoHashP *account_id,
- const char *provider_name,
- 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,
- TEH_KycAmlTriggerCallback cb,
- void *cb_cls)
-{
- return TEH_kyc_finished2 (scope,
- process_row,
- NULL,
- account_id,
- provider_name,
- provider_user_id,
- provider_legitimization_id,
- expiration,
- attributes,
- http_status,
- response,
- cb,
- cb_cls);
-}
-
-
void
TEH_kyc_finished_cancel (struct TEH_KycAmlTrigger *kat)
{
@@ -1829,7 +1798,7 @@ legitimization_check_run (
GNUNET_assert (NULL != attributes);
lch->kat
- = TEH_kyc_finished2 (
+ = TEH_kyc_finished (
&lch->scope,
0LL,
instant_ms,
diff --git a/src/exchange/taler-exchange-httpd_common_kyc.h b/src/exchange/taler-exchange-httpd_common_kyc.h
index 4ac7b4d77..4e7c7e7e6 100644
--- a/src/exchange/taler-exchange-httpd_common_kyc.h
+++ b/src/exchange/taler-exchange-httpd_common_kyc.h
@@ -120,6 +120,8 @@ struct TEH_KycAmlTrigger;
*
* @param scope the HTTP request logging scope
* @param process_row legitimization process the data provided is about
+ * @param instant_measure instant measure to run, used if @a process_row is 0,
+ * otherwise must be NULL
* @param account_id account the webhook was about
* @param provider_name name of the provider with the logic that was run
* @param provider_user_id set to user ID at the provider, or NULL if not supported or unknown
@@ -136,48 +138,7 @@ struct TEH_KycAmlTrigger *
TEH_kyc_finished (
const struct GNUNET_AsyncScopeId *scope,
uint64_t process_row,
- const struct TALER_NormalizedPaytoHashP *account_id,
- const char *provider_name,
- 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,
- TEH_KycAmlTriggerCallback cb,
- void *cb_cls);
-
-/**
- * We have finished a KYC process and obtained new
- * @a attributes for a given @a account_id.
- * Check with the KYC-AML trigger to see if we need
- * to initiate an AML process, and store the attributes
- * in the database. Then call @a cb.
- *
- * @param scope the HTTP request logging scope
- * @param process_row legitimization process the data provided is about,
- * or must be 0 if instant_ms is given
- * @param instant_ms instant measure to run, used if @a process_row is 0,
- * otherwise must be NULL
- * @param account_id account the webhook was about
- * @param provider_name name of the provider with 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 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, can be NULL
- * @param cb function to call with the result
- * @param cb_cls closure for @a cb
- * @return handle to cancel the operation
- */
-struct TEH_KycAmlTrigger *
-TEH_kyc_finished2 (
- const struct GNUNET_AsyncScopeId *scope,
- uint64_t process_row,
- const struct TALER_KYCLOGIC_Measure *instant_ms,
+ const struct TALER_KYCLOGIC_Measure *instant_measure,
const struct TALER_NormalizedPaytoHashP *account_id,
const char *provider_name,
const char *provider_user_id,
diff --git a/src/exchange/taler-exchange-httpd_kyc-proof.c b/src/exchange/taler-exchange-httpd_kyc-proof.c
index 6db1899a4..926770073 100644
--- a/src/exchange/taler-exchange-httpd_kyc-proof.c
+++ b/src/exchange/taler-exchange-httpd_kyc-proof.c
@@ -303,6 +303,7 @@ proof_cb (
kpc->kat = TEH_kyc_finished (
&rc->async_scope_id,
kpc->process_row,
+ NULL, /* instant_measure */
&kpc->h_payto,
kpc->provider_name,
provider_user_id,
diff --git a/src/exchange/taler-exchange-httpd_kyc-upload.c b/src/exchange/taler-exchange-httpd_kyc-upload.c
index b800dfe2a..aeeb646f0 100644
--- a/src/exchange/taler-exchange-httpd_kyc-upload.c
+++ b/src/exchange/taler-exchange-httpd_kyc-upload.c
@@ -584,6 +584,7 @@ TEH_handler_kyc_upload (
uc->kat = TEH_kyc_finished (
&rc->async_scope_id,
legi_process_row,
+ NULL, /* instant_measure */
&h_payto,
"FORM",
NULL /* provider account */,
diff --git a/src/exchange/taler-exchange-httpd_kyc-webhook.c b/src/exchange/taler-exchange-httpd_kyc-webhook.c
index af1e762c0..588143291 100644
--- a/src/exchange/taler-exchange-httpd_kyc-webhook.c
+++ b/src/exchange/taler-exchange-httpd_kyc-webhook.c
@@ -210,6 +210,7 @@ webhook_finished_cb (
kwh->kat = TEH_kyc_finished (
&kwh->rc->async_scope_id,
process_row,
+ NULL, /* instant_measure */
account_id,
provider_name,
provider_user_id,