From b96f3468a51098fd24f90a8b6b2802a29b964aea Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Fri, 24 Jun 2016 16:50:39 +0200 Subject: adapting /track API to use merchant instances --- src/lib/test_merchant_api.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'src/lib/test_merchant_api.c') 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) -- cgit v1.2.3