summaryrefslogtreecommitdiff
path: root/src/lib/test_merchant_api.c
diff options
context:
space:
mode:
authorMarcello Stanisci <marcello.stanisci@inria.fr>2016-06-24 16:50:39 +0200
committerMarcello Stanisci <marcello.stanisci@inria.fr>2016-06-24 16:50:39 +0200
commitb96f3468a51098fd24f90a8b6b2802a29b964aea (patch)
treee1239778bc975ec695fc78f31cbff7bb797282d6 /src/lib/test_merchant_api.c
parentc7cb7f925cabba012bf25160b14e65f287059b18 (diff)
downloadmerchant-b96f3468a51098fd24f90a8b6b2802a29b964aea.tar.gz
merchant-b96f3468a51098fd24f90a8b6b2802a29b964aea.tar.bz2
merchant-b96f3468a51098fd24f90a8b6b2802a29b964aea.zip
adapting /track API to use merchant instances
Diffstat (limited to 'src/lib/test_merchant_api.c')
-rw-r--r--src/lib/test_merchant_api.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/lib/test_merchant_api.c b/src/lib/test_merchant_api.c
index d3300605..d04f7f0e 100644
--- a/src/lib/test_merchant_api.c
+++ b/src/lib/test_merchant_api.c
@@ -63,7 +63,7 @@ static struct GNUNET_CURL_Context *ctx;
/**
* Which merchant instance we will run the testcase for
*/
-static char *instance;
+static char *receiver = NULL;
/**
@@ -1442,6 +1442,10 @@ interpreter_run (void *cls)
proposal = json_loads (cmd->details.contract.proposal,
JSON_REJECT_DUPLICATES,
&error);
+ if (NULL != receiver)
+ json_object_set_new (proposal,
+ "receiver",
+ json_string (receiver));
if (NULL == proposal)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -1564,11 +1568,13 @@ interpreter_run (void *cls)
return;
}
}
-
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Using receiver '%s'\n",
+ receiver);
cmd->details.pay.ph
= TALER_MERCHANT_pay_wallet (ctx,
MERCHANT_URI,
- NULL,
+ receiver,
&h_contract,
transaction_id,
&total_amount,
@@ -1663,6 +1669,7 @@ interpreter_run (void *cls)
cmd->details.track_transfer.tdo =
TALER_MERCHANT_track_transfer (ctx,
MERCHANT_URI,
+ receiver,
&ref->details.check_bank_transfer.wtid,
EXCHANGE_URI,
&track_transfer_cb,
@@ -1675,6 +1682,7 @@ interpreter_run (void *cls)
cmd->details.track_transaction.tth =
TALER_MERCHANT_track_transaction (ctx,
MERCHANT_URI,
+ receiver,
ref->details.pay.transaction_id,
&track_transaction_cb,
is);
@@ -1845,7 +1853,7 @@ do_shutdown (void *cls)
is->task = NULL;
}
GNUNET_free (is);
- GNUNET_free_non_null (instance);
+ GNUNET_free_non_null (receiver);
if (NULL != exchange)
{
TALER_EXCHANGE_disconnect (exchange);
@@ -2161,10 +2169,10 @@ main (int argc,
if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (cfg,
"merchant",
"INSTANCE",
- &instance))
+ &receiver))
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Using non default instance '%s'\n",
- instance);
+ "Using non default receiver '%s'\n",
+ receiver);
db = TALER_MERCHANTDB_plugin_load (cfg);
if (NULL == db)