summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_get-tips-ID.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/taler-merchant-httpd_get-tips-ID.c')
-rw-r--r--src/backend/taler-merchant-httpd_get-tips-ID.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/backend/taler-merchant-httpd_get-tips-ID.c b/src/backend/taler-merchant-httpd_get-tips-ID.c
index 5b0abd89..4b4b2858 100644
--- a/src/backend/taler-merchant-httpd_get-tips-ID.c
+++ b/src/backend/taler-merchant-httpd_get-tips-ID.c
@@ -159,7 +159,7 @@ TMH_get_tips_ID (const struct TMH_RequestHandler *rh,
enum GNUNET_DB_QueryStatus qs;
struct TALER_Amount total_authorized;
struct TALER_Amount total_picked_up;
- struct GNUNET_TIME_Absolute expiration;
+ struct GNUNET_TIME_Timestamp expiration;
char *exchange_url;
struct TALER_ReservePrivateKeyP reserve_priv;
@@ -210,15 +210,12 @@ TMH_get_tips_ID (const struct TMH_RequestHandler *rh,
/* Build response */
{
struct TALER_Amount remaining;
- struct GNUNET_TIME_Absolute expiration_round = expiration;
MHD_RESULT ret;
GNUNET_break (0 <=
TALER_amount_subtract (&remaining,
&total_authorized,
&total_picked_up));
-
- GNUNET_TIME_round_abs (&expiration_round);
if (TMH_MHD_test_html_desired (connection))
{
char *qr;
@@ -274,16 +271,15 @@ TMH_get_tips_ID (const struct TMH_RequestHandler *rh,
{
ret = TALER_MHD_REPLY_JSON_PACK (
connection,
- ( (0 == remaining.value) &&
- (0 == remaining.fraction) )
+ TALER_amount_is_zero (&remaining)
? MHD_HTTP_GONE
: MHD_HTTP_OK,
GNUNET_JSON_pack_string ("exchange_url",
exchange_url),
TALER_JSON_pack_amount ("tip_amount",
&remaining),
- GNUNET_JSON_pack_time_abs ("expiration",
- expiration_round));
+ GNUNET_JSON_pack_timestamp ("expiration",
+ expiration));
}
GNUNET_free (exchange_url);
return ret;