From 9a1369603bd98944d8276989e36a78ec9a84b247 Mon Sep 17 00:00:00 2001 From: Jonathan Buchanan Date: Fri, 31 Jul 2020 03:54:39 -0400 Subject: test order without claim token --- src/testing/test_merchant_api.c | 15 +++++++++++++++ src/testing/testing_api_cmd_post_orders.c | 12 +++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) (limited to 'src/testing') diff --git a/src/testing/test_merchant_api.c b/src/testing/test_merchant_api.c index 067616f3..6ea9901b 100644 --- a/src/testing/test_merchant_api.c +++ b/src/testing/test_merchant_api.c @@ -281,10 +281,21 @@ run (void *cls, "1", GNUNET_TIME_UNIT_ZERO_ABS, GNUNET_TIME_UNIT_FOREVER_ABS, + true, "EUR:5.0", "x-taler-bank", "", ""), + /*TALER_TESTING_cmd_merchant_post_orders2 ("create-proposal-1-idem", + merchant_url, + MHD_HTTP_OK, + "1", + GNUNET_TIME_UNIT_ZERO_ABS, + GNUNET_TIME_UNIT_FOREVER_ABS, + "EUR:5.0", + "x-taler-bank", + "", + ""),*/ TALER_TESTING_cmd_merchant_claim_order ("reclaim-1", merchant_url, MHD_HTTP_OK, @@ -498,6 +509,7 @@ run (void *cls, "order-p3", GNUNET_TIME_UNIT_ZERO_ABS, GNUNET_TIME_UNIT_FOREVER_ABS, + true, "EUR:5.0", "unsupported-wire-method", "product-3/2", @@ -508,6 +520,7 @@ run (void *cls, "order-p3", GNUNET_TIME_UNIT_ZERO_ABS, GNUNET_TIME_UNIT_FOREVER_ABS, + true, "EUR:5.0", "x-taler-bank", "unknown-product/2", @@ -519,6 +532,7 @@ run (void *cls, "order-p3", GNUNET_TIME_UNIT_ZERO_ABS, GNUNET_TIME_UNIT_FOREVER_ABS, + true, "EUR:5.0", "x-taler-bank", "product-3/24", @@ -529,6 +543,7 @@ run (void *cls, "order-p3", GNUNET_TIME_UNIT_ZERO_ABS, GNUNET_TIME_UNIT_FOREVER_ABS, + false, "EUR:5.0", "x-taler-bank", "product-3/3", diff --git a/src/testing/testing_api_cmd_post_orders.c b/src/testing/testing_api_cmd_post_orders.c index a91bc21f..f95d94ae 100644 --- a/src/testing/testing_api_cmd_post_orders.c +++ b/src/testing/testing_api_cmd_post_orders.c @@ -77,6 +77,11 @@ struct OrdersState */ struct GNUNET_CRYPTO_EddsaPublicKey nonce; + /** + * Whether to generate a claim token. + */ + bool make_claim_token; + /** * The claim token */ @@ -477,7 +482,7 @@ orders_run2 (void *cls, products, locks_length, locks, - true, + ps->make_claim_token, &order_cb, ps); json_decref (order); @@ -714,6 +719,7 @@ TALER_TESTING_cmd_merchant_post_orders (const char *label, * @param order_id the name of the order to add. * @param refund_deadline the deadline for refunds on this order. * @param pay_deadline the deadline for payment on this order. + * @param claim_token whether to generate a claim token. * @param amount the amount this order is for. * @param payment_target payment target for the order. * @param products a string indicating the products this order will be @@ -721,8 +727,6 @@ TALER_TESTING_cmd_merchant_post_orders (const char *label, * "[product_id]/[quantity];...". * @param locks a string of references to lock product commands that should * be formatted as "[lock_1];[lock_2];...". - * @param ... a NULL-terminated list of paths that should be marked as - * forgettable in the contract terms. * @return the command */ struct TALER_TESTING_Command @@ -734,6 +738,7 @@ TALER_TESTING_cmd_merchant_post_orders2 (const char *label, refund_deadline, struct GNUNET_TIME_Absolute pay_deadline, + bool claim_token, const char *amount, const char *payment_target, const char *products, @@ -754,6 +759,7 @@ TALER_TESTING_cmd_merchant_post_orders2 (const char *label, ps->products = products; ps->locks = locks; ps->with_claim = true; + ps->make_claim_token = claim_token; { struct TALER_TESTING_Command cmd = { .cls = ps, -- cgit v1.2.3