summaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorJonathan Buchanan <jonathan.russ.buchanan@gmail.com>2020-07-31 03:54:39 -0400
committerJonathan Buchanan <jonathan.russ.buchanan@gmail.com>2020-07-31 03:54:39 -0400
commit9a1369603bd98944d8276989e36a78ec9a84b247 (patch)
tree502e995a232582628e8270b2daf45c83c8bae166 /src/testing
parentce384765f5457233f3b46e48fe77c339cc5784c1 (diff)
downloadmerchant-9a1369603bd98944d8276989e36a78ec9a84b247.tar.gz
merchant-9a1369603bd98944d8276989e36a78ec9a84b247.tar.bz2
merchant-9a1369603bd98944d8276989e36a78ec9a84b247.zip
test order without claim token
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/test_merchant_api.c15
-rw-r--r--src/testing/testing_api_cmd_post_orders.c12
2 files changed, 24 insertions, 3 deletions
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
@@ -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,