gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-merchant] 01/05: proposal CMD generates order_id if


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] 01/05: proposal CMD generates order_id if missing.
Date: Wed, 09 May 2018 16:24:36 +0200

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

marcello pushed a commit to branch master
in repository merchant.

commit 93063ba17a2e3d0d897635e7d92aa21fba06ec33
Author: Marcello Stanisci <address@hidden>
AuthorDate: Wed May 9 11:22:21 2018 +0200

    proposal CMD generates order_id if missing.
---
 src/lib/testing_api_cmd_proposal.c                    | 19 +++++++++++++++++++
 .../taler-merchant-generate-payments_new.c            |  9 ++++-----
 2 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/src/lib/testing_api_cmd_proposal.c 
b/src/lib/testing_api_cmd_proposal.c
index 4529e40..13d32ab 100644
--- a/src/lib/testing_api_cmd_proposal.c
+++ b/src/lib/testing_api_cmd_proposal.c
@@ -346,6 +346,25 @@ proposal_run (void *cls,
     return;
   }
 
+  if (NULL == json_object_get (order,
+                               "order_id"))
+  {
+    struct GNUNET_TIME_Absolute now;
+    char *order_id;
+
+    now = GNUNET_TIME_absolute_get (); 
+
+    order_id = GNUNET_STRINGS_data_to_string_alloc
+      (&now.abs_value_us,
+       sizeof (now.abs_value_us));
+
+    json_object_set (order,
+                     "order_id",
+                     json_string (order_id));
+
+    GNUNET_free (order_id);
+  }
+
   GNUNET_CRYPTO_random_block
     (GNUNET_CRYPTO_QUALITY_WEAK,
      &ps->nonce,
diff --git a/src/merchant-tools/taler-merchant-generate-payments_new.c 
b/src/merchant-tools/taler-merchant-generate-payments_new.c
index 67a1a48..96fa361 100644
--- a/src/merchant-tools/taler-merchant-generate-payments_new.c
+++ b/src/merchant-tools/taler-merchant-generate-payments_new.c
@@ -83,6 +83,7 @@ static char *logfile;
  */
 static char *merchant_url;
 
+
 /**
  * Actual commands collection.
  */
@@ -90,11 +91,9 @@ static void
 run (void *cls,
      struct TALER_TESTING_Interpreter *is)
 {
-  struct TALER_TESTING_Command commands[] = {
-    TALER_TESTING_cmd_end ()
-  };
+  /* Looping will be implemented by rewinding the instruction
+    pointer.  */
 
-  TALER_TESTING_run (is, commands);
 }
 
 /**
@@ -181,7 +180,7 @@ main (int argc,
      argv));
 
   GNUNET_log_setup ("taler-merchant-generate-payments-new",
-                    "INFO",
+                    "DEBUG",
                     logfile);
 
   if (NULL == merchant_url)

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



reply via email to

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