gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-merchant] branch master updated: fix #7607


From: gnunet
Subject: [taler-merchant] branch master updated: fix #7607
Date: Tue, 31 Jan 2023 15:37:57 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new 0107fd64 fix #7607
     new 9adfbe7a Merge branch 'master' of git+ssh://git.taler.net/merchant
0107fd64 is described below

commit 0107fd64aad2dcbf5497e2b6ef751eb8ec95b934
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue Jan 31 15:37:49 2023 +0100

    fix #7607
---
 .../taler-merchant-httpd_private-post-orders.c     | 27 ++++++++++++++++++----
 1 file 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))
   {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]