From 63c035bfffaec9b245da58828f7d6504278fc46e Mon Sep 17 00:00:00 2001 From: Jonathan Buchanan Date: Mon, 15 Jun 2020 21:08:33 -0400 Subject: test for GET /private/reserves/ --- src/lib/merchant_api_get_reserve.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src/lib/merchant_api_get_reserve.c') diff --git a/src/lib/merchant_api_get_reserve.c b/src/lib/merchant_api_get_reserve.c index a836b8bf..d9f4a270 100644 --- a/src/lib/merchant_api_get_reserve.c +++ b/src/lib/merchant_api_get_reserve.c @@ -95,6 +95,10 @@ handle_reserve_get_finished (void *cls, struct TALER_MERCHANT_ReserveSummary rs; const json_t *tips; struct GNUNET_JSON_Specification spec[] = { + GNUNET_JSON_spec_absolute_time ("creation_time", + &rs.creation_time), + GNUNET_JSON_spec_absolute_time ("expiration_time", + &rs.expiration_time), TALER_JSON_spec_amount ("merchant_initial_amount", &rs.merchant_initial_amount), TALER_JSON_spec_amount ("exchange_initial_amount", @@ -103,14 +107,6 @@ handle_reserve_get_finished (void *cls, &rs.pickup_amount), TALER_JSON_spec_amount ("committed_amount", &rs.committed_amount), - GNUNET_JSON_spec_fixed_auto ("reserve_pub", - &rs.reserve_pub), - GNUNET_JSON_spec_absolute_time ("creation_time", - &rs.creation_time), - GNUNET_JSON_spec_absolute_time ("expiration_time", - &rs.expiration_time), - GNUNET_JSON_spec_bool ("active", - &rs.active), GNUNET_JSON_spec_end () }; @@ -127,7 +123,8 @@ handle_reserve_get_finished (void *cls, tips = json_object_get (json, "tips"); - if (NULL == tips) + if ((NULL == tips) || + json_is_null (tips)) { rgh->cb (rgh->cb_cls, &hr, @@ -263,7 +260,7 @@ TALER_MERCHANT_reserve_get (struct GNUNET_CURL_Context *ctx, *end = '\0'; GNUNET_snprintf (arg_str, sizeof (arg_str), - "/reserves/%s", + "private/reserves/%s", res_str); rgh->url = TALER_url_join (backend_url, arg_str, -- cgit v1.2.3