aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/Makefile.am2
-rw-r--r--src/backend/merchant.conf3
-rw-r--r--src/backend/taler-merchant-httpd.c10
-rw-r--r--src/backend/taler-merchant-httpd_post-orders-ID-abort.c1
-rw-r--r--src/backend/taler-merchant-httpd_private-post-orders.c38
-rw-r--r--src/backend/taler-merchant-httpd_spa.c2
6 files changed, 34 insertions, 22 deletions
diff --git a/src/backend/Makefile.am b/src/backend/Makefile.am
index d5ddda41..9b8a845e 100644
--- a/src/backend/Makefile.am
+++ b/src/backend/Makefile.am
@@ -6,7 +6,7 @@ if USE_COVERAGE
XLIB = -lgcov
endif
-pkgcfgdir = $(prefix)/share/taler/config.d/
+pkgcfgdir = $(prefix)/share/taler-merchant/config.d/
pkgcfg_DATA = \
kudos.conf \
diff --git a/src/backend/merchant.conf b/src/backend/merchant.conf
index 44ec72d7..1231eddd 100644
--- a/src/backend/merchant.conf
+++ b/src/backend/merchant.conf
@@ -6,6 +6,9 @@
# General settings for the backend.
[merchant]
+# Default currency we use.
+CURRENCY = KUDOS
+
# Use TCP or UNIX domain sockets?
SERVE = tcp
diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c
index f14c2c7e..34bed4ad 100644
--- a/src/backend/taler-merchant-httpd.c
+++ b/src/backend/taler-merchant-httpd.c
@@ -2263,6 +2263,7 @@ run (void *cls,
if (GNUNET_SYSERR ==
TALER_config_get_currency (cfg,
+ "merchant",
&TMH_currency))
{
@@ -2317,7 +2318,14 @@ run (void *cls,
"merchant",
"FORCE_AUDIT"))
TMH_force_audit = GNUNET_YES;
- TALER_TEMPLATING_init ("merchant");
+ if (GNUNET_OK !=
+ TALER_TEMPLATING_init (TALER_EXCHANGE_project_data ()))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Failed to setup templates\n");
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
if (GNUNET_OK !=
TMH_spa_init ())
{
diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-abort.c b/src/backend/taler-merchant-httpd_post-orders-ID-abort.c
index 80c6930b..19ee4cb7 100644
--- a/src/backend/taler-merchant-httpd_post-orders-ID-abort.c
+++ b/src/backend/taler-merchant-httpd_post-orders-ID-abort.c
@@ -884,6 +884,7 @@ parse_abort (struct MHD_Connection *connection,
struct RefundDetails *rd = &ac->rd[coins_index];
const char *exchange_url;
struct GNUNET_JSON_Specification ispec[] = {
+ /* FIXME: this is breaking multi-currency support! */
TALER_JSON_spec_amount ("contribution",
TMH_currency,
&rd->amount_with_fee),
diff --git a/src/backend/taler-merchant-httpd_private-post-orders.c b/src/backend/taler-merchant-httpd_private-post-orders.c
index 2b2931f1..a39e3202 100644
--- a/src/backend/taler-merchant-httpd_private-post-orders.c
+++ b/src/backend/taler-merchant-httpd_private-post-orders.c
@@ -886,36 +886,36 @@ execute_transaction (struct OrderContext *oc)
}
{
- enum GNUNET_DB_QueryStatus qs;
+ enum GNUNET_DB_QueryStatus wqs;
json_t *jhook;
- jhook = GNUNET_JSON_PACK(
- GNUNET_JSON_pack_string("order_id",
- oc->parse_order.order_id),
- GNUNET_JSON_pack_object_incref("contract",
- oc->serialize_order.contract),
- GNUNET_JSON_pack_string("instance_id",
- oc->hc->instance->settings.id)
- );
- GNUNET_assert(NULL != jhook);
+ jhook = GNUNET_JSON_PACK (
+ GNUNET_JSON_pack_string ("order_id",
+ oc->parse_order.order_id),
+ GNUNET_JSON_pack_object_incref ("contract",
+ oc->serialize_order.contract),
+ GNUNET_JSON_pack_string ("instance_id",
+ oc->hc->instance->settings.id)
+ );
+ GNUNET_assert (NULL != jhook);
- qs = TMH_trigger_webhook(oc->hc->instance->settings.id,
- "order_created",
- jhook);
+ wqs = TMH_trigger_webhook (oc->hc->instance->settings.id,
+ "order_created",
+ jhook);
- json_decref(jhook);
+ json_decref (jhook);
- if (0 < qs)
+ if (0 < wqs)
{
TMH_db->rollback (TMH_db->cls);
- if (GNUNET_DB_STATUS_SOFT_ERROR == qs)
- return qs;
- GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs);
+ if (GNUNET_DB_STATUS_SOFT_ERROR == wqs)
+ return wqs;
+ GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == wqs);
reply_with_error (oc,
MHD_HTTP_INTERNAL_SERVER_ERROR,
TALER_EC_GENERIC_DB_STORE_FAILED,
"failed to trigger webhooks");
- return qs;
+ return wqs;
}
}
diff --git a/src/backend/taler-merchant-httpd_spa.c b/src/backend/taler-merchant-httpd_spa.c
index 6992f519..c8ff4782 100644
--- a/src/backend/taler-merchant-httpd_spa.c
+++ b/src/backend/taler-merchant-httpd_spa.c
@@ -316,7 +316,7 @@ TMH_spa_init ()
return GNUNET_SYSERR;
}
GNUNET_asprintf (&dn,
- "%smerchant/spa/",
+ "%s/spa/",
path);
GNUNET_free (path);
}