gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-mdb] branch master updated: -products must be an array


From: gnunet
Subject: [taler-taler-mdb] branch master updated: -products must be an array
Date: Fri, 20 May 2022 17:11:09 +0200

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

grothoff pushed a commit to branch master
in repository taler-mdb.

The following commit(s) were added to refs/heads/master by this push:
     new 16b3b28  -products must be an array
16b3b28 is described below

commit 16b3b2875b389508dbb67db5c06ad430a1935de3
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Fri May 20 17:11:07 2022 +0200

    -products must be an array
---
 src/main.c | 28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/src/main.c b/src/main.c
index 56654e8..3c4ed98 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1676,6 +1676,22 @@ launch_payment (struct Product *product)
   /* create the json object for the order request */
   if (NULL != product->preview)
   {
+    json_t *products;
+
+    products = json_array ();
+    GNUNET_assert (NULL != products);
+    GNUNET_assert (
+                  0 ==
+                  json_array_append_new (products,                             
          
+        GNUNET_JSON_PACK (
+          GNUNET_JSON_pack_string ("description",
+                                   product->description),
+          GNUNET_JSON_pack_string ("image",
+                                   product->preview),
+          TALER_JSON_pack_amount ("price",
+                                  &product->price),
+          GNUNET_JSON_pack_uint64 ("quantity",
+                                   1))));
     orderReq = GNUNET_JSON_PACK (
       GNUNET_JSON_pack_string ("summary",
                                product->description),
@@ -1684,17 +1700,9 @@ launch_payment (struct Product *product)
                                   GNUNET_TIME_relative_to_timestamp (
                                     PAY_TIMEOUT)),
 #endif
-      GNUNET_JSON_pack_object_steal (
+      GNUNET_JSON_pack_array_steal (
         "products",
-        GNUNET_JSON_PACK (
-          GNUNET_JSON_pack_string ("description",
-                                   product->description),
-          GNUNET_JSON_pack_string ("image",
-                                   product->preview),
-          TALER_JSON_pack_amount ("price",
-                                  &product->price),
-          GNUNET_JSON_pack_uint64 ("quantity",
-                                   1))),
+       products),
       TALER_JSON_pack_amount ("amount",
                               &product->price),
       GNUNET_JSON_pack_string ("fulfillment_message",

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