summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac6
-rw-r--r--src/backenddb/Makefile.am4
-rw-r--r--src/frontend/config.php19
-rw-r--r--src/frontend/index.php34
4 files changed, 56 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index 67d5450c..d7ef722d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -74,12 +74,12 @@ AS_CASE([$with_mint],
CPPFLAGS="$CPPFLAGS $POSTGRESQL_CPPFLAGS"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
-AC_CHECK_HEADERS([taler/taler_pq_lib.h],
- [AC_CHECK_LIB([talerpq], [TALER_PQ_exec_prepared], libtalerpq=1)],
+AC_CHECK_HEADERS([gnunet/gnunet_pq_lib.h],
+ [AC_CHECK_LIB([gnunetpq], [GNUNET_PQ_exec_prepared], libgnunetpq=1)],
[], [#ifdef HAVE_GNUNET_PLATFORM_H
#include <gnunet/platform.h>
#endif])
-AM_CONDITIONAL(HAVE_TALERPQ, test x$libtalerpq = x1)
+AM_CONDITIONAL(HAVE_GNUNETPQ, test x$libgnunetpq = x1)
# check for libmicrohttpd
diff --git a/src/backenddb/Makefile.am b/src/backenddb/Makefile.am
index e70ad206..08adf296 100644
--- a/src/backenddb/Makefile.am
+++ b/src/backenddb/Makefile.am
@@ -4,7 +4,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/include
plugindir = $(libdir)/taler
if HAVE_POSTGRESQL
-if HAVE_TALERPQ
+if HAVE_GNUNETPQ
plugin_LTLIBRARIES = \
libtaler_plugin_merchantdb_postgres.la
endif
@@ -32,7 +32,7 @@ libtaler_plugin_merchantdb_postgres_la_LIBADD = \
$(LTLIBINTL)
libtaler_plugin_merchantdb_postgres_la_LDFLAGS = \
$(TALER_PLUGIN_LDFLAGS) \
- -ltalerpq \
+ -lgnunetpq \
-ltalerutil \
-lpq \
-lgnunetpostgres \
diff --git a/src/frontend/config.php b/src/frontend/config.php
new file mode 100644
index 00000000..1680a9b5
--- /dev/null
+++ b/src/frontend/config.php
@@ -0,0 +1,19 @@
+<?php
+
+$host = $_SERVER["HTTP_HOST"];
+
+switch ($host) {
+case "shop.demo.taler.net":
+ $SHOP_CURRENCY = "KUDOS";
+ break;
+case "shop.test.taler.net":
+ $SHOP_CURRENCY = "PUDOS";
+ break;
+default:
+ http_response_code ($status_code);
+ echo "<p>Configuration error: No currency for domain $host</p>\n";
+ die();
+ break;
+}
+
+?>
diff --git a/src/frontend/index.php b/src/frontend/index.php
index c0086a85..a616ebc5 100644
--- a/src/frontend/index.php
+++ b/src/frontend/index.php
@@ -6,8 +6,32 @@ require_once "../frontend_lib/config.php";
<head>
<title>Toy &quot;Store&quot; - Taler Demo</title>
<link rel="stylesheet" type="text/css" href="style.css">
- <script src="taler-presence.js" type="text/javascript">
- </script>
+ <script src="taler-presence.js" type="text/javascript"></script>
+<script type="text/javascript">
+<?php
+echo "\tvar shop_currency = '$SHOP_CURRENCY';\n";
+?>
+
+ function addOption(value, label) {
+ var s = document.getElementById("taler-donation");
+ let e = document.createElement("option");
+ e.textContent = label ? label : ("".concat(value, " ", shop_currency));
+ e.value = value;
+ s.appendChild(e);
+ }
+
+ function init() {
+ let e = document.getElementById("currency-input");
+ e.value = shop_currency;
+ addOption("0.1");
+ addOption("1.0");
+ addOption("6.0", "".concat(5, " ", shop_currency));
+ addOption("10");
+ }
+
+ document.addEventListener("DOMContentLoaded", init);
+
+</script>
</head>
<body>
@@ -110,12 +134,18 @@ require_once "../frontend_lib/config.php";
<input type="radio" name="donation_receiver" value="GNUnet">GNUnet</input>
<br>
<select id="taler-donation" name="donation_amount">
+<<<<<<< HEAD:src/frontend/index.php
<option value="0.1">0.1 <?php echo $MERCHANT_CURRENCY; ?></option>
<option value="1.0">1 <?php echo $MERCHANT_CURRENCY; ?></option>
<option value="6.0">5 <?php echo $MERCHANT_CURRENCY; ?> (*)</option>
<option value="10.0">10 <?php echo $MERCHANT_CURRENCY; ?></option>
</select>
<input type="hidden" name="donation_currency" value=<?php echo $MERCHANT_CURRENCY; ?>/>
+=======
+ <!-- options will be added dynamically -->
+ </select>
+ <input id="currency-input" type="hidden" name="donation_currency"/>
+>>>>>>> 57e59c69c1196ae882f02f2b9747cdae52491549:src/frontend/index.php
<input type="submit" name="keyName" value="Donate!"/>
<br>
<br>