summaryrefslogtreecommitdiff
path: root/src/lib/merchant_api_get_reserve.c
diff options
context:
space:
mode:
authorJonathan Buchanan <jonathan.russ.buchanan@gmail.com>2020-06-15 21:08:33 -0400
committerJonathan Buchanan <jonathan.russ.buchanan@gmail.com>2020-06-15 21:08:33 -0400
commit63c035bfffaec9b245da58828f7d6504278fc46e (patch)
treed0cf387fb1545bfcfb5f413236d92b6033ef721e /src/lib/merchant_api_get_reserve.c
parent1d22e4f8b263446f24fbdb3d2b92f7c1f2939f48 (diff)
downloadmerchant-63c035bfffaec9b245da58828f7d6504278fc46e.tar.gz
merchant-63c035bfffaec9b245da58828f7d6504278fc46e.tar.bz2
merchant-63c035bfffaec9b245da58828f7d6504278fc46e.zip
test for GET /private/reserves/
Diffstat (limited to 'src/lib/merchant_api_get_reserve.c')
-rw-r--r--src/lib/merchant_api_get_reserve.c17
1 files changed, 7 insertions, 10 deletions
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,