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: Stub for automatica


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] branch master updated: Stub for automatically generating payments.
Date: Wed, 08 Mar 2017 20:51:35 +0100

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

marcello pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new bb0d468  Stub for automatically generating payments.
bb0d468 is described below

commit bb0d468a4b2ed99a8956973375af40ab4b9a315e
Author: Marcello Stanisci <address@hidden>
AuthorDate: Wed Mar 8 20:51:04 2017 +0100

    Stub for automatically generating payments.
---
 configure.ac                              |  1 +
 src/Makefile.am                           |  2 +-
 src/samples/Makefile.am                   | 21 +++++++++
 src/samples/README                        |  3 ++
 src/samples/create_payments.c             | 73 +++++++++++++++++++++++++++++++
 src/samples/merchant_create_payments.conf |  0
 6 files changed, 99 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 9923862..e728793 100644
--- a/configure.ac
+++ b/configure.ac
@@ -280,5 +280,6 @@ src/merchant-tools/Makefile
 src/include/Makefile
 src/backenddb/Makefile
 src/backend/Makefile
+src/samples/Makefile
 src/lib/Makefile])
 AC_OUTPUT
diff --git a/src/Makefile.am b/src/Makefile.am
index e58cf01..16521e0 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,3 +1,3 @@
 # This Makefile is in the public domain
 AM_CPPFLAGS = -I$(top_srcdir)/src/include
-SUBDIRS = include backenddb backend lib merchant-tools
+SUBDIRS = include backenddb backend lib merchant-tools samples
diff --git a/src/samples/Makefile.am b/src/samples/Makefile.am
new file mode 100644
index 0000000..f51998d
--- /dev/null
+++ b/src/samples/Makefile.am
@@ -0,0 +1,21 @@
+# This Makefile.am is in the public domain
+AM_CPPFLAGS = -I$(top_srcdir)/src/include
+
+bin_PROGRAMS = \
+  merchant-create-payments
+
+merchant_create_payments_SOURCES = \
+  create_payments.c
+
+merchant_create_payments_LDADD = \
+  $(top_srcdir)/src/backenddb/libtalermerchantdb.la \
+  -ltalermerchant \
+  $(LIBGCRYPT_LIBS) \
+  -ltalerfakebank \
+  -ltalerexchange \
+  -ltalerjson \
+  -ltalerutil \
+  -lgnunetjson \
+  -lgnunetcurl \
+  -lgnunetutil \
+  -ljansson
diff --git a/src/samples/README b/src/samples/README
new file mode 100644
index 0000000..4926db6
--- /dev/null
+++ b/src/samples/README
@@ -0,0 +1,3 @@
+Here is the logic that creates dummy payments into the
+merchant's DB, mainly used for debugging applications that
+need some real data from the merchant backend. 
diff --git a/src/samples/create_payments.c b/src/samples/create_payments.c
new file mode 100644
index 0000000..e07f5d1
--- /dev/null
+++ b/src/samples/create_payments.c
@@ -0,0 +1,73 @@
+/*
+  This file is part of TALER
+  Copyright (C) 2014, 2015, 2016 GNUnet e.V. and INRIA
+
+  TALER is free software; you can redistribute it and/or modify it under the
+  terms of the GNU Lesser General Public License as published by the Free 
Software
+  Foundation; either version 2.1, or (at your option) any later version.
+
+  TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+  A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more 
details.
+
+  You should have received a copy of the GNU Lesser General Public License 
along with
+  TALER; see the file COPYING.LGPL.  If not, see <http://www.gnu.org/licenses/>
+*/
+
+#include "platform.h"
+#include <taler/taler_exchange_service.h>
+#include <taler/taler_fakebank_lib.h>
+#include <taler/taler_json_lib.h>
+#include <taler/taler_util.h>
+#include <taler/taler_signatures.h>
+#include "taler_merchant_service.h"
+#include "taler_merchantdb_lib.h"
+#include <gnunet/gnunet_util_lib.h>
+#include <gnunet/gnunet_curl_lib.h>
+#include <microhttpd.h>
+
+
+/**
+ * Handle to database.
+ */
+struct TALER_MERCHANTDB_Plugin *db;
+
+/**
+ * Configuration handle.
+ */
+struct GNUNET_CONFIGURATION_Handle *cfg;
+
+
+int
+main ()
+{
+  struct GNUNET_OS_Process *proc;
+  struct GNUNET_OS_Process *exchanged;
+  struct GNUNET_OS_Process *merchantd;
+  unsigned int cnt;
+  struct GNUNET_SIGNAL_Context *shc_chld;
+
+
+  /*** Very beginning ***/
+  /* 1 Launch exchange */
+  /* 2 Launch merchant */
+  /* 3 What about the bank? */
+
+  unsetenv ("XDG_DATA_HOME");
+  unsetenv ("XDG_CONFIG_HOME");
+  GNUNET_log_setup ("merchant-create-payments",
+                    "DEBUG",
+                    NULL);
+  cfg = GNUNET_CONFIGURATION_create ();
+  GNUNET_assert (GNUNET_OK ==
+                 GNUNET_CONFIGURATION_load (cfg,
+                                            "merchant_create_payments.conf"));
+
+  db = TALER_MERCHANTDB_plugin_load (cfg);
+  if (NULL == db)
+  {
+    GNUNET_CONFIGURATION_destroy (cfg);
+    return 77;
+  }
+
+}
diff --git a/src/samples/merchant_create_payments.conf 
b/src/samples/merchant_create_payments.conf
new file mode 100644
index 0000000..e69de29

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



reply via email to

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