gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-mdb] branch master updated (01cc8d8 -> f53522a)


From: gnunet
Subject: [taler-taler-mdb] branch master updated (01cc8d8 -> f53522a)
Date: Thu, 05 Dec 2019 16:50:25 +0100

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

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

    from 01cc8d8  fix my TODOs
     new e4245d8  static
     new 583b2f7  add auto_refund information to contract
     new f53522a  merge

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/Makefile.am |  3 ++-
 src/main.c      | 21 ++++++++++++++++++---
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 4b5e750..f7daf36 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -7,11 +7,12 @@ if USE_COVERAGE
 endif
 
 taler_mdb_SOURCES = \
-  main.c 
+  main.c
 taler_mdb_LDADD = \
   -ltalermerchant \
   -ltalerjson \
   -ltalerutil \
+  -lgnunetjson \
   -lgnunetcurl \
   -lgnunetutil \
   -ljansson \
diff --git a/src/main.c b/src/main.c
index 47a4573..205b98d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -49,6 +49,7 @@ along with
 #include <nfc/nfc.h>
 #include <microhttpd.h>
 #include <gnunet/gnunet_util_lib.h>
+#include <gnunet/gnunet_json_lib.h>
 #include <taler/taler_json_lib.h>
 #include <taler/taler_merchant_service.h>
 #if HAVE_QRENCODE_H             /* for adafruit pitft display */
@@ -86,6 +87,18 @@ along with
 #define MAX_HTTP_RETRY_FREQ GNUNET_TIME_relative_multiply ( \
     GNUNET_TIME_UNIT_MILLISECONDS, 500)
 
+#define MAX_HTTP_RETRY_FREQ GNUNET_TIME_relative_multiply ( \
+    GNUNET_TIME_UNIT_MILLISECONDS, 500)
+
+/**
+ * How long could it take at most for us to notify the Taler merchant
+ * backend to grant a refund to a user if dispensing the product
+ * failed? (Very conservative value here, for vending machines brewing
+ * coffee or something complex that could fail.)
+ */
+#define MAX_REFUND_DELAY GNUNET_TIME_relative_multiply ( \
+    GNUNET_TIME_UNIT_MINUTES, 5)
+
 /**
  * Code returned by libnfc in case of success.
  */
@@ -1136,10 +1149,12 @@ launch_payment (const struct Product *product)
                    uuid_s);
   GNUNET_free (uuid_s);
   /* create the json object for the order request */
-  orderReq = json_pack ("{ s:s, s:o, s:s }",
+  orderReq = json_pack ("{ s:s, s:o, s:s, s:o }",
                         "summary", product->description,
                         "amount", TALER_JSON_from_amount (&product->price),
-                        "fulfillment_url", fulflmntUrl);
+                        "fulfillment_url", fulflmntUrl,
+                        "auto_refund", GNUNET_JSON_from_time_rel (
+                          MAX_REFUND_DELAY));
   GNUNET_free (fulflmntUrl);
   if (NULL == orderReq)
   {
@@ -1302,7 +1317,7 @@ read_keyboard_command (void *cls)
 static void
 start_read_keyboard ()
 {
-  struct GNUNET_DISK_FileHandle fh = { STDIN_FILENO };
+  static struct GNUNET_DISK_FileHandle fh = { STDIN_FILENO };
 
   GNUNET_assert (NULL == keyboard_task);
   if (NULL == payment_activity)

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

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