exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 70994304ed12d6a595c2a79b251f6f7fae364065
parent 8a8d55a376551750891c9a73e6d219665a3acb5c
Author: Christian Grothoff <christian@grothoff.org>
Date:   Thu,  2 Jan 2025 12:30:49 +0100

store actual form name instead of 'FORM' when persisting FORM upload data

Diffstat:
Msrc/exchange/taler-exchange-httpd_kyc-upload.c | 8++++++--
Msrc/include/taler_kyclogic_lib.h | 2++
Msrc/kyclogic/kyclogic_api.c | 3+++
3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_kyc-upload.c b/src/exchange/taler-exchange-httpd_kyc-upload.c @@ -479,6 +479,7 @@ TEH_handler_kyc_upload ( size_t enc_attributes_len; void *enc_attributes; const char *error_message; + char *form_name; enum TALER_ErrorCode ec; qs = TEH_plugin->lookup_completed_legitimization ( @@ -562,6 +563,7 @@ TEH_handler_kyc_upload ( ec = TALER_KYCLOGIC_check_form (jmeasures, uc->measure_index, uc->result, + &form_name, &error_message); if (TALER_EC_NONE != ec) { @@ -580,13 +582,14 @@ TEH_handler_kyc_upload ( &h_payto, uc->measure_index, uc->legitimization_measure_serial_id, - "FORM", /* FIXME: get specific form name in DB interaction above! */ + form_name, NULL, /* provider account ID */ NULL, /* provider legi ID */ &legi_process_row); if (qs <= 0) { GNUNET_break (0); + GNUNET_free (form_name); return TALER_MHD_reply_with_error ( rc->connection, MHD_HTTP_INTERNAL_SERVER_ERROR, @@ -596,11 +599,12 @@ TEH_handler_kyc_upload ( qs = TEH_kyc_store_attributes ( legi_process_row, &h_payto, - "FORM", /* FIXME: get specific form name in DB interaction above! */ + form_name, NULL /* provider account */, NULL /* provider legi ID */, GNUNET_TIME_UNIT_FOREVER_ABS, /* expiration time */ uc->result); + GNUNET_free (form_name); if (0 >= qs) { GNUNET_break (0); diff --git a/src/include/taler_kyclogic_lib.h b/src/include/taler_kyclogic_lib.h @@ -598,6 +598,7 @@ TALER_KYCLOGIC_select_measure ( * @param jmeasures a LegitimizationMeasures object * @param measure_index an index into the measures * @param form_data form data submitted for the measure + * @param[out] form_name set to the form name (on success) * @param[out] error_message set to error details * @return #TALER_EC_NONE if the form data matches the measure */ @@ -606,6 +607,7 @@ TALER_KYCLOGIC_check_form ( const json_t *jmeasures, size_t measure_index, const json_t *form_data, + char **form_name, const char **error_message); diff --git a/src/kyclogic/kyclogic_api.c b/src/kyclogic/kyclogic_api.c @@ -3782,6 +3782,7 @@ TALER_KYCLOGIC_check_form ( const json_t *jmeasures, size_t measure_index, const json_t *form_data, + char **form_name, const char **error_message) { const char *check_name; @@ -3791,6 +3792,7 @@ TALER_KYCLOGIC_check_form ( struct TALER_KYCLOGIC_AmlProgram *prog; *error_message = NULL; + *form_name = NULL; if (TALER_EC_NONE != TALER_KYCLOGIC_select_measure (jmeasures, measure_index, @@ -3835,6 +3837,7 @@ TALER_KYCLOGIC_check_form ( return TALER_EC_EXCHANGE_KYC_AML_FORM_INCOMPLETE; } } + *form_name = GNUNET_strdup (kc->details.form.name); return TALER_EC_NONE; }