gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-merchant] branch master updated (1c1fe4c -> 7305041)


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] branch master updated (1c1fe4c -> 7305041)
Date: Wed, 27 Jun 2018 16:10:36 +0200

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

marcello pushed a change to branch master
in repository merchant.

    from 1c1fe4c  gitignore
     new f407c51  Terminate good process if CLI option is missing.
     new 7305041  Towards #5366..

The 2 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/backend/taler-merchant-httpd_pay.c             | 29 +++++++++++++++++++++-
 .../taler-merchant-generate-payments-alt.c         | 17 ++++++++-----
 .../taler-merchant-generate-payments.c             |  2 +-
 3 files changed, 40 insertions(+), 8 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_pay.c 
b/src/backend/taler-merchant-httpd_pay.c
index bb31afb..bd9cb76 100644
--- a/src/backend/taler-merchant-httpd_pay.c
+++ b/src/backend/taler-merchant-httpd_pay.c
@@ -1316,6 +1316,7 @@ parse_pay (struct MHD_Connection *connection,
   };
   enum GNUNET_DB_QueryStatus qs;
   const char *session_id;
+  struct GNUNET_TIME_Relative used_wire_transfer_delay;
 
   res = TMH_PARSE_json_data (connection,
                              root,
@@ -1452,9 +1453,35 @@ parse_pay (struct MHD_Connection *connection,
       return (GNUNET_NO == res) ? MHD_YES : MHD_NO;
     }
 
+    /* Use the value from config as default.  */
+    used_wire_transfer_delay = wire_transfer_delay;
+    if (NULL != json_object_get (pc->contract_terms,
+                                 "wire_transfer_delay"))
+    {
+
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                  "Frontend specified wire transfer delay\n");
+      
+      struct GNUNET_JSON_Specification wspec[] = {
+        GNUNET_JSON_spec_relative_time ("wire_transfer_delay",
+                                        &used_wire_transfer_delay),
+        GNUNET_JSON_spec_end()
+      };
+
+      res = TMH_PARSE_json_data (connection,
+                                 pc->contract_terms,
+                                 wspec);
+      if (GNUNET_YES != res)
+      {
+        GNUNET_JSON_parse_free (spec);
+        GNUNET_break (0);
+        return (GNUNET_NO == res) ? MHD_YES : MHD_NO;
+      }
+    }
+
     pc->wire_transfer_deadline
       = GNUNET_TIME_absolute_add (pc->timestamp,
-                                  wire_transfer_delay);
+                                  used_wire_transfer_delay);
 
     if (pc->wire_transfer_deadline.abs_value_us < 
pc->refund_deadline.abs_value_us)
     {
diff --git a/src/merchant-tools/taler-merchant-generate-payments-alt.c 
b/src/merchant-tools/taler-merchant-generate-payments-alt.c
index d37d45b..4fd1545 100644
--- a/src/merchant-tools/taler-merchant-generate-payments-alt.c
+++ b/src/merchant-tools/taler-merchant-generate-payments-alt.c
@@ -150,7 +150,7 @@ static char *currency;
                    "%s:5.01", \
                    currency); \
   GNUNET_asprintf (&CURRENCY_5, \
-                   "%s:5.01", \
+                   "%s:5", \
                    currency); \
   GNUNET_asprintf (&CURRENCY_4_99, \
                    "%s:4.99", \
@@ -169,8 +169,9 @@ static char *currency;
        {\"currency\":\"%s\",\
         \"value\":0,\
         \"fraction\":50000000},\
-       \"refund_deadline\":\"\\/Date(99999999999)\\/\",\
-       \"pay_deadline\":\"\\/Date(99999999999)\\/\",\
+       \"wire_transfer_delay\":\"\\/forever\\/\",\
+       \"refund_deadline\":\"\\/end of time\\/\",\
+       \"pay_deadline\":\"\\/end of time\\/\",\
        \"amount\":\
          {\"currency\":\"%s\",\
           \"value\":5,\
@@ -287,17 +288,21 @@ run (void *cls,
       ("create-reserve-2",
        CURRENCY_10_02),
 
+    TALER_TESTING_cmd_exec_wirewatch
+      ("wirewatch-2",
+       cfg_filename),
+
     TALER_TESTING_cmd_withdraw_amount
       ("withdraw-coin-2",
        is->exchange,
-       "create-reserve-1",
+       "create-reserve-2",
        CURRENCY_5,
        MHD_HTTP_OK),
 
     TALER_TESTING_cmd_withdraw_amount
       ("withdraw-coin-3",
        is->exchange,
-       "create-reserve-1",
+       "create-reserve-2",
        CURRENCY_5,
        MHD_HTTP_OK),
 
@@ -483,6 +488,7 @@ main (int argc,
   if (NULL == bank_url)
   {
     TALER_LOG_ERROR ("Option -b is mandatory!\n");
+    terminate_process (merchantd);
     return MISSING_BANK_URL;
   }
 
@@ -491,7 +497,6 @@ main (int argc,
      bank_url)))
   {
     TALER_LOG_ERROR ("Failed to run the bank\n");
-    terminate_process (bankd);
     terminate_process (merchantd);
     return FAILED_TO_LAUNCH_BANK;
   }
diff --git a/src/merchant-tools/taler-merchant-generate-payments.c 
b/src/merchant-tools/taler-merchant-generate-payments.c
index 29cddd8..e8b04ad 100644
--- a/src/merchant-tools/taler-merchant-generate-payments.c
+++ b/src/merchant-tools/taler-merchant-generate-payments.c
@@ -534,6 +534,7 @@ main (int argc,
   if (NULL == bank_url)
   {
     TALER_LOG_ERROR ("Option -b is mandatory!\n");
+    terminate_process (merchantd);
     return MISSING_BANK_URL;
   }
 
@@ -542,7 +543,6 @@ main (int argc,
      bank_url)))
   {
     TALER_LOG_ERROR ("Failed to run the bank\n");
-    terminate_process (bankd);
     terminate_process (merchantd);
     return FAILED_TO_LAUNCH_BANK;
   }

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



reply via email to

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