summaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_post_products.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-04-24 19:54:50 +0200
committerChristian Grothoff <christian@grothoff.org>2020-04-24 19:54:50 +0200
commit0fa2888bc7d1095a2341e16eda59cb5085b78b67 (patch)
treec27104816a49f7906704a8de6f0fe2289bb6df32 /src/testing/testing_api_cmd_post_products.c
parent874f09525fee53e8a69f040cd3cf9b4f369fdee5 (diff)
downloadmerchant-0fa2888bc7d1095a2341e16eda59cb5085b78b67.tar.gz
merchant-0fa2888bc7d1095a2341e16eda59cb5085b78b67.tar.bz2
merchant-0fa2888bc7d1095a2341e16eda59cb5085b78b67.zip
improve API
Diffstat (limited to 'src/testing/testing_api_cmd_post_products.c')
-rw-r--r--src/testing/testing_api_cmd_post_products.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/testing/testing_api_cmd_post_products.c b/src/testing/testing_api_cmd_post_products.c
index f5fed272..8f787bc1 100644
--- a/src/testing/testing_api_cmd_post_products.c
+++ b/src/testing/testing_api_cmd_post_products.c
@@ -234,7 +234,7 @@ TALER_TESTING_cmd_merchant_post_products2 (
const char *description,
json_t *description_i18n,
const char *unit,
- const struct TALER_Amount *price,
+ const char *price,
json_t *image,
json_t *taxes,
int64_t total_stocked,
@@ -251,7 +251,9 @@ TALER_TESTING_cmd_merchant_post_products2 (
pis->description = description;
pis->description_i18n = description_i18n; /* ownership taken */
pis->unit = unit;
- pis->price = *price;
+ GNUNET_assert (GNUNET_OK ==
+ TALER_string_to_amount (price,
+ &pis->price));
pis->image = image; /* ownership taken */
pis->taxes = taxes; /* ownership taken */
pis->total_stocked = total_stocked;
@@ -290,11 +292,6 @@ TALER_TESTING_cmd_merchant_post_products (const char *label,
const char *price,
unsigned int http_status)
{
- struct TALER_Amount amount;
-
- GNUNET_assert (GNUNET_OK ==
- TALER_string_to_amount (price,
- &amount));
return TALER_TESTING_cmd_merchant_post_products2 (
label,
merchant_url,
@@ -302,7 +299,7 @@ TALER_TESTING_cmd_merchant_post_products (const char *label,
description,
json_pack ("{s:s}", "en", description),
"test-unit",
- &amount,
+ price,
json_object (),
json_object (),
4,