gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] 210/277: fix #5957


From: gnunet
Subject: [taler-merchant] 210/277: fix #5957
Date: Sun, 05 Jul 2020 20:52:03 +0200

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

grothoff pushed a commit to branch master
in repository merchant.

commit e39aa8b4e8df86273a3f5f823a4cba3c844c51cb
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat Jun 13 18:45:50 2020 +0200

    fix #5957
---
 .../taler-merchant-httpd_private-get-transfers.c   |  2 +-
 .../taler-merchant-httpd_private-post-orders.c     | 28 +++++++++++++++++-----
 2 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_private-get-transfers.c 
b/src/backend/taler-merchant-httpd_private-get-transfers.c
index c2f1210..f98b785 100644
--- a/src/backend/taler-merchant-httpd_private-get-transfers.c
+++ b/src/backend/taler-merchant-httpd_private-get-transfers.c
@@ -93,7 +93,7 @@ TMH_private_get_transfers (const struct TMH_RequestHandler 
*rh,
   const char *payto_uri;
   struct GNUNET_TIME_Absolute before = GNUNET_TIME_UNIT_FOREVER_ABS;
   struct GNUNET_TIME_Absolute after = GNUNET_TIME_UNIT_ZERO_ABS;
-  int64_t limit = -20; /* FIXME: default? Nothing documented!!? */
+  int64_t limit = -20;
   uint64_t offset;
   enum TALER_EXCHANGE_YesNoAll verified;
 
diff --git a/src/backend/taler-merchant-httpd_private-post-orders.c 
b/src/backend/taler-merchant-httpd_private-post-orders.c
index 7c6a0c3..e7b04e3 100644
--- a/src/backend/taler-merchant-httpd_private-post-orders.c
+++ b/src/backend/taler-merchant-httpd_private-post-orders.c
@@ -542,14 +542,32 @@ patch_order (struct MHD_Connection *connection,
   if (NULL == json_object_get (order,
                                "refund_deadline"))
   {
-    struct GNUNET_TIME_Absolute zero = { 0 };
+    const char *refdel_s;
+    struct GNUNET_TIME_Absolute rd = { 0 };
 
-    // FIXME: #5957: add way to compute non-zero refund deadline
-    // from 'refund delay' specified "somewhere".
+    refdel_s = MHD_lookup_connection_value (connection,
+                                            MHD_GET_ARGUMENT_KIND,
+                                            "refund_delay");
+    if (NULL == refdel_s)
+    {
+      struct GNUNET_TIME_Relative r;
+
+      if (GNUNET_OK !=
+          GNUNET_STRINGS_fancy_time_to_relative (refdel_s,
+                                                 &r))
+      {
+        return TALER_MHD_reply_with_error (connection,
+                                           MHD_HTTP_BAD_REQUEST,
+                                           TALER_EC_PARAMETER_MALFORMED,
+                                           "refund_delay");
+
+      }
+      rd = GNUNET_TIME_relative_to_absolute (r);
+    }
     GNUNET_assert (0 ==
                    json_object_set_new (order,
                                         "refund_deadline",
-                                        GNUNET_JSON_from_time_abs (zero)));
+                                        GNUNET_JSON_from_time_abs (rd)));
   }
 
   if (NULL == json_object_get (order,
@@ -909,8 +927,6 @@ merge_inventory (struct MHD_Connection *connection,
                               inventory_products,
                               uuids_length,
                               uuids);
-
-
 }
 
 

-- 
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]