summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/merchant.conf16
-rw-r--r--src/backend/taler-merchant-httpd_auditors.c4
-rw-r--r--src/lib/test_merchant_api.c10
-rw-r--r--src/lib/test_merchant_api.conf15
4 files changed, 27 insertions, 18 deletions
diff --git a/src/backend/merchant.conf b/src/backend/merchant.conf
index e7259506..eee0dfef 100644
--- a/src/backend/merchant.conf
+++ b/src/backend/merchant.conf
@@ -21,7 +21,8 @@ DB = postgres
# Which wireformat does this merchant use? (test/sepa/etc.)
# WIREFORMAT = "test"
-# Must match the specification given in [merchant-wireformat]
+# Determines which wire plugin will be used. We currently only
+# support one wire plugin at a time!
# Configuration for postgres database.
@@ -31,14 +32,7 @@ CONFIG = postgres:///talermerchant
# Configuration of our bank account details
[merchant-wireformat]
+# Default location for the 'test' wire plugin
TEST_RESPONSE_FILE = ${TALER_CONFIG_HOME}/merchant/wire/test.json
-# The values in this section must match the "WIREFORMAT" given in [merchant]:
-# * for SEPA:
-# IBAN = DE67830654080004822650
-# NAME = GNUNET E.V
-# BIC = GENODEF1SRL
-#
-# * for TEST:
-# ACCOUNT_NUMBER = 123456
-# BANK_URI = http://
-#
+# Default location for the 'sepa' wire plugin
+SEPA_RESPONSE_FILE = ${TALER_CONFIG_HOME}/merchant/wire/sepa.json
diff --git a/src/backend/taler-merchant-httpd_auditors.c b/src/backend/taler-merchant-httpd_auditors.c
index 3c81a417..0b583fd4 100644
--- a/src/backend/taler-merchant-httpd_auditors.c
+++ b/src/backend/taler-merchant-httpd_auditors.c
@@ -128,8 +128,8 @@ parse_auditors (void *cls,
struct Auditor auditor;
if (0 != strncasecmp (section,
- "auditor-",
- strlen ("auditor-")))
+ "merchant-auditor-",
+ strlen ("merchant-auditor-")))
return;
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (cfg,
diff --git a/src/lib/test_merchant_api.c b/src/lib/test_merchant_api.c
index 3b08b1f1..70714bae 100644
--- a/src/lib/test_merchant_api.c
+++ b/src/lib/test_merchant_api.c
@@ -412,7 +412,8 @@ static void
fail (struct InterpreterState *is)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Interpreter failed at step %u\n",
+ "Interpreter failed at step %s (#%u)\n",
+ is->commands[is->ip].label,
is->ip);
result = GNUNET_SYSERR;
GNUNET_SCHEDULER_shutdown ();
@@ -1081,6 +1082,7 @@ interpreter_run (void *cls)
struct GNUNET_TIME_Absolute timestamp;
struct GNUNET_HashCode h_wire;
struct TALER_MerchantPublicKeyP merchant_pub;
+ struct TALER_MerchantSignatureP merchant_sig;
struct GNUNET_HashCode h_contract;
struct TALER_Amount total_amount;
struct TALER_Amount max_fee;
@@ -1090,6 +1092,7 @@ interpreter_run (void *cls)
/* get amount */
ref = find_command (is,
cmd->details.pay.contract_ref);
+ merchant_sig = ref->details.contract.merchant_sig;
GNUNET_assert (NULL != ref->details.contract.contract);
{
struct GNUNET_JSON_Specification spec[] = {
@@ -1172,7 +1175,7 @@ interpreter_run (void *cls)
&total_amount,
&max_fee,
&merchant_pub,
- &cmd->details.contract.merchant_sig,
+ &merchant_sig,
timestamp,
refund_deadline,
&h_wire,
@@ -1428,7 +1431,7 @@ run (void *cls)
{ .oc = OC_CONTRACT,
.label = "create-contract-2",
.expected_response_code = MHD_HTTP_OK,
- .details.contract.proposal = "{ \"max_fee\":{\"currency\":\"EUR\", \"value\":0, \"fraction\":500000}, \"transaction_id\":2, \"timestamp\":\"\\/Date(42)\\/\", \"refund_deadline\":\"\\/Date(0)\\/\", \"amount\":{\"currency\":\"EUR\", \"value\":5, \"fraction\":0}, \"products\":[ {\"description\":\"ice cream\", \"value\":\"{EUR:5}\"} ] }" },
+ .details.contract.proposal = "{ \"max_fee\":{\"currency\":\"EUR\", \"value\":0, \"fraction\":500000}, \"transaction_id\":2, \"timestamp\":\"\\/Date(42)\\/\", \"refund_deadline\":\"\\/Date(0)\\/\", \"expiry\":\"\\/Date(999999999)\\/\", \"amount\":{\"currency\":\"EUR\", \"value\":5, \"fraction\":0}, \"products\":[ {\"description\":\"ice cream\", \"value\":\"{EUR:5}\"} ] }" },
/* Try to double-spend the 5 EUR coin at the same merchant (but different
transaction ID) */
@@ -1436,6 +1439,7 @@ run (void *cls)
.label = "deposit-double-2",
.expected_response_code = MHD_HTTP_FORBIDDEN,
.details.pay.contract_ref = "create-contract-2",
+ .details.pay.coin_ref = "withdraw-coin-1",
.details.pay.amount_with_fee = "EUR:5",
.details.pay.amount_without_fee = "EUR:4.99" },
diff --git a/src/lib/test_merchant_api.conf b/src/lib/test_merchant_api.conf
index 7e1d6e4b..12bf0ddd 100644
--- a/src/lib/test_merchant_api.conf
+++ b/src/lib/test_merchant_api.conf
@@ -4,6 +4,10 @@
# Persistant data storage for the testcase
TALER_TEST_HOME = test_merchant_api_home/
+##########################################
+# Configuration for the merchant backend #
+##########################################
+
[merchant]
# Which port do we run the backend on? (HTTP server)
@@ -29,7 +33,7 @@ DB = postgres
# Which wireformat do we use?
WIREFORMAT = test
-[exchange-taler]
+[merchant-exchange-test]
URI = http://localhost:8081/
MASTER_KEY = 98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG
@@ -37,7 +41,7 @@ MASTER_KEY = 98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG
# Auditors must be in sections "auditor-", the rest of the section
# name could be anything.
-[auditor-ezb]
+[merchant-auditor-ezb]
# Informal name of the auditor. Just for the user.
NAME = European Central Bank
@@ -49,6 +53,8 @@ URI = http://taler.ezb.eu/
# This is the important bit: the signing key of the auditor.
PUBLIC_KEY = 9QXF7XY7E9VPV47B5Z806NDFSX2VJ79SVHHD29QEQ3BG31ANHZ60
+
+
# This specifies which database we use.
[merchantdb-postgres]
CONFIG = postgres:///talercheck
@@ -62,6 +68,10 @@ SALT = 17919252168512238964
ADDRESS = "Garching"
+###################################################
+# Configuration for the exchange for the testcase #
+###################################################
+
[exchange]
# How to access our database
DB = postgres
@@ -86,6 +96,7 @@ BANK_URI = "http://localhost/"
# Into which account at the 'bank' should (incoming) wire transfers be made?
BANK_ACCOUNT_NUMBER = 2
+
[coin_eur_ct_1]
value = EUR:0.01
duration_overlap = 5 minutes