summaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-02-14 14:26:00 +0100
committerChristian Grothoff <christian@grothoff.org>2023-02-14 14:26:00 +0100
commitafe3f70d336e151598e02ebedb6498e13122530e (patch)
tree16b28b9fec850465e963dd1eb2acee796d86d9f2 /src/testing
parent437e6ec86a1cd3a391de437999ad21ac5e256e68 (diff)
downloadexchange-afe3f70d336e151598e02ebedb6498e13122530e.tar.gz
exchange-afe3f70d336e151598e02ebedb6498e13122530e.tar.bz2
exchange-afe3f70d336e151598e02ebedb6498e13122530e.zip
begin API change to allow AML officers to trigger KYC process
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/test_kyc_api.c3
-rw-r--r--src/testing/testing_api_cmd_take_aml_decision.c19
2 files changed, 22 insertions, 0 deletions
diff --git a/src/testing/test_kyc_api.c b/src/testing/test_kyc_api.c
index feeed3c78..12f695690 100644
--- a/src/testing/test_kyc_api.c
+++ b/src/testing/test_kyc_api.c
@@ -448,6 +448,7 @@ run (void *cls,
"EUR:10000",
"party time",
TALER_AML_NORMAL,
+ NULL,
MHD_HTTP_FORBIDDEN),
/* Check that no decision was taken, but that we are allowed
to read this information */
@@ -468,6 +469,7 @@ run (void *cls,
"EUR:10000",
"party time",
TALER_AML_NORMAL,
+ NULL,
MHD_HTTP_NO_CONTENT),
TALER_TESTING_cmd_check_aml_decisions ("check-decisions-one-normal",
"create-aml-officer-1",
@@ -489,6 +491,7 @@ run (void *cls,
"EUR:1000",
"party over",
TALER_AML_FROZEN,
+ NULL,
MHD_HTTP_NO_CONTENT),
TALER_TESTING_cmd_check_aml_decisions ("check-decisions-one-frozen",
"create-aml-officer-1",
diff --git a/src/testing/testing_api_cmd_take_aml_decision.c b/src/testing/testing_api_cmd_take_aml_decision.c
index 0992945d6..871cdb712 100644
--- a/src/testing/testing_api_cmd_take_aml_decision.c
+++ b/src/testing/testing_api_cmd_take_aml_decision.c
@@ -73,6 +73,11 @@ struct AmlDecisionState
const char *justification;
/**
+ * KYC requirement to add.
+ */
+ const char *kyc_requirement;
+
+ /**
* Threshold transaction amount.
*/
struct TALER_Amount new_threshold;
@@ -133,6 +138,7 @@ take_aml_decision_run (void *cls,
const struct TALER_PaytoHashP *h_payto;
const struct TALER_AmlOfficerPrivateKeyP *officer_priv;
const struct TALER_TESTING_Command *ref;
+ json_t *kyc_requirements = NULL;
(void) cmd;
now = GNUNET_TIME_timestamp_get ();
@@ -160,6 +166,15 @@ take_aml_decision_run (void *cls,
TALER_TESTING_get_trait_officer_priv (ref,
&officer_priv));
ds->h_payto = *h_payto;
+ if (NULL != ds->kyc_requirement)
+ {
+ kyc_requirements = json_array ();
+ GNUNET_assert (NULL != kyc_requirements);
+ GNUNET_assert (0 ==
+ json_array_append (kyc_requirements,
+ json_string (ds->kyc_requirement)));
+ }
+
ds->dh = TALER_EXCHANGE_add_aml_decision (
is->ctx,
is->exchange_url,
@@ -168,9 +183,11 @@ take_aml_decision_run (void *cls,
&ds->new_threshold,
h_payto,
ds->new_state,
+ kyc_requirements,
officer_priv,
&take_aml_decision_cb,
ds);
+ json_decref (kyc_requirements);
if (NULL == ds->dh)
{
GNUNET_break (0);
@@ -246,6 +263,7 @@ TALER_TESTING_cmd_take_aml_decision (
const char *new_threshold,
const char *justification,
enum TALER_AmlDecisionState new_state,
+ const char *kyc_requirement,
unsigned int expected_response)
{
struct AmlDecisionState *ds;
@@ -253,6 +271,7 @@ TALER_TESTING_cmd_take_aml_decision (
ds = GNUNET_new (struct AmlDecisionState);
ds->officer_ref_cmd = ref_officer;
ds->account_ref_cmd = ref_operation;
+ ds->kyc_requirement = kyc_requirement;
if (GNUNET_OK !=
TALER_string_to_amount (new_threshold,
&ds->new_threshold))