summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpriscilla <priscilla.huang@efrei.net>2023-03-29 10:39:34 -0400
committerpriscilla <priscilla.huang@efrei.net>2023-03-29 10:39:34 -0400
commit4e20744115a75d2fdb3cae2351cd873a9a8441ce (patch)
treed7b5cbe785a7b893050d56262caa6d0a830a6bb4
parent8e104cfe8a419099e36a8c992f5523e2f0852aee (diff)
downloadmerchant-4e20744115a75d2fdb3cae2351cd873a9a8441ce.tar.gz
merchant-4e20744115a75d2fdb3cae2351cd873a9a8441ce.tar.bz2
merchant-4e20744115a75d2fdb3cae2351cd873a9a8441ce.zip
update pay order / using templates for test case totp
-rw-r--r--src/testing/test_merchant_api.c6
-rw-r--r--src/testing/testing_api_cmd_post_templates.c2
-rw-r--r--src/testing/testing_api_cmd_post_using_templates.c14
3 files changed, 17 insertions, 5 deletions
diff --git a/src/testing/test_merchant_api.c b/src/testing/test_merchant_api.c
index b7d8518e..6c8e5abd 100644
--- a/src/testing/test_merchant_api.c
+++ b/src/testing/test_merchant_api.c
@@ -1363,7 +1363,7 @@ run (void *cls,
"template-2",
"another template",
NULL,
- TALER_MCA_WITH_PRICE,
+ TALER_MCA_NONE,
GNUNET_JSON_PACK (
GNUNET_JSON_pack_uint64 ("minimum_age", 0),
GNUNET_JSON_pack_time_rel ("pay_duration",
@@ -1397,7 +1397,7 @@ run (void *cls,
"template-amount",
"a different template with an amount",
NULL,
- TALER_MCA_WITHOUT_PRICE,
+ TALER_MCA_NONE,
GNUNET_JSON_PACK (
GNUNET_JSON_pack_uint64 ("minimum_age", 0),
GNUNET_JSON_pack_time_rel ("pay_duration",
@@ -1445,7 +1445,7 @@ run (void *cls,
MHD_HTTP_OK,
"using-templates-t1",
"withdraw-coin-10a;withdraw-coin-10b",
- "EUR:10",
+ "EUR:9.99",
"EUR:9",
NULL),
TALER_TESTING_cmd_merchant_delete_template ("get-templates-empty",
diff --git a/src/testing/testing_api_cmd_post_templates.c b/src/testing/testing_api_cmd_post_templates.c
index 2def21ea..15a09125 100644
--- a/src/testing/testing_api_cmd_post_templates.c
+++ b/src/testing/testing_api_cmd_post_templates.c
@@ -269,7 +269,7 @@ TALER_TESTING_cmd_merchant_post_templates (const char *label,
template_id,
template_description,
NULL,
- TALER_MCA_WITHOUT_PRICE,
+ TALER_MCA_NONE,
GNUNET_JSON_PACK (
GNUNET_JSON_pack_uint64 ("minimum_age", 0),
GNUNET_JSON_pack_time_rel ("pay_duration",
diff --git a/src/testing/testing_api_cmd_post_using_templates.c b/src/testing/testing_api_cmd_post_using_templates.c
index 62473b23..88fe9f9b 100644
--- a/src/testing/testing_api_cmd_post_using_templates.c
+++ b/src/testing/testing_api_cmd_post_using_templates.c
@@ -132,6 +132,11 @@ struct PostUsingTemplatesState
const char **template_pos_key;
/**
+ * Option that add amount of the order
+ */
+ const enum TALER_MerchantConfirmationAlgorithm *template_pos_alg;
+
+ /**
* Expected HTTP response code.
*/
unsigned int http_status;
@@ -349,10 +354,16 @@ post_using_templates_run (void *cls,
TALER_TESTING_get_trait_template_id (ref,
&template_id))
TALER_TESTING_FAIL (is);
+
if (GNUNET_OK !=
TALER_TESTING_get_trait_template_pos_key (ref,
&tis->template_pos_key))
TALER_TESTING_FAIL (is);
+
+ if (GNUNET_OK !=
+ TALER_TESTING_get_trait_template_pos_alg (ref,
+ &tis->template_pos_alg))
+ TALER_TESTING_FAIL (is);
tis->iph = TALER_MERCHANT_using_templates_post (
is->ctx,
tis->merchant_url,
@@ -393,7 +404,8 @@ post_using_templates_traits (void *cls,
TALER_TESTING_make_trait_merchant_pub (&pts->merchant_pub),
TALER_TESTING_make_trait_claim_nonce (&pts->nonce),
TALER_TESTING_make_trait_claim_token (&pts->claim_token),
- TALER_TESTING_make_trait_template_pos_key (pts->template_pos_key), // extract from template creation CMD
+ TALER_TESTING_make_trait_template_pos_key (&pts->template_pos_key), // extract from template creation CMD
+ TALER_TESTING_make_trait_template_pos_alg (&pts->template_pos_alg),
TALER_TESTING_trait_end (),
};