aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_kyc_proof.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-08-11 23:35:33 +0200
committerChristian Grothoff <christian@grothoff.org>2022-08-11 23:35:33 +0200
commit1009084e94b8e8cf19e3b5568c3cccaba2bd2209 (patch)
treea346997dedd05f685ba7addc59e288dfa550ad0e /src/testing/testing_api_cmd_kyc_proof.c
parentb061ea85c84facfc78c34edface367c5f040bc9c (diff)
downloadexchange-1009084e94b8e8cf19e3b5568c3cccaba2bd2209.tar.xz
major rework of the KYC logic, making it more configurable, not complete, but tests pass again
Diffstat (limited to 'src/testing/testing_api_cmd_kyc_proof.c')
-rw-r--r--src/testing/testing_api_cmd_kyc_proof.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/src/testing/testing_api_cmd_kyc_proof.c b/src/testing/testing_api_cmd_kyc_proof.c
index f9a65afb3..52fb65219 100644
--- a/src/testing/testing_api_cmd_kyc_proof.c
+++ b/src/testing/testing_api_cmd_kyc_proof.c
@@ -49,6 +49,11 @@ struct KycProofGetState
const char *state;
/**
+ * Logic section name to pass to `/kyc-proof/` handler.
+ */
+ const char *logic;
+
+ /**
* Expected HTTP response code.
*/
unsigned int expected_response_code;
@@ -133,6 +138,7 @@ proof_kyc_run (void *cls,
const struct TALER_TESTING_Command *res_cmd;
const char **payto_uri;
struct TALER_PaytoHashP h_payto;
+ char *uargs;
(void) cmd;
kps->is = is;
@@ -169,12 +175,17 @@ proof_kyc_run (void *cls,
TALER_payto_hash (*payto_uri,
&h_payto);
}
+ GNUNET_asprintf (&uargs,
+ "?code=%s&state=%s",
+ kps->code,
+ kps->state);
kps->kph = TALER_EXCHANGE_kyc_proof (is->exchange,
&h_payto,
- kps->code,
- kps->state,
+ kps->logic,
+ uargs,
&proof_kyc_cb,
kps);
+ GNUNET_free (uargs);
GNUNET_assert (NULL != kps->kph);
}
@@ -236,17 +247,20 @@ proof_kyc_traits (void *cls,
struct TALER_TESTING_Command
-TALER_TESTING_cmd_proof_kyc (const char *label,
- const char *payment_target_reference,
- const char *code,
- const char *state,
- unsigned int expected_response_code)
+TALER_TESTING_cmd_proof_kyc_oauth2 (
+ const char *label,
+ const char *payment_target_reference,
+ const char *logic_section,
+ const char *code,
+ const char *state,
+ unsigned int expected_response_code)
{
struct KycProofGetState *kps;
kps = GNUNET_new (struct KycProofGetState);
kps->code = code;
kps->state = state;
+ kps->logic = logic_section;
kps->payment_target_reference = payment_target_reference;
kps->expected_response_code = expected_response_code;
{