summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-01-31 15:37:49 +0100
committerChristian Grothoff <christian@grothoff.org>2023-01-31 15:37:49 +0100
commit0107fd64aad2dcbf5497e2b6ef751eb8ec95b934 (patch)
treeb81866a74aad7b152432ee2343eb26f78e4a6727 /src
parentbf872f712e7af196341a0aacde1c0fd70b046e72 (diff)
downloadmerchant-0107fd64aad2dcbf5497e2b6ef751eb8ec95b934.tar.gz
merchant-0107fd64aad2dcbf5497e2b6ef751eb8ec95b934.tar.bz2
merchant-0107fd64aad2dcbf5497e2b6ef751eb8ec95b934.zip
fix #7607
Diffstat (limited to 'src')
-rw-r--r--src/backend/taler-merchant-httpd_private-post-orders.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/backend/taler-merchant-httpd_private-post-orders.c b/src/backend/taler-merchant-httpd_private-post-orders.c
index bb64fb02..ad458cf4 100644
--- a/src/backend/taler-merchant-httpd_private-post-orders.c
+++ b/src/backend/taler-merchant-httpd_private-post-orders.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- (C) 2014, 2015, 2016, 2018, 2020, 2021 Taler Systems SA
+ (C) 2014-2023 Taler Systems SA
TALER is free software; you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
@@ -930,9 +930,7 @@ patch_order (struct MHD_Connection *connection,
refund_deadline)));
}
if ( (! GNUNET_TIME_absolute_is_zero (delivery_date.abs_time)) &&
- (GNUNET_TIME_timestamp_cmp (delivery_date,
- <,
- now)) )
+ (GNUNET_TIME_absolute_is_past (delivery_date.abs_time)) )
{
GNUNET_break_op (0);
GNUNET_JSON_parse_free (spec);
@@ -954,6 +952,27 @@ patch_order (struct MHD_Connection *connection,
"pay_deadline",
GNUNET_JSON_from_timestamp (t)));
}
+ else if (GNUNET_TIME_absolute_is_past (pay_deadline.abs_time))
+ {
+ GNUNET_break_op (0);
+ GNUNET_JSON_parse_free (spec);
+ return TALER_MHD_reply_with_error (
+ connection,
+ MHD_HTTP_BAD_REQUEST,
+ TALER_EC_MERCHANT_PRIVATE_POST_ORDERS_PAY_DEADLINE_IN_PAST,
+ NULL);
+ }
+ if ( (! GNUNET_TIME_absolute_is_zero (refund_deadline.abs_time)) &&
+ (GNUNET_TIME_absolute_is_past (refund_deadline.abs_time)) )
+ {
+ GNUNET_break_op (0);
+ GNUNET_JSON_parse_free (spec);
+ return TALER_MHD_reply_with_error (
+ connection,
+ MHD_HTTP_BAD_REQUEST,
+ TALER_EC_MERCHANT_PRIVATE_POST_ORDERS_REFUND_DEADLINE_IN_PAST,
+ NULL);
+ }
if (GNUNET_TIME_absolute_is_never (wire_deadline.abs_time))
{