summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-04-24 17:53:31 +0200
committerChristian Grothoff <christian@grothoff.org>2020-04-24 17:53:31 +0200
commitf4b19c002aa3ef8054729f7e61254232d575b7a6 (patch)
tree79e8aed1c7081470a634430b17b2660568c3e4e6 /src/lib
parent0b57eac8f3b99941a11f11f35feac1926cd21d31 (diff)
downloadmerchant-f4b19c002aa3ef8054729f7e61254232d575b7a6.tar.gz
merchant-f4b19c002aa3ef8054729f7e61254232d575b7a6.tar.bz2
merchant-f4b19c002aa3ef8054729f7e61254232d575b7a6.zip
toward stesting
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/merchant_api_delete_product.c15
-rw-r--r--src/lib/merchant_api_get_product.c15
-rw-r--r--src/lib/merchant_api_get_products.c21
-rw-r--r--src/lib/merchant_api_lock_product.c15
-rw-r--r--src/lib/merchant_api_patch_product.c15
-rw-r--r--src/lib/merchant_api_post_products.c21
6 files changed, 18 insertions, 84 deletions
diff --git a/src/lib/merchant_api_delete_product.c b/src/lib/merchant_api_delete_product.c
index e00f0a34..e406581c 100644
--- a/src/lib/merchant_api_delete_product.c
+++ b/src/lib/merchant_api_delete_product.c
@@ -121,8 +121,6 @@ handle_delete_product_finished (void *cls,
*
* @param ctx the context
* @param backend_url HTTP base URL for the backend
- * @param instance_id instance to query about its products,
- * NULL to query the default instance
* @param product_id identifier of the product
* @param cb function to call with the backend's deletion status
* @param cb_cls closure for @a cb
@@ -132,7 +130,6 @@ struct TALER_MERCHANT_ProductDeleteHandle *
TALER_MERCHANT_product_delete (
struct GNUNET_CURL_Context *ctx,
const char *backend_url,
- const char *instance_id,
const char *product_id,
TALER_MERCHANT_ProductDeleteCallback cb,
void *cb_cls)
@@ -146,15 +143,9 @@ TALER_MERCHANT_product_delete (
{
char *path;
- if (NULL == instance_id)
- GNUNET_asprintf (&path,
- "products/%s",
- product_id);
- else
- GNUNET_asprintf (&path,
- "instances/%s/products/%s",
- instance_id,
- product_id);
+ GNUNET_asprintf (&path,
+ "products/%s",
+ product_id);
pdh->url = TALER_url_join (backend_url,
path,
NULL);
diff --git a/src/lib/merchant_api_get_product.c b/src/lib/merchant_api_get_product.c
index f0f7cca1..fc33dedf 100644
--- a/src/lib/merchant_api_get_product.c
+++ b/src/lib/merchant_api_get_product.c
@@ -188,8 +188,6 @@ handle_get_product_finished (void *cls,
*
* @param ctx the context
* @param backend_url HTTP base URL for the backend
- * @param instance_id instance to query about its products,
- * NULL to query the default instance
* @param product_id identifier of the product to inquire about
* @param cb function to call with the backend's product information
* @param cb_cls closure for @a cb
@@ -199,7 +197,6 @@ struct TALER_MERCHANT_ProductGetHandle *
TALER_MERCHANT_product_get (
struct GNUNET_CURL_Context *ctx,
const char *backend_url,
- const char *instance_id,
const char *product_id,
TALER_MERCHANT_ProductGetCallback cb,
void *cb_cls)
@@ -214,15 +211,9 @@ TALER_MERCHANT_product_get (
{
char *path;
- if (NULL == instance_id)
- GNUNET_asprintf (&path,
- "products/%s",
- product_id);
- else
- GNUNET_asprintf (&path,
- "instances/%s/products/%s",
- instance_id,
- product_id);
+ GNUNET_asprintf (&path,
+ "products/%s",
+ product_id);
pgh->url = TALER_url_join (backend_url,
path,
NULL);
diff --git a/src/lib/merchant_api_get_products.c b/src/lib/merchant_api_get_products.c
index 3c7eae54..86e93cdc 100644
--- a/src/lib/merchant_api_get_products.c
+++ b/src/lib/merchant_api_get_products.c
@@ -203,8 +203,6 @@ handle_get_products_finished (void *cls,
*
* @param ctx the context
* @param backend_url HTTP base URL for the backend
- * @param instance_id instance to query about its products,
- * NULL to query the default instance
* @param cb function to call with the backend's inventory information
* @param cb_cls closure for @a cb
* @return the request handle; NULL upon error
@@ -213,7 +211,6 @@ struct TALER_MERCHANT_ProductsGetHandle *
TALER_MERCHANT_products_get (
struct GNUNET_CURL_Context *ctx,
const char *backend_url,
- const char *instance_id,
TALER_MERCHANT_ProductsGetCallback cb,
void *cb_cls)
{
@@ -224,21 +221,9 @@ TALER_MERCHANT_products_get (
pgh->ctx = ctx;
pgh->cb = cb;
pgh->cb_cls = cb_cls;
- {
- char *path;
-
- if (NULL == instance_id)
- GNUNET_asprintf (&path,
- "products");
- else
- GNUNET_asprintf (&path,
- "instances/%s/products",
- instance_id);
- pgh->url = TALER_url_join (backend_url,
- path,
- NULL);
- GNUNET_free (path);
- }
+ pgh->url = TALER_url_join (backend_url,
+ "products",
+ NULL);
if (NULL == pgh->url)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
diff --git a/src/lib/merchant_api_lock_product.c b/src/lib/merchant_api_lock_product.c
index ddd5e8e3..9a831508 100644
--- a/src/lib/merchant_api_lock_product.c
+++ b/src/lib/merchant_api_lock_product.c
@@ -155,8 +155,6 @@ handle_lock_product_finished (void *cls,
*
* @param ctx the context
* @param backend_url HTTP base URL for the backend
- * @param instance_id instance to query about its products,
- * NULL to query the default instance
* @param product_id identifier of the product
* @param uuid UUID that identifies the client holding the lock
* @param duration how long should the lock be held
@@ -169,7 +167,6 @@ struct TALER_MERCHANT_ProductLockHandle *
TALER_MERCHANT_product_lock (
struct GNUNET_CURL_Context *ctx,
const char *backend_url,
- const char *instance_id,
const char *product_id,
const struct GNUNET_Uuid *uuid,
struct GNUNET_TIME_Relative duration,
@@ -199,15 +196,9 @@ TALER_MERCHANT_product_lock (
{
char *path;
- if (NULL == instance_id)
- GNUNET_asprintf (&path,
- "products/%s/lock",
- product_id);
- else
- GNUNET_asprintf (&path,
- "instances/%s/products/%s/lock",
- instance_id,
- product_id);
+ GNUNET_asprintf (&path,
+ "products/%s/lock",
+ product_id);
plh->url = TALER_url_join (backend_url,
path,
NULL);
diff --git a/src/lib/merchant_api_patch_product.c b/src/lib/merchant_api_patch_product.c
index d90ae582..9b0aead2 100644
--- a/src/lib/merchant_api_patch_product.c
+++ b/src/lib/merchant_api_patch_product.c
@@ -155,8 +155,6 @@ handle_patch_product_finished (void *cls,
*
* @param ctx the context
* @param backend_url HTTP base URL for the backend
- * @param instance_id instance to add a product to,
- * NULL to query the default instance
* @param product_id identifier to use for the product; the product must exist,
* or the transaction will fail with a #MHD_HTTP_NOT_FOUND
* HTTP status code
@@ -184,7 +182,6 @@ struct TALER_MERCHANT_ProductPatchHandle *
TALER_MERCHANT_product_patch (
struct GNUNET_CURL_Context *ctx,
const char *backend_url,
- const char *instance_id,
const char *product_id,
const char *description,
const json_t *description_i18n,
@@ -237,15 +234,9 @@ TALER_MERCHANT_product_patch (
{
char *path;
- if (NULL == instance_id)
- GNUNET_asprintf (&path,
- "products/%s",
- product_id);
- else
- GNUNET_asprintf (&path,
- "instances/%s/products/%s",
- instance_id,
- product_id);
+ GNUNET_asprintf (&path,
+ "products/%s",
+ product_id);
pph->url = TALER_url_join (backend_url,
path,
NULL);
diff --git a/src/lib/merchant_api_post_products.c b/src/lib/merchant_api_post_products.c
index b15866dc..77cc8590 100644
--- a/src/lib/merchant_api_post_products.c
+++ b/src/lib/merchant_api_post_products.c
@@ -157,8 +157,6 @@ handle_post_products_finished (void *cls,
*
* @param ctx the context
* @param backend_url HTTP base URL for the backend
- * @param instance_id instance to add a product to,
- * NULL to query the default instance
* @param product_id identifier to use for the product
* @param description description of the product
* @param description_i18n Map from IETF BCP 47 language tags to localized descriptions
@@ -181,7 +179,6 @@ struct TALER_MERCHANT_ProductsPostHandle *
TALER_MERCHANT_products_post (
struct GNUNET_CURL_Context *ctx,
const char *backend_url,
- const char *instance_id,
const char *product_id,
const char *description,
const json_t *description_i18n,
@@ -230,21 +227,9 @@ TALER_MERCHANT_products_post (
pph->ctx = ctx;
pph->cb = cb;
pph->cb_cls = cb_cls;
- {
- char *path;
-
- if (NULL == instance_id)
- GNUNET_asprintf (&path,
- "products");
- else
- GNUNET_asprintf (&path,
- "instances/%s/products",
- instance_id);
- pph->url = TALER_url_join (backend_url,
- path,
- NULL);
- GNUNET_free (path);
- }
+ pph->url = TALER_url_join (backend_url,
+ "products",
+ NULL);
if (NULL == pph->url)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,