summaryrefslogtreecommitdiff
path: root/src/testing/test_merchant_api.c
diff options
context:
space:
mode:
authorJonathan Buchanan <jonathan.russ.buchanan@gmail.com>2020-07-11 19:55:28 -0400
committerJonathan Buchanan <jonathan.russ.buchanan@gmail.com>2020-07-11 19:55:28 -0400
commitecb3a2afa27257816b34e4e959d98424ef123033 (patch)
tree7c75fe2d6e4a11357d26b24f0a3e70ba0ee4f0ce /src/testing/test_merchant_api.c
parentd299f7e7d288309dc696962edd9ce257d2c1a926 (diff)
downloadmerchant-ecb3a2afa27257816b34e4e959d98424ef123033.tar.gz
merchant-ecb3a2afa27257816b34e4e959d98424ef123033.tar.bz2
merchant-ecb3a2afa27257816b34e4e959d98424ef123033.zip
clean up testing post orders cmd
Diffstat (limited to 'src/testing/test_merchant_api.c')
-rw-r--r--src/testing/test_merchant_api.c143
1 files changed, 44 insertions, 99 deletions
diff --git a/src/testing/test_merchant_api.c b/src/testing/test_merchant_api.c
index 7f418c99..f01f93fb 100644
--- a/src/testing/test_merchant_api.c
+++ b/src/testing/test_merchant_api.c
@@ -212,15 +212,10 @@ run (void *cls,
TALER_TESTING_cmd_merchant_post_orders ("create-proposal-1",
merchant_url,
MHD_HTTP_OK,
- "{\"max_fee\":\"EUR:0.5\",\
- \"order_id\":\"1\",\
- \"refund_deadline\": {\"t_ms\": 0},\
- \"pay_deadline\": {\"t_ms\": \"never\" },\
- \"amount\":\"EUR:5.0\",\
- \"summary\": \"merchant-lib testcase\",\
- \"fulfillment_url\": \"https://example.com/\",\
- \"products\": [ {\"description\":\"ice cream\",\
- \"value\":\"{EUR:5}\"} ] }"),
+ "1",
+ GNUNET_TIME_UNIT_ZERO_ABS,
+ GNUNET_TIME_UNIT_FOREVER_ABS,
+ "EUR:5.0"),
TALER_TESTING_cmd_poll_orders_conclude ("poll-orders-1-conclude",
MHD_HTTP_OK,
"poll-orders-1-start"),
@@ -334,30 +329,20 @@ run (void *cls,
TALER_TESTING_cmd_merchant_post_orders2 ("create-proposal-p3-wm-nx",
merchant_url,
MHD_HTTP_NOT_FOUND,
- "{\"max_fee\":\"EUR:0.5\",\
- \"order_id\":\"order-p3\",\
- \"refund_deadline\": {\"t_ms\": 0},\
- \"pay_deadline\": {\"t_ms\": \"never\" },\
- \"amount\":\"EUR:5.0\",\
- \"summary\": \"merchant-lib testcase\",\
- \"fulfillment_url\": \"https://example.com/\",\
- \"products\": [ {\"description\":\"ice cream\",\
- \"value\":\"{EUR:5}\"} ] }",
+ "order-p3",
+ GNUNET_TIME_UNIT_ZERO_ABS,
+ GNUNET_TIME_UNIT_FOREVER_ABS,
+ "EUR:5.0",
"unsupported-wire-method",
"product-3/2",
""),
TALER_TESTING_cmd_merchant_post_orders2 ("create-proposal-p3-pd-nx",
merchant_url,
MHD_HTTP_NOT_FOUND,
- "{\"max_fee\":\"EUR:0.5\",\
- \"order_id\":\"order-p3\",\
- \"refund_deadline\": {\"t_ms\": 0},\
- \"pay_deadline\": {\"t_ms\": \"never\" },\
- \"amount\":\"EUR:5.0\",\
- \"summary\": \"merchant-lib testcase\",\
- \"fulfillment_url\": \"https://example.com/\",\
- \"products\": [ {\"description\":\"ice cream\",\
- \"value\":\"{EUR:5}\"} ] }",
+ "order-p3",
+ GNUNET_TIME_UNIT_ZERO_ABS,
+ GNUNET_TIME_UNIT_FOREVER_ABS,
+ "EUR:5.0",
"x-taler-bank",
"unknown-product/2",
""),
@@ -365,30 +350,20 @@ run (void *cls,
"create-proposal-p3-not-enough-stock",
merchant_url,
MHD_HTTP_GONE,
- "{\"max_fee\":\"EUR:0.5\",\
- \"order_id\":\"order-p3\",\
- \"refund_deadline\": {\"t_ms\": 0},\
- \"pay_deadline\": {\"t_ms\": \"never\" },\
- \"amount\":\"EUR:5.0\",\
- \"summary\": \"merchant-lib testcase\",\
- \"fulfillment_url\": \"https://example.com/\",\
- \"products\": [ {\"description\":\"ice cream\",\
- \"value\":\"{EUR:5}\"} ] }",
+ "order-p3",
+ GNUNET_TIME_UNIT_ZERO_ABS,
+ GNUNET_TIME_UNIT_FOREVER_ABS,
+ "EUR:5.0",
"x-taler-bank",
"product-3/24",
""),
TALER_TESTING_cmd_merchant_post_orders2 ("create-proposal-p3",
merchant_url,
MHD_HTTP_OK,
- "{\"max_fee\":\"EUR:0.5\",\
- \"order_id\":\"order-p3\",\
- \"refund_deadline\": {\"t_ms\": 0},\
- \"pay_deadline\": {\"t_ms\": \"never\" },\
- \"amount\":\"EUR:5.0\",\
- \"summary\": \"merchant-lib testcase\",\
- \"fulfillment_url\": \"https://example.com/\",\
- \"products\": [ {\"description\":\"ice cream\",\
- \"value\":\"{EUR:5}\"} ] }",
+ "order-p3",
+ GNUNET_TIME_UNIT_ZERO_ABS,
+ GNUNET_TIME_UNIT_FOREVER_ABS,
+ "EUR:5.0",
"x-taler-bank",
"product-3/3",
"lock-product-p3"),
@@ -404,15 +379,10 @@ run (void *cls,
TALER_TESTING_cmd_merchant_post_orders ("create-proposal-2",
merchant_url,
MHD_HTTP_OK,
- "{\"max_fee\":\"EUR:0.5\",\
- \"order_id\":\"2\",\
- \"refund_deadline\": {\"t_ms\": 0},\
- \"pay_deadline\": {\"t_ms\": \"never\" },\
- \"amount\":\"EUR:5.0\",\
- \"summary\": \"useful product\",\
- \"fulfillment_url\": \"https://example.com/\",\
- \"products\": [ {\"description\":\"ice cream\",\
- \"value\":\"{EUR:5}\"} ] }"),
+ "2",
+ GNUNET_TIME_UNIT_ZERO_ABS,
+ GNUNET_TIME_UNIT_FOREVER_ABS,
+ "EUR:5.0"),
TALER_TESTING_cmd_merchant_claim_order ("fetch-proposal-2",
merchant_url,
MHD_HTTP_OK,
@@ -479,15 +449,10 @@ run (void *cls,
TALER_TESTING_cmd_merchant_post_orders ("create-proposal-1r",
merchant_url,
MHD_HTTP_OK,
- "{\"max_fee\":\"EUR:0.5\",\
- \"order_id\":\"1r\",\
- \"refund_deadline\": {\"t_ms\": 0},\
- \"pay_deadline\": {\"t_ms\": \"never\" },\
- \"amount\":\"EUR:5.0\",\
- \"summary\": \"merchant-lib testcase\",\
- \"fulfillment_url\": \"https://example.com/\",\
- \"products\": [ {\"description\":\"ice cream\",\
- \"value\":\"{EUR:5}\"} ] }"),
+ "1r",
+ GNUNET_TIME_UNIT_ZERO_ABS,
+ GNUNET_TIME_UNIT_FOREVER_ABS,
+ "EUR:5.0"),
TALER_TESTING_cmd_merchant_pay_order ("pay-for-refund-1r",
merchant_url,
MHD_HTTP_OK,
@@ -558,15 +523,10 @@ run (void *cls,
TALER_TESTING_cmd_merchant_post_orders ("create-proposal-not-to-be-paid",
merchant_url,
MHD_HTTP_OK,
- "{\"max_fee\":\"EUR:0.5\",\
- \"order_id\":\"1-unpaid\",\
- \"refund_deadline\":{\"t_ms\":0},\
- \"pay_deadline\":{\"t_ms\":\"never\"},\
- \"amount\":\"EUR:5.0\",\
- \"summary\": \"useful product\",\
- \"fulfillment_url\": \"https://example.com/\",\
- \"products\": [ {\"description\":\"ice cream\",\
- \"value\":\"{EUR:5}\"} ] }"),
+ "1-unpaid",
+ GNUNET_TIME_UNIT_ZERO_ABS,
+ GNUNET_TIME_UNIT_FOREVER_ABS,
+ "EUR:5.0"),
/* Try to increase a non paid proposal. */
TALER_TESTING_cmd_merchant_order_refund ("refund-increase-unpaid-proposal",
merchant_url,
@@ -606,15 +566,10 @@ run (void *cls,
"create-proposal-unincreased-refund",
merchant_url,
MHD_HTTP_OK,
- "{\"max_fee\":\"EUR:0.5\",\
- \"order_id\":\"unincreased-proposal\",\
- \"refund_deadline\":{\"t_ms\":0},\
- \"pay_deadline\":{\"t_ms\":\"never\"},\
- \"amount\":\"EUR:5.0\",\
- \"summary\": \"merchant-lib testcase\",\
- \"fulfillment_url\": \"https://example.com/\",\
- \"products\": [ {\"description\":\"ice cream\",\
- \"value\":\"{EUR:5}\"} ] }"),
+ "unincreased-proposal",
+ GNUNET_TIME_UNIT_ZERO_ABS,
+ GNUNET_TIME_UNIT_FOREVER_ABS,
+ "EUR:5.0"),
TALER_TESTING_cmd_merchant_pay_order ("pay-unincreased-proposal",
merchant_url,
MHD_HTTP_OK,
@@ -868,15 +823,10 @@ run (void *cls,
TALER_TESTING_cmd_merchant_post_orders ("create-proposal-10",
merchant_url,
MHD_HTTP_OK,
- "{\"max_fee\":\"EUR:0.5\",\
- \"order_id\":\"10\",\
- \"refund_deadline\":{\"t_ms\":0},\
- \"pay_deadline\":{\"t_ms\":\"never\"},\
- \"amount\":\"EUR:10.0\",\
- \"summary\": \"merchant-lib testcase\",\
- \"fulfillment_url\": \"https://example.com/\",\
- \"products\": [ {\"description\":\"ice cream\",\
- \"value\":\"{EUR:10}\"} ] }"),
+ "10",
+ GNUNET_TIME_UNIT_ZERO_ABS,
+ GNUNET_TIME_UNIT_FOREVER_ABS,
+ "EUR:10.0"),
TALER_TESTING_cmd_merchant_pay_order ("pay-fail-partial-double-10",
merchant_url,
MHD_HTTP_CONFLICT,
@@ -925,15 +875,10 @@ run (void *cls,
TALER_TESTING_cmd_merchant_post_orders ("create-proposal-11",
merchant_url,
MHD_HTTP_OK,
- "{\"max_fee\":\"EUR:0.5\",\
- \"order_id\":\"11\",\
- \"refund_deadline\":{\"t_ms\":0},\
- \"pay_deadline\":{\"t_ms\":\"never\"},\
- \"amount\":\"EUR:10.0\",\
- \"summary\": \"merchant-lib testcase\",\
- \"fulfillment_url\": \"https://example.com/\",\
- \"products\": [ {\"description\":\"ice cream\",\
- \"value\":\"{EUR:10}\"} ] }"),
+ "11",
+ GNUNET_TIME_UNIT_ZERO_ABS,
+ GNUNET_TIME_UNIT_FOREVER_ABS,
+ "EUR:10.0"),
TALER_TESTING_cmd_merchant_pay_order ("pay-fail-partial-double-11-good",
merchant_url,
MHD_HTTP_NOT_ACCEPTABLE,