diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-04-16 23:40:19 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-04-16 23:40:19 +0200 |
commit | 4087bfb43d20c2e7ffb553ce3823f497b307647d (patch) | |
tree | c41960090878e1bd7566594ddefee9e3382433a1 /src/backend | |
parent | 778176a664c9ecf96073ffbc2e1823a4366fd37a (diff) | |
download | merchant-4087bfb43d20c2e7ffb553ce3823f497b307647d.tar.gz merchant-4087bfb43d20c2e7ffb553ce3823f497b307647d.tar.bz2 merchant-4087bfb43d20c2e7ffb553ce3823f497b307647d.zip |
add missing currency check, fix test to use string for image
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/taler-merchant-httpd_private-patch-products-ID.c | 11 | ||||
-rw-r--r-- | src/backend/taler-merchant-httpd_private-post-products.c | 1 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/backend/taler-merchant-httpd_private-patch-products-ID.c b/src/backend/taler-merchant-httpd_private-patch-products-ID.c index d1ae5c7d..8f7f6243 100644 --- a/src/backend/taler-merchant-httpd_private-patch-products-ID.c +++ b/src/backend/taler-merchant-httpd_private-patch-products-ID.c @@ -151,6 +151,17 @@ TMH_private_patch_products_ID (const struct TMH_RequestHandler *rh, ? MHD_YES : MHD_NO; } + if (0 != + strcasecmp (pd.price.currency, + TMH_currency)) + { + GNUNET_break_op (0); + GNUNET_JSON_parse_free (spec); + return TALER_MHD_reply_with_error (connection, + MHD_HTTP_CONFLICT, + TALER_EC_GENERIC_CURRENCY_MISMATCH, + NULL); + } if (-1 == total_stock) pd.total_stock = UINT64_MAX; else diff --git a/src/backend/taler-merchant-httpd_private-post-products.c b/src/backend/taler-merchant-httpd_private-post-products.c index 9387a657..6239a653 100644 --- a/src/backend/taler-merchant-httpd_private-post-products.c +++ b/src/backend/taler-merchant-httpd_private-post-products.c @@ -131,7 +131,6 @@ TMH_private_post_products (const struct TMH_RequestHandler *rh, TALER_EC_GENERIC_CURRENCY_MISMATCH, NULL); } - if (-1 == total_stock) pd.total_stock = UINT64_MAX; else |