aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_kyc_check_get.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-09-08 23:13:54 +0200
committerChristian Grothoff <christian@grothoff.org>2024-09-08 23:13:54 +0200
commit735574522eddea9f5c94f4c4922674d8fa9ba88d (patch)
tree895489af289f806c3c8347ceb661c5e42b31d4a4 /src/testing/testing_api_cmd_kyc_check_get.c
parent4aa9f87fe66d02c65c652e1de4c25d93e5368d56 (diff)
fix /kyc-check long-polling logic
Diffstat (limited to 'src/testing/testing_api_cmd_kyc_check_get.c')
-rw-r--r--src/testing/testing_api_cmd_kyc_check_get.c37
1 files changed, 24 insertions, 13 deletions
diff --git a/src/testing/testing_api_cmd_kyc_check_get.c b/src/testing/testing_api_cmd_kyc_check_get.c
index 7d0ce06b1..fa0556d47 100644
--- a/src/testing/testing_api_cmd_kyc_check_get.c
+++ b/src/testing/testing_api_cmd_kyc_check_get.c
@@ -34,6 +34,22 @@ struct KycCheckGetState
{
/**
+ * Set to the KYC URL *if* the exchange replied with
+ * a request for KYC (#MHD_HTTP_ACCEPTED or #MHD_HTTP_OK).
+ */
+ struct TALER_AccountAccessTokenP access_token;
+
+ /**
+ * Handle to the "track transaction" pending operation.
+ */
+ struct TALER_EXCHANGE_KycCheckHandle *kwh;
+
+ /**
+ * Interpreter state.
+ */
+ struct TALER_TESTING_Interpreter *is;
+
+ /**
* Command to get a reserve private key from.
*/
const char *payment_target_reference;
@@ -49,20 +65,10 @@ struct KycCheckGetState
unsigned int expected_response_code;
/**
- * Set to the KYC URL *if* the exchange replied with
- * a request for KYC (#MHD_HTTP_ACCEPTED or #MHD_HTTP_OK).
- */
- struct TALER_AccountAccessTokenP access_token;
-
- /**
- * Handle to the "track transaction" pending operation.
+ * What are we waiting for when long-polling?
*/
- struct TALER_EXCHANGE_KycCheckHandle *kwh;
+ enum TALER_EXCHANGE_KycLongPollTarget lpt;
- /**
- * Interpreter state.
- */
- struct TALER_TESTING_Interpreter *is;
};
@@ -171,7 +177,10 @@ check_kyc_run (void *cls,
TALER_TESTING_get_exchange_url (is),
h_payto,
account_priv,
- GNUNET_TIME_UNIT_ZERO,
+ kcg->lpt,
+ TALER_EXCHANGE_KLPT_NONE == kcg->lpt
+ ? GNUNET_TIME_UNIT_ZERO
+ : GNUNET_TIME_UNIT_MINUTES,
&check_kyc_cb,
kcg);
GNUNET_assert (NULL != kcg->kwh);
@@ -235,6 +244,7 @@ TALER_TESTING_cmd_check_kyc_get (
const char *label,
const char *payment_target_reference,
const char *account_reference,
+ enum TALER_EXCHANGE_KycLongPollTarget lpt,
unsigned int expected_response_code)
{
struct KycCheckGetState *kcg;
@@ -243,6 +253,7 @@ TALER_TESTING_cmd_check_kyc_get (
kcg->payment_target_reference = payment_target_reference;
kcg->account_reference = account_reference;
kcg->expected_response_code = expected_response_code;
+ kcg->lpt = lpt;
{
struct TALER_TESTING_Command cmd = {
.cls = kcg,