commit 9a1369603bd98944d8276989e36a78ec9a84b247
parent ce384765f5457233f3b46e48fe77c339cc5784c1
Author: Jonathan Buchanan <jonathan.russ.buchanan@gmail.com>
Date: Fri, 31 Jul 2020 03:54:39 -0400
test order without claim token
Diffstat:
3 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/src/include/taler_merchant_testing_lib.h b/src/include/taler_merchant_testing_lib.h
@@ -525,6 +525,7 @@ TALER_TESTING_cmd_merchant_post_orders_no_claim (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
@@ -543,6 +544,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,
diff --git 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
@@ -78,6 +78,11 @@ struct OrdersState
struct GNUNET_CRYPTO_EddsaPublicKey nonce;
/**
+ * Whether to generate a claim token.
+ */
+ bool make_claim_token;
+
+ /**
* The claim token
*/
struct TALER_ClaimTokenP 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,