summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorMarcello Stanisci <marcello.stanisci@inria.fr>2016-10-22 18:26:39 +0200
committerMarcello Stanisci <marcello.stanisci@inria.fr>2016-10-22 18:26:39 +0200
commit0f12281ca51a9d49ef59c35c89a4370e74b7931c (patch)
tree85e6828f3ab26d576c129471f30b692edc57f67a /src/lib
parent4617cba31344f4650bfe40583c47cb91adc15fad (diff)
downloadmerchant-0f12281ca51a9d49ef59c35c89a4370e74b7931c.tar.gz
merchant-0f12281ca51a9d49ef59c35c89a4370e74b7931c.tar.bz2
merchant-0f12281ca51a9d49ef59c35c89a4370e74b7931c.zip
receiver->instance. test passed
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/merchant_api_pay.c16
-rw-r--r--src/lib/merchant_api_track_transaction.c8
-rw-r--r--src/lib/merchant_api_track_transfer.c8
-rw-r--r--src/lib/test_merchant_api.c42
-rw-r--r--src/lib/test_merchant_api.conf6
5 files changed, 40 insertions, 40 deletions
diff --git a/src/lib/merchant_api_pay.c b/src/lib/merchant_api_pay.c
index 821534a7..0c06326a 100644
--- a/src/lib/merchant_api_pay.c
+++ b/src/lib/merchant_api_pay.c
@@ -252,7 +252,7 @@ handle_pay_finished (void *cls,
*
* @param ctx the execution loop context
* @param merchant_uri base URI of the merchant's backend
- * @param receiver which merchant instance will receive this payment
+ * @param instance which merchant instance will receive this payment
* @param h_wire hash of the merchant’s account details
* @param h_contract hash of the contact of the merchant with the customer
* @param transaction_id transaction id for the transaction between merchant and customer
@@ -278,7 +278,7 @@ handle_pay_finished (void *cls,
struct TALER_MERCHANT_Pay *
TALER_MERCHANT_pay_wallet (struct GNUNET_CURL_Context *ctx,
const char *merchant_uri,
- const char *receiver,
+ const char *instance,
const struct GNUNET_HashCode *h_contract,
uint64_t transaction_id,
const struct TALER_Amount *amount,
@@ -346,7 +346,7 @@ TALER_MERCHANT_pay_wallet (struct GNUNET_CURL_Context *ctx,
}
return TALER_MERCHANT_pay_frontend (ctx,
merchant_uri,
- receiver,
+ instance,
h_contract,
amount,
max_fee,
@@ -372,7 +372,7 @@ TALER_MERCHANT_pay_wallet (struct GNUNET_CURL_Context *ctx,
*
* @param ctx the execution loop context
* @param merchant_uri base URI of the merchant's backend
- * @param receiver which merchant instance will receive this payment
+ * @param instance which merchant instance will receive this payment
* @param h_contract hash of the contact of the merchant with the customer
* @param timestamp timestamp when the contract was finalized, must match approximately the current time of the merchant
* @param transaction_id transaction id for the transaction between merchant and customer
@@ -392,7 +392,7 @@ TALER_MERCHANT_pay_wallet (struct GNUNET_CURL_Context *ctx,
struct TALER_MERCHANT_Pay *
TALER_MERCHANT_pay_frontend (struct GNUNET_CURL_Context *ctx,
const char *merchant_uri,
- const char *receiver,
+ const char *instance,
const struct GNUNET_HashCode *h_contract,
const struct TALER_Amount *amount,
const struct TALER_Amount *max_fee,
@@ -578,10 +578,10 @@ TALER_MERCHANT_pay_frontend (struct GNUNET_CURL_Context *ctx,
"max_fee", TALER_JSON_from_amount (max_fee),
"amount", TALER_JSON_from_amount (amount),
"merchant_sig", GNUNET_JSON_from_data_auto (merchant_sig));
- if (NULL != receiver)
+ if (NULL != instance)
json_object_set_new (pay_obj,
- "receiver",
- json_string (receiver));
+ "instance",
+ json_string (instance));
if (0 != wire_transfer_deadline.abs_value_us)
{
diff --git a/src/lib/merchant_api_track_transaction.c b/src/lib/merchant_api_track_transaction.c
index c42b1128..4aed3c68 100644
--- a/src/lib/merchant_api_track_transaction.c
+++ b/src/lib/merchant_api_track_transaction.c
@@ -232,7 +232,7 @@ handle_track_transaction_finished (void *cls,
*
* @param ctx execution context
* @param backend_uri base URI of the backend
- * @param receiver which merchant instance is going to be tracked
+ * @param instance which merchant instance is going to be tracked
* @param transaction_id which transaction should we trace
* @param track_transaction_cb the callback to call when a reply for this request is available
* @param track_transaction_cb_cls closure for @a track_transaction_cb
@@ -241,7 +241,7 @@ handle_track_transaction_finished (void *cls,
struct TALER_MERCHANT_TrackTransactionHandle *
TALER_MERCHANT_track_transaction (struct GNUNET_CURL_Context *ctx,
const char *backend_uri,
- const char *receiver,
+ const char *instance,
uint64_t transaction_id,
TALER_MERCHANT_TrackTransactionCallback track_transaction_cb,
void *track_transaction_cb_cls)
@@ -254,10 +254,10 @@ TALER_MERCHANT_track_transaction (struct GNUNET_CURL_Context *ctx,
tdo->cb = track_transaction_cb;
tdo->cb_cls = track_transaction_cb_cls;
GNUNET_asprintf (&tdo->url,
- "%s/track/transaction?id=%llu&receiver=%s",
+ "%s/track/transaction?id=%llu&instance=%s",
backend_uri,
(unsigned long long) transaction_id,
- receiver);
+ instance);
eh = curl_easy_init ();
GNUNET_assert (CURLE_OK ==
curl_easy_setopt (eh,
diff --git a/src/lib/merchant_api_track_transfer.c b/src/lib/merchant_api_track_transfer.c
index 0c1b3af9..e7a1fdc3 100644
--- a/src/lib/merchant_api_track_transfer.c
+++ b/src/lib/merchant_api_track_transfer.c
@@ -215,7 +215,7 @@ handle_track_transfer_finished (void *cls,
*
* @param ctx execution context
* @param backend_uri base URI of the backend
- * @param receiver which merchant instance is going to be tracked
+ * @param instance which merchant instance is going to be tracked
* @param wtid base32 string indicating a wtid
* @param exchange base URL of the exchange in charge of returning the wanted information
* @param track_transfer_cb the callback to call when a reply for this request is available
@@ -225,7 +225,7 @@ handle_track_transfer_finished (void *cls,
struct TALER_MERCHANT_TrackTransferHandle *
TALER_MERCHANT_track_transfer (struct GNUNET_CURL_Context *ctx,
const char *backend_uri,
- const char *receiver,
+ const char *instance,
const struct TALER_WireTransferIdentifierRawP *wtid,
const char *exchange_uri,
TALER_MERCHANT_TrackTransferCallback track_transfer_cb,
@@ -243,11 +243,11 @@ TALER_MERCHANT_track_transfer (struct GNUNET_CURL_Context *ctx,
tdo->cb_cls = track_transfer_cb_cls;
/* TODO: do we need to escape 'exchange_uri' here? */
GNUNET_asprintf (&tdo->url,
- "%s/track/transfer?wtid=%s&exchange=%s&receiver=%s",
+ "%s/track/transfer?wtid=%s&exchange=%s&instance=%s",
backend_uri,
wtid_str,
exchange_uri,
- receiver);
+ instance);
GNUNET_free (wtid_str);
eh = curl_easy_init ();
GNUNET_assert (CURLE_OK ==
diff --git a/src/lib/test_merchant_api.c b/src/lib/test_merchant_api.c
index b81678a4..26d52bd0 100644
--- a/src/lib/test_merchant_api.c
+++ b/src/lib/test_merchant_api.c
@@ -66,24 +66,24 @@ static struct TALER_EXCHANGE_Handle *exchange;
static struct GNUNET_CURL_Context *ctx;
/**
- * Array of receivers to test against
+ * Array of instances to test against
*/
static char **instances;
/**
* How many merchant instances this test runs
*/
-unsigned int nreceiver = 0;
+unsigned int ninstances = 0;
/**
- * Current receiver
+ * Current instance
*/
-static char *receiver;
+static char *instance;
/**
- * Current receiver being tested
+ * Current instance being tested
*/
-unsigned int receiver_idx = 0;
+unsigned int instance_idx = 0;
/**
* Task run on timeout.
@@ -648,7 +648,7 @@ get_new_contracts (struct Command *cmds)
\"products\":\
[ {\"description\":\"ice cream\", \"value\":\"{EUR:5}\"} ]\
}",
- receiver_idx + d);
+ instance_idx + d);
}
}
@@ -763,7 +763,7 @@ history_cb (void *cls,
return;
}
nelements = json_array_size (json);
- if (nelements != (cmd->details.history.nresult * (receiver_idx + 1)))
+ if (nelements != (cmd->details.history.nresult * (instance_idx + 1)))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Did not get as many history entries as expected\n");
@@ -1461,17 +1461,17 @@ interpreter_run (void *cls)
{
case OC_END:
result = GNUNET_OK;
- if (receiver_idx + 1 == nreceiver)
+ if (instance_idx + 1 == ninstances)
{
GNUNET_SCHEDULER_shutdown ();
return;
}
is->ip = 0;
- receiver_idx++;
- receiver = instances[receiver_idx];
+ instance_idx++;
+ instance = instances[instance_idx];
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Switching instance: '%s'\n",
- receiver);
+ instance);
/*get_new_contracts(is->commands);*/
is->task = GNUNET_SCHEDULER_add_now (interpreter_run,
is);
@@ -1640,10 +1640,10 @@ interpreter_run (void *cls)
proposal = json_loads (cmd->details.contract.proposal,
JSON_REJECT_DUPLICATES,
&error);
- if (NULL != receiver)
+ if (NULL != instance)
json_object_set_new (proposal,
- "receiver",
- json_string (receiver));
+ "instance",
+ json_string (instance));
if (NULL == proposal)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -1773,7 +1773,7 @@ interpreter_run (void *cls)
cmd->details.pay.ph
= TALER_MERCHANT_pay_wallet (ctx,
MERCHANT_URI,
- receiver,
+ instance,
&h_contract,
transaction_id,
&total_amount,
@@ -1870,7 +1870,7 @@ interpreter_run (void *cls)
cmd->details.track_transfer.tdo =
TALER_MERCHANT_track_transfer (ctx,
MERCHANT_URI,
- receiver,
+ instance,
&ref->details.check_bank_transfer.wtid,
EXCHANGE_URI,
&track_transfer_cb,
@@ -1884,7 +1884,7 @@ interpreter_run (void *cls)
cmd->details.track_transaction.tth =
TALER_MERCHANT_track_transaction (ctx,
MERCHANT_URI,
- receiver, /* got it NULL, right now */
+ instance, /* got it NULL, right now */
ref->details.pay.transaction_id,
&track_transaction_cb,
is);
@@ -2454,12 +2454,12 @@ main (int argc,
"INSTANCES",
&_instances));
GNUNET_break (NULL != (token = strtok (_instances, " ")));
- GNUNET_array_append (instances, nreceiver, token);
+ GNUNET_array_append (instances, ninstances, token);
while (NULL != (token = strtok (NULL, " ")))
- GNUNET_array_append(instances, nreceiver, token);
+ GNUNET_array_append(instances, ninstances, token);
- receiver = instances[receiver_idx];
+ instance = instances[instance_idx];
db = TALER_MERCHANTDB_plugin_load (cfg);
if (NULL == db)
{
diff --git a/src/lib/test_merchant_api.conf b/src/lib/test_merchant_api.conf
index 80f49b3d..c05530f0 100644
--- a/src/lib/test_merchant_api.conf
+++ b/src/lib/test_merchant_api.conf
@@ -33,9 +33,9 @@ DB = postgres
# Which wireformat do we use?
WIREFORMAT = test
-# This option is a list of receivers which are to be used
-# during the tests. 'default' receiver should explicitly be given.
-# The receiver "token" X must match the corresponding substring in
+# This option is a list of instances which are to be used
+# during the tests. 'default' instance should explicitly be given.
+# The instance "token" X must match the corresponding substring in
# section like X-wireformat and merchant-instance-X
INSTANCES = tor default