gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated: address more FIXMEs


From: gnunet
Subject: [taler-merchant] branch master updated: address more FIXMEs
Date: Sat, 03 Jun 2023 23:46:33 +0200

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 a5b0b6d3 address more FIXMEs
a5b0b6d3 is described below

commit a5b0b6d3de37d2d5940e82c7623486079980f8b9
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat Jun 3 23:46:30 2023 +0200

    address more FIXMEs
---
 .../taler-merchant-httpd_private-post-orders.c     | 42 +++-------------------
 1 file changed, 4 insertions(+), 38 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_private-post-orders.c 
b/src/backend/taler-merchant-httpd_private-post-orders.c
index 2c68e680..5646af4d 100644
--- a/src/backend/taler-merchant-httpd_private-post-orders.c
+++ b/src/backend/taler-merchant-httpd_private-post-orders.c
@@ -415,8 +415,6 @@ execute_order (struct OrderContext *oc)
   const char *fulfillment_msg = NULL;
   const json_t *products;
   const json_t *merchant;
-  const json_t *summary_i18n = NULL;
-  const json_t *fulfillment_i18n = NULL;
   struct GNUNET_TIME_Timestamp timestamp;
   struct GNUNET_TIME_Timestamp refund_deadline = { 0 };
   struct GNUNET_TIME_Timestamp wire_transfer_deadline;
@@ -426,8 +424,8 @@ execute_order (struct OrderContext *oc)
                             &total),
     GNUNET_JSON_spec_string ("order_id",
                              &oc->order_id),
-    GNUNET_JSON_spec_string ("summary",
-                             &summary),
+    TALER_JSON_spec_i18n_str ("summary",
+                              &summary),
     /**
      * The following entries we don't actually need,
      * except to check that the order is well-formed */
@@ -436,16 +434,8 @@ execute_order (struct OrderContext *oc)
     GNUNET_JSON_spec_object_const ("merchant",
                                    &merchant),
     GNUNET_JSON_spec_mark_optional (
-      GNUNET_JSON_spec_object_const ("summary_i18n",
-                                     &summary_i18n),
-      NULL),
-    GNUNET_JSON_spec_mark_optional (
-      GNUNET_JSON_spec_string ("fulfillment_message",
-                               &fulfillment_msg),
-      NULL),
-    GNUNET_JSON_spec_mark_optional (
-      GNUNET_JSON_spec_object_const ("fulfillment_message_i18n",
-                                     &fulfillment_i18n),
+      TALER_JSON_spec_i18n_str ("fulfillment_message",
+                                &fulfillment_msg),
       NULL),
     GNUNET_JSON_spec_timestamp ("timestamp",
                                 &timestamp),
@@ -488,30 +478,6 @@ execute_order (struct OrderContext *oc)
     return;
   }
 
-  // FIXME: we can do this better now...
-  if ( (NULL != fulfillment_i18n) &&
-       (! TALER_JSON_check_i18n (fulfillment_i18n)) )
-  {
-    GNUNET_break_op (0);
-    GNUNET_JSON_parse_free (spec);
-    reply_with_error (oc,
-                      MHD_HTTP_BAD_REQUEST,
-                      TALER_EC_GENERIC_PARAMETER_MALFORMED,
-                      "order:fulfillment_message_i18n");
-    return;
-  }
-  if ( (NULL != summary_i18n) &&
-       (! TALER_JSON_check_i18n (summary_i18n)) )
-  {
-    GNUNET_break_op (0);
-    GNUNET_JSON_parse_free (spec);
-    reply_with_error (oc,
-                      MHD_HTTP_BAD_REQUEST,
-                      TALER_EC_GENERIC_PARAMETER_MALFORMED,
-                      "order:summary_i18n");
-    return;
-  }
-
   /* Test if we already have an order with this id */
   {
     struct TALER_ClaimTokenP token;

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