summaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/test_kyc_api.c16
-rw-r--r--src/testing/test_merchant_api.c9
-rw-r--r--src/testing/testing_api_cmd_kyc_get.c19
-rw-r--r--src/testing/testing_api_cmd_merchant_get_order.c6
4 files changed, 37 insertions, 13 deletions
diff --git a/src/testing/test_kyc_api.c b/src/testing/test_kyc_api.c
index bacf0586..cde93368 100644
--- a/src/testing/test_kyc_api.c
+++ b/src/testing/test_kyc_api.c
@@ -222,6 +222,22 @@ run (void *cls,
CMD_EXEC_AGGREGATOR ("run-aggregator"),
/* KYC: hence nothing happened at the bank yet: */
TALER_TESTING_cmd_check_bank_empty ("check_bank_empty-2"),
+ /* KYC: we don't even know the legitimization UUID yet */
+ TALER_TESTING_cmd_merchant_kyc_get ("kyc-pending",
+ merchant_url,
+ NULL,
+ NULL,
+ EXCHANGE_URL,
+ MHD_HTTP_SERVICE_UNAVAILABLE),
+ /* now we get the legi UUID */
+ TALER_TESTING_cmd_merchant_get_order ("get-order-kyc",
+ merchant_url,
+ "create-proposal-1",
+ TALER_MERCHANT_OSC_PAID,
+ false,
+ MHD_HTTP_OK,
+ NULL),
+ /* Now we should get a status of pending */
TALER_TESTING_cmd_merchant_kyc_get ("kyc-pending",
merchant_url,
NULL,
diff --git a/src/testing/test_merchant_api.c b/src/testing/test_merchant_api.c
index 3a32a981..9d9802a6 100644
--- a/src/testing/test_merchant_api.c
+++ b/src/testing/test_merchant_api.c
@@ -242,7 +242,8 @@ run (void *cls,
"create-proposal-4",
TALER_MERCHANT_OSC_UNPAID,
false,
- MHD_HTTP_OK),
+ MHD_HTTP_OK,
+ NULL),
TALER_TESTING_cmd_merchant_delete_order ("delete-order-4",
merchant_url,
"4",
@@ -381,7 +382,8 @@ run (void *cls,
"create-proposal-1",
TALER_MERCHANT_OSC_CLAIMED,
false,
- MHD_HTTP_OK),
+ MHD_HTTP_OK,
+ NULL),
TALER_TESTING_cmd_wallet_poll_order_start ("poll-order-wallet-start-1",
merchant_url,
"create-proposal-1",
@@ -435,7 +437,8 @@ run (void *cls,
"create-proposal-1",
TALER_MERCHANT_OSC_PAID,
false,
- MHD_HTTP_OK),
+ MHD_HTTP_OK,
+ NULL),
TALER_TESTING_cmd_merchant_get_orders ("get-orders-1-paid",
merchant_url,
MHD_HTTP_OK,
diff --git a/src/testing/testing_api_cmd_kyc_get.c b/src/testing/testing_api_cmd_kyc_get.c
index f35a0028..f6f947df 100644
--- a/src/testing/testing_api_cmd_kyc_get.c
+++ b/src/testing/testing_api_cmd_kyc_get.c
@@ -133,6 +133,7 @@ kyc_get_cb (void *cls,
const char *end;
char *dec;
const char *eq;
+ const char *nq;
size_t toklen;
url = kr->details.kyc_status.pending_kycs[0].kyc_url;
@@ -148,7 +149,18 @@ kyc_get_cb (void *cls,
(void) GNUNET_STRINGS_urldecode (tok,
toklen,
&dec);
- eq = strrchr (dec, '/');
+ eq = strstr (dec, "/kyc-proof/");
+ if (NULL == eq)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Received unexpected KYC URL `%s' (%s)\n",
+ url,
+ dec);
+ GNUNET_free (dec);
+ TALER_TESTING_FAIL (cs->is);
+ }
+ eq += strlen ("/kyc-proof/");
+ nq = strchr (eq, '/');
if (NULL == eq)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -158,10 +170,9 @@ kyc_get_cb (void *cls,
GNUNET_free (dec);
TALER_TESTING_FAIL (cs->is);
}
- eq++;
if (GNUNET_OK !=
GNUNET_STRINGS_string_to_data (eq,
- strlen (eq),
+ nq - eq,
&cs->h_payto,
sizeof (cs->h_payto)))
{
@@ -257,7 +268,7 @@ kyc_get_traits (void *cls,
{
struct KycGetState *cs = cls;
struct TALER_TESTING_Trait traits[] = {
- TALER_TESTING_make_trait_h_payto (
+ TALER_TESTING_make_trait_h_payto (
&cs->h_payto),
TALER_TESTING_trait_end ()
};
diff --git a/src/testing/testing_api_cmd_merchant_get_order.c b/src/testing/testing_api_cmd_merchant_get_order.c
index 8001ac43..467b6d61 100644
--- a/src/testing/testing_api_cmd_merchant_get_order.c
+++ b/src/testing/testing_api_cmd_merchant_get_order.c
@@ -693,12 +693,6 @@ TALER_TESTING_cmd_merchant_get_order2 (const char *label,
gos->wired = wired;
gos->refunded = refunded;
gos->http_status = http_status;
- gos->transfers = NULL;
- gos->transfers_length = 0;
- gos->refunds = NULL;
- gos->refunds_length = 0;
- gos->forgets = NULL;
- gos->forgets_length = 0;
if (wired)
{
for (const char **clabel = transfers; *clabel != NULL; ++clabel)