diff options
author | Jonathan Buchanan <jonathan.russ.buchanan@gmail.com> | 2020-06-17 21:35:09 -0400 |
---|---|---|
committer | Jonathan Buchanan <jonathan.russ.buchanan@gmail.com> | 2020-06-17 21:35:09 -0400 |
commit | 6624576c0cdd81072256d8abbfe6dd1343f956c6 (patch) | |
tree | a7f19eae242d0ee3e889da9fb4f8a00efdaf4eed /src/backend/taler-merchant-httpd_get-tips-ID.c | |
parent | 06010ba8681aa588c977410e0ae6f32879435432 (diff) |
implementations, tests, and renames for GET /tips/ & GET /private/tips/
Diffstat (limited to 'src/backend/taler-merchant-httpd_get-tips-ID.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_get-tips-ID.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/backend/taler-merchant-httpd_get-tips-ID.c b/src/backend/taler-merchant-httpd_get-tips-ID.c index fc77b2f3..52a0a561 100644 --- a/src/backend/taler-merchant-httpd_get-tips-ID.c +++ b/src/backend/taler-merchant-httpd_get-tips-ID.c @@ -95,19 +95,25 @@ TMH_get_tips_ID (const struct TMH_RequestHandler *rh, { MHD_RESULT ret; struct TALER_Amount remaining; + struct GNUNET_TIME_Absolute expiration_round = expiration; - GNUNET_break (0 >= + GNUNET_break (0 <= TALER_amount_subtract (&remaining, &total_authorized, &total_picked_up)); + + GNUNET_TIME_round_abs (&expiration_round); + ret = TALER_MHD_reply_json_pack (connection, MHD_HTTP_OK, - "{s:s, s:o, s:o, s:o}", - "exchange_url", exchange_url, + "{s:s, s:o, s:o}", + "exchange_url", + exchange_url, "tip_amount", TALER_JSON_from_amount (&remaining), "expiration", - GNUNET_JSON_from_time_abs (expiration)); + GNUNET_JSON_from_time_abs ( + expiration_round)); GNUNET_free (exchange_url); return ret; } |