use url instead of uri consistently
This commit is contained in:
parent
d126b16624
commit
e318edb5e5
@ -91,7 +91,7 @@ TALER_BANK_make_auth_header_ (const struct TALER_BANK_AuthenticationData *auth)
|
||||
*
|
||||
* @param u base URL of the bank
|
||||
* @param path Taler API path (i.e. "/history")
|
||||
* @return the full URI to use with cURL
|
||||
* @return the full URL to use with cURL
|
||||
*/
|
||||
char *
|
||||
TALER_BANK_path_to_url_ (const char *u,
|
||||
|
@ -44,7 +44,7 @@ TALER_BANK_make_auth_header_ (const struct TALER_BANK_AuthenticationData *auth);
|
||||
*
|
||||
* @param u base URL of the bank
|
||||
* @param path Taler API path (i.e. "/history")
|
||||
* @return the full URI to use with cURL
|
||||
* @return the full URL to use with cURL
|
||||
*/
|
||||
char *
|
||||
TALER_BANK_path_to_url_ (const char *u,
|
||||
|
@ -138,7 +138,7 @@ parse_account_history (struct TALER_BANK_HistoryHandle *hh,
|
||||
}
|
||||
td.account_details = json_pack ("{s:s, s:s, s:I}",
|
||||
"type", "test",
|
||||
"bank_uri", hh->bank_base_url,
|
||||
"bank_url", hh->bank_base_url,
|
||||
"account_number", (json_int_t) other_account);
|
||||
hh->hcb (hh->hcb_cls,
|
||||
MHD_HTTP_OK,
|
||||
|
@ -958,7 +958,7 @@ handle_mhd_request (void *cls,
|
||||
connection,
|
||||
con_cls);
|
||||
|
||||
/* Unexpected URI path, just close the connection. */
|
||||
/* Unexpected URL path, just close the connection. */
|
||||
/* we're rather impolite here, but it's a testcase. */
|
||||
GNUNET_break_op (0);
|
||||
return MHD_NO;
|
||||
|
@ -330,7 +330,7 @@ build_history (struct InterpreterState *is,
|
||||
= json_pack ("{s:s, s:s, s:I}",
|
||||
"type",
|
||||
"test",
|
||||
"bank_uri",
|
||||
"bank_url",
|
||||
"http://localhost:8080",
|
||||
"account_number",
|
||||
(json_int_t) pos->details.admin_add_incoming.debit_account_no);
|
||||
@ -347,7 +347,7 @@ build_history (struct InterpreterState *is,
|
||||
= json_pack ("{s:s, s:s, s:I}",
|
||||
"type",
|
||||
"test",
|
||||
"bank_uri",
|
||||
"bank_url",
|
||||
"http://localhost:8080",
|
||||
"account_number",
|
||||
(json_int_t) pos->details.admin_add_incoming.credit_account_no);
|
||||
|
@ -1 +1 @@
|
||||
{"type":"test", "bank_uri":"http://localhost:8082/", "account_number":63}
|
||||
{"type":"test", "bank_url":"http://localhost:8082/", "account_number":63}
|
||||
|
@ -1 +1 @@
|
||||
{"type":"test", "bank_uri":"http://localhost:8082/", "account_number":64}
|
||||
{"type":"test", "bank_url":"http://localhost:8082/", "account_number":64}
|
||||
|
@ -288,7 +288,7 @@ static unsigned int pool_size = 100;
|
||||
static char *config_file;
|
||||
|
||||
/**
|
||||
* Configuation object (used to get BANK_URI)
|
||||
* Configuation object (used to get BANK_URL)
|
||||
*/
|
||||
static struct GNUNET_CONFIGURATION_Handle *cfg;
|
||||
|
||||
@ -371,15 +371,15 @@ static struct Coin *coins;
|
||||
static struct TALER_MerchantPrivateKeyP merchant_priv;
|
||||
|
||||
/**
|
||||
* URI under which the exchange is reachable during the benchmark.
|
||||
* URL under which the exchange is reachable during the benchmark.
|
||||
*/
|
||||
static char *exchange_uri;
|
||||
static char *exchange_url;
|
||||
|
||||
/**
|
||||
* URI under which the administrative exchange is reachable during the
|
||||
* URL under which the administrative exchange is reachable during the
|
||||
* benchmark.
|
||||
*/
|
||||
static char *exchange_admin_uri;
|
||||
static char *exchange_admin_url;
|
||||
|
||||
/**
|
||||
* Used currency (read from /keys' output)
|
||||
@ -1641,7 +1641,7 @@ run (void *cls)
|
||||
GNUNET_assert (NULL != rc);
|
||||
fakebank = TALER_FAKEBANK_start (8082);
|
||||
exchange = TALER_EXCHANGE_connect (ctx,
|
||||
exchange_uri,
|
||||
exchange_url,
|
||||
&cert_cb, NULL,
|
||||
TALER_EXCHANGE_OPTION_END);
|
||||
if (NULL == exchange)
|
||||
@ -1667,15 +1667,15 @@ main (int argc,
|
||||
GNUNET_GETOPT_option_mandatory
|
||||
(GNUNET_GETOPT_option_cfgfile (&config_file)),
|
||||
GNUNET_GETOPT_option_string ('e',
|
||||
"exchange-uri",
|
||||
"URI",
|
||||
"URI of the exchange",
|
||||
&exchange_uri),
|
||||
"exchange-url",
|
||||
"URL",
|
||||
"URL of the exchange",
|
||||
&exchange_url),
|
||||
GNUNET_GETOPT_option_string ('E',
|
||||
"exchange-admin-uri",
|
||||
"URI",
|
||||
"URI of the administrative interface of the exchange",
|
||||
&exchange_admin_uri),
|
||||
"exchange-admin-url",
|
||||
"URL",
|
||||
"URL of the administrative interface of the exchange",
|
||||
&exchange_admin_url),
|
||||
GNUNET_GETOPT_option_help ("tool to benchmark the Taler exchange"),
|
||||
GNUNET_GETOPT_option_uint ('s',
|
||||
"pool-size",
|
||||
@ -1712,14 +1712,14 @@ main (int argc,
|
||||
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
|
||||
"Number of iterations below WARM_THRESHOLD of %llu\n",
|
||||
WARM_THRESHOLD);
|
||||
if ( (NULL == exchange_uri) ||
|
||||
(0 == strlen (exchange_uri) ))
|
||||
if ( (NULL == exchange_url) ||
|
||||
(0 == strlen (exchange_url) ))
|
||||
{
|
||||
GNUNET_free_non_null (exchange_uri);
|
||||
exchange_uri = GNUNET_strdup ("http://localhost:8081/");
|
||||
GNUNET_free_non_null (exchange_url);
|
||||
exchange_url = GNUNET_strdup ("http://localhost:8081/");
|
||||
}
|
||||
if (NULL == exchange_admin_uri)
|
||||
exchange_admin_uri = GNUNET_strdup ("http://localhost:18080/");
|
||||
if (NULL == exchange_admin_url)
|
||||
exchange_admin_url = GNUNET_strdup ("http://localhost:18080/");
|
||||
if (run_exchange)
|
||||
{
|
||||
char *wget;
|
||||
@ -1773,8 +1773,8 @@ main (int argc,
|
||||
|
||||
GNUNET_asprintf (&wget,
|
||||
"wget -q -t 1 -T 1 %s%skeys -o /dev/null -O /dev/null",
|
||||
exchange_uri,
|
||||
(exchange_uri[strlen (exchange_uri)-1] == '/') ? "" : "/");
|
||||
exchange_url,
|
||||
(exchange_url[strlen (exchange_url)-1] == '/') ? "" : "/");
|
||||
cnt = 0;
|
||||
do {
|
||||
fprintf (stderr, ".");
|
||||
|
@ -28,7 +28,7 @@ ENABLE = YES
|
||||
|
||||
# What is the main website of the bank?
|
||||
# (Not used unless the aggregator is run.)
|
||||
BANK_URI = "http://localhost:8082/"
|
||||
BANK_URL = "http://localhost:8082/"
|
||||
# From which account at the 'bank' should outgoing wire transfers be made?
|
||||
BANK_ACCOUNT_NUMBER = 2
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
"salt": "AZPRFVJ58NM6M7J5CZQPJAH3EW5DYM52AEZ9Y1C1ER3W94QV8D8TQKF6CK8MYQRA9QMSKDQTGZ306ZS9GQ0M6R01CJ20KPP49WFDZK8",
|
||||
"name": "The exchange",
|
||||
"account_number": 3,
|
||||
"bank_uri": "http://localhost:8082/",
|
||||
"bank_url": "http://localhost:8082/",
|
||||
"type": "test",
|
||||
"sig": "RPQXP9S4P8PQP7HEZQNRSZCT0ATNEP8GW0P5TPM34V5RX86FCD670V44R9NETSYDDKB8SZV7TKY9PAJYTY51D3VDWY9XXQ5BPFRXR28"
|
||||
}
|
@ -956,7 +956,7 @@ MAH_handle_is_ready (struct TALER_EXCHANGE_Handle *h)
|
||||
*
|
||||
* @param h handle for the exchange
|
||||
* @param path Taler API path (i.e. "/reserve/withdraw")
|
||||
* @return the full URI to use with cURL
|
||||
* @return the full URL to use with cURL
|
||||
*/
|
||||
char *
|
||||
MAH_path_to_url (struct TALER_EXCHANGE_Handle *h,
|
||||
@ -972,7 +972,7 @@ MAH_path_to_url (struct TALER_EXCHANGE_Handle *h,
|
||||
*
|
||||
* @param base_url base URL of the exchange (i.e. "http://exchange/")
|
||||
* @param path Taler API path (i.e. "/reserve/withdraw")
|
||||
* @return the full URI to use with cURL
|
||||
* @return the full URL to use with cURL
|
||||
*/
|
||||
char *
|
||||
MAH_path_to_url2 (const char *base_url,
|
||||
|
@ -49,7 +49,7 @@ MAH_handle_is_ready (struct TALER_EXCHANGE_Handle *h);
|
||||
*
|
||||
* @param h the exchange handle to query
|
||||
* @param path Taler API path (i.e. "/reserve/withdraw")
|
||||
* @return the full URI to use with cURL
|
||||
* @return the full URL to use with cURL
|
||||
*/
|
||||
char *
|
||||
MAH_path_to_url (struct TALER_EXCHANGE_Handle *h,
|
||||
@ -61,7 +61,7 @@ MAH_path_to_url (struct TALER_EXCHANGE_Handle *h,
|
||||
*
|
||||
* @param base_url base URL of the exchange (i.e. "http://exchange/")
|
||||
* @param path Taler API path (i.e. "/reserve/withdraw")
|
||||
* @return the full URI to use with cURL
|
||||
* @return the full URL to use with cURL
|
||||
*/
|
||||
char *
|
||||
MAH_path_to_url2 (const char *base_url,
|
||||
|
@ -3252,7 +3252,7 @@ run (void *cls)
|
||||
.expected_response_code = MHD_HTTP_OK,
|
||||
.details.deposit.amount = "EUR:5",
|
||||
.details.deposit.coin_ref = "withdraw-coin-1",
|
||||
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":42 }",
|
||||
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_url\":\"http://localhost:8082/\", \"account_number\":42 }",
|
||||
.details.deposit.contract_terms = "{ \"items\": [ { \"name\":\"ice cream\", \"value\":1 } ] }" },
|
||||
|
||||
/* Try to overdraw funds ... */
|
||||
@ -3268,7 +3268,7 @@ run (void *cls)
|
||||
.expected_response_code = MHD_HTTP_FORBIDDEN,
|
||||
.details.deposit.amount = "EUR:5",
|
||||
.details.deposit.coin_ref = "withdraw-coin-1",
|
||||
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":43 }",
|
||||
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_url\":\"http://localhost:8082/\", \"account_number\":43 }",
|
||||
.details.deposit.contract_terms = "{ \"items\": [ { \"name\":\"ice cream\", \"value\":1 } ] }" },
|
||||
/* Try to double-spend the 5 EUR coin at the same merchant (but different
|
||||
transaction ID) */
|
||||
@ -3277,7 +3277,7 @@ run (void *cls)
|
||||
.expected_response_code = MHD_HTTP_FORBIDDEN,
|
||||
.details.deposit.amount = "EUR:5",
|
||||
.details.deposit.coin_ref = "withdraw-coin-1",
|
||||
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":42 }",
|
||||
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_url\":\"http://localhost:8082/\", \"account_number\":42 }",
|
||||
.details.deposit.contract_terms = "{ \"items\": [ { \"name\":\"ice cream\", \"value\":1 } ] }" },
|
||||
/* Try to double-spend the 5 EUR coin at the same merchant (but different
|
||||
proposal) */
|
||||
@ -3286,7 +3286,7 @@ run (void *cls)
|
||||
.expected_response_code = MHD_HTTP_FORBIDDEN,
|
||||
.details.deposit.amount = "EUR:5",
|
||||
.details.deposit.coin_ref = "withdraw-coin-1",
|
||||
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":42 }",
|
||||
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_url\":\"http://localhost:8082/\", \"account_number\":42 }",
|
||||
.details.deposit.contract_terms = "{ \"items\":[{ \"name\":\"ice cream\", \"value\":2 } ] }" },
|
||||
|
||||
/* ***************** /refresh testing ******************** */
|
||||
@ -3316,7 +3316,7 @@ run (void *cls)
|
||||
.expected_response_code = MHD_HTTP_OK,
|
||||
.details.deposit.amount = "EUR:1",
|
||||
.details.deposit.coin_ref = "refresh-withdraw-coin-1",
|
||||
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":42 }",
|
||||
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_url\":\"http://localhost:8082/\", \"account_number\":42 }",
|
||||
.details.deposit.contract_terms = "{ \"items\" : [ { \"name\":\"ice cream\", \"value\":\"EUR:1\" } ] }" },
|
||||
|
||||
/* Melt the rest of the coin's value (EUR:4.00 = 3x EUR:1.03 + 7x EUR:0.13) */
|
||||
@ -3357,7 +3357,7 @@ run (void *cls)
|
||||
.details.deposit.amount = "EUR:1",
|
||||
.details.deposit.coin_ref = "refresh-reveal-1-idempotency",
|
||||
.details.deposit.coin_idx = 0,
|
||||
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":42 }",
|
||||
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_url\":\"http://localhost:8082/\", \"account_number\":42 }",
|
||||
.details.deposit.contract_terms = "{ \"items\": [ { \"name\":\"ice cream\", \"value\":3 } ] }" },
|
||||
|
||||
/* Test successfully spending coins from the refresh operation:
|
||||
@ -3368,7 +3368,7 @@ run (void *cls)
|
||||
.details.deposit.amount = "EUR:0.1",
|
||||
.details.deposit.coin_ref = "refresh-reveal-1",
|
||||
.details.deposit.coin_idx = 4,
|
||||
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":43 }",
|
||||
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_url\":\"http://localhost:8082/\", \"account_number\":43 }",
|
||||
.details.deposit.contract_terms = "{ \"items\": [ { \"name\":\"ice cream\", \"value\":3 } ] }" },
|
||||
|
||||
/* Test running a failing melt operation (same operation again must fail) */
|
||||
@ -3507,7 +3507,7 @@ run (void *cls)
|
||||
.expected_response_code = MHD_HTTP_OK,
|
||||
.details.deposit.amount = "EUR:5",
|
||||
.details.deposit.coin_ref = "withdraw-coin-r1",
|
||||
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":42 }",
|
||||
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_url\":\"http://localhost:8082/\", \"account_number\":42 }",
|
||||
.details.deposit.contract_terms = "{ \"items\" : [ { \"name\":\"ice cream\", \"value\":\"EUR:5\" } ] }",
|
||||
.details.deposit.refund_deadline = { 60LL * 1000 * 1000 } /* 60 s */,
|
||||
},
|
||||
@ -3539,7 +3539,7 @@ run (void *cls)
|
||||
.expected_response_code = MHD_HTTP_OK,
|
||||
.details.deposit.amount = "EUR:4.99",
|
||||
.details.deposit.coin_ref = "withdraw-coin-r1",
|
||||
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":42 }",
|
||||
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_url\":\"http://localhost:8082/\", \"account_number\":42 }",
|
||||
.details.deposit.contract_terms = "{ \"items\" : [ { \"name\":\"more ice cream\", \"value\":\"EUR:5\" } ] }",
|
||||
},
|
||||
/* Run transfers. This will do the transfer as refund deadline was 0 */
|
||||
@ -3591,7 +3591,7 @@ run (void *cls)
|
||||
.expected_response_code = MHD_HTTP_OK,
|
||||
.details.deposit.amount = "EUR:5",
|
||||
.details.deposit.coin_ref = "withdraw-coin-rb",
|
||||
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":42 }",
|
||||
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_url\":\"http://localhost:8082/\", \"account_number\":42 }",
|
||||
.details.deposit.contract_terms = "{ \"items\" : [ { \"name\":\"ice cream\", \"value\":\"EUR:5\" } ] }",
|
||||
.details.deposit.refund_deadline = { 0 },
|
||||
},
|
||||
@ -3695,7 +3695,7 @@ run (void *cls)
|
||||
.expected_response_code = MHD_HTTP_OK,
|
||||
.details.deposit.amount = "EUR:0.5",
|
||||
.details.deposit.coin_ref = "payback-withdraw-coin-2a",
|
||||
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":42 }",
|
||||
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_url\":\"http://localhost:8082/\", \"account_number\":42 }",
|
||||
.details.deposit.contract_terms = "{ \"items\": [ { \"name\":\"more ice cream\", \"value\":1 } ] }" },
|
||||
{ .oc = OC_REVOKE,
|
||||
.label = "revoke-2",
|
||||
@ -3716,7 +3716,7 @@ run (void *cls)
|
||||
.expected_response_code = MHD_HTTP_NOT_FOUND,
|
||||
.details.deposit.amount = "EUR:1",
|
||||
.details.deposit.coin_ref = "payback-withdraw-coin-2b",
|
||||
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":42 }",
|
||||
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_url\":\"http://localhost:8082/\", \"account_number\":42 }",
|
||||
.details.deposit.contract_terms = "{ \"items\": [ { \"name\":\"more ice cream\", \"value\":1 } ] }" },
|
||||
|
||||
/* Test deposit fails after payback, with proof in payback */
|
||||
@ -3727,7 +3727,7 @@ run (void *cls)
|
||||
.expected_response_code = MHD_HTTP_NOT_FOUND,
|
||||
.details.deposit.amount = "EUR:0.5",
|
||||
.details.deposit.coin_ref = "payback-withdraw-coin-2a",
|
||||
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":42 }",
|
||||
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_url\":\"http://localhost:8082/\", \"account_number\":42 }",
|
||||
.details.deposit.contract_terms = "{ \"items\": [ { \"name\":\"extra ice cream\", \"value\":1 } ] }" },
|
||||
|
||||
|
||||
|
@ -98,7 +98,7 @@ CLOSING-FEE-2026 = EUR:0.01
|
||||
TEST_RESPONSE_FILE = ${TALER_CONFIG_HOME}/test.json
|
||||
|
||||
# What is the main website of the bank?
|
||||
BANK_URI = "http://localhost:8082/"
|
||||
BANK_URL = "http://localhost:8082/"
|
||||
# From which account at the 'bank' should outgoing wire transfers be made?
|
||||
BANK_ACCOUNT_NUMBER = 2
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
"salt": "AZPRFVJ58NM6M7J5CZQPJAH3EW5DYM52AEZ9Y1C1ER3W94QV8D8TQKF6CK8MYQRA9QMSKDQTGZ306ZS9GQ0M6R01CJ20KPP49WFDZK8",
|
||||
"name": "The exchange",
|
||||
"account_number": 3,
|
||||
"bank_uri": "http://localhost:8082/",
|
||||
"bank_url": "http://localhost:8082/",
|
||||
"type": "test",
|
||||
"sig": "RPQXP9S4P8PQP7HEZQNRSZCT0ATNEP8GW0P5TPM34V5RX86FCD670V44R9NETSYDDKB8SZV7TKY9PAJYTY51D3VDWY9XXQ5BPFRXR28"
|
||||
}
|
@ -98,7 +98,7 @@ CLOSING-FEE-2026 = EUR:0.01
|
||||
TEST_RESPONSE_FILE = ${TALER_CONFIG_HOME}/test.json
|
||||
|
||||
# What is the main website of the bank?
|
||||
BANK_URI = "http://localhost:8082/"
|
||||
BANK_URL = "http://localhost:8082/"
|
||||
# From which account at the 'bank' should outgoing wire transfers be made?
|
||||
BANK_ACCOUNT_NUMBER = 2
|
||||
|
||||
|
@ -37,7 +37,7 @@
|
||||
#define CONFIG_FILE "test_exchange_api.conf"
|
||||
|
||||
/**
|
||||
* URL of the fakebank. Obtained from CONFIG_FILE's "exchange-wire-test:BANK_URI" option.
|
||||
* URL of the fakebank. Obtained from CONFIG_FILE's "exchange-wire-test:BANK_URL" option.
|
||||
*/
|
||||
static char *fakebank_url;
|
||||
|
||||
|
@ -348,12 +348,12 @@ TALER_TESTING_prepare_fakebank (const char *config_filename)
|
||||
if (GNUNET_OK !=
|
||||
GNUNET_CONFIGURATION_get_value_string (cfg,
|
||||
"exchange-wire-test",
|
||||
"BANK_URI",
|
||||
"BANK_URL",
|
||||
&fakebank_url))
|
||||
{
|
||||
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING,
|
||||
"exchange-wire-test",
|
||||
"BANK_URI");
|
||||
"BANK_URL");
|
||||
GNUNET_CONFIGURATION_destroy (cfg);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -12,7 +12,7 @@
|
||||
# -m, --merchant (generate configuration for the merchant)
|
||||
# -t, --trusted (generate configuration for exchange and merchant, with exchange set as trusted with merchant)
|
||||
# -w WIREFORMAT, --wire=WIREFORMAT (which wire plugin should we use)
|
||||
# --bank-uri=URI (only for WIREFORMAT='test')
|
||||
# --bank-url=URL (only for WIREFORMAT='test')
|
||||
# --exchange-bank-account=NUMBER (only for WIREFORMAT='test')
|
||||
# --merchant-bank-account=NUMBER (only for WIREFORMAT='test')
|
||||
|
||||
@ -27,13 +27,13 @@ ARG_JM=
|
||||
ARG_M=0
|
||||
ARG_T=0
|
||||
ARG_W=test
|
||||
ARG_BANK_URI=
|
||||
ARG_BANK_URL=
|
||||
ARG_EXCHANGE_BANK_ACCOUNT=
|
||||
ARG_MERCHANT_BANK_ACCOUNT=
|
||||
|
||||
##################################
|
||||
# read the options
|
||||
TEMP=`getopt -o c:C:ef:hj:J:mtw: --long config:,currency:,exchange,wirefee:,help,wire-json-exchange:,wire-json-merchant:,merchant,trusted,wire:,bank-uri:,exchange-bank-account:,merchant-bank-account: -n 'taler-config-generate' -- "$@"`
|
||||
TEMP=`getopt -o c:C:ef:hj:J:mtw: --long config:,currency:,exchange,wirefee:,help,wire-json-exchange:,wire-json-merchant:,merchant,trusted,wire:,bank-url:,exchange-bank-account:,merchant-bank-account: -n 'taler-config-generate' -- "$@"`
|
||||
eval set -- "$TEMP"
|
||||
|
||||
####################################################
|
||||
@ -70,8 +70,8 @@ while true ; do
|
||||
-w|--wire)
|
||||
ARG_W="$2"
|
||||
shift 2 ;;
|
||||
--bank-uri)
|
||||
ARG_BANK_URI="$2"
|
||||
--bank-url)
|
||||
ARG_BANK_URL="$2"
|
||||
shift 2 ;;
|
||||
--exchange-bank-account)
|
||||
ARG_EXCHANGE_BANK_ACCOUNT="$2"
|
||||
@ -111,19 +111,19 @@ fi
|
||||
# Assemble JSON description of wireformat for "test" if we can
|
||||
if (test "test" = "$ARG_W")
|
||||
then
|
||||
if (test ! -z "$ARG_BANK_URI" -a ! -z "$ARG_MERCHANT_BANK_ACCOUNT")
|
||||
if (test ! -z "$ARG_BANK_URL" -a ! -z "$ARG_MERCHANT_BANK_ACCOUNT")
|
||||
then
|
||||
ARG_JM="{\"type\":\"test\",\"bank_uri\":\"$ARG_BANK_URI\",\"account_number\":$ARG_MERCHANT_BANK_ACCOUNT}"
|
||||
ARG_JM="{\"type\":\"test\",\"bank_url\":\"$ARG_BANK_URL\",\"account_number\":$ARG_MERCHANT_BANK_ACCOUNT}"
|
||||
# echo "Account detail: $ARG_JM"
|
||||
else
|
||||
echo "Bank URI or account not given, skipping JSON generation for merchant"
|
||||
echo "Bank URL or account not given, skipping JSON generation for merchant"
|
||||
fi
|
||||
if (test ! -z "$ARG_BANK_URI" -a ! -z "$ARG_EXCHANGE_BANK_ACCOUNT")
|
||||
if (test ! -z "$ARG_BANK_URL" -a ! -z "$ARG_EXCHANGE_BANK_ACCOUNT")
|
||||
then
|
||||
ARG_JE="{\"type\":\"test\",\"bank_uri\":\"$ARG_BANK_URI\",\"account_number\":$ARG_EXCHANGE_BANK_ACCOUNT}"
|
||||
ARG_JE="{\"type\":\"test\",\"bank_url\":\"$ARG_BANK_URL\",\"account_number\":$ARG_EXCHANGE_BANK_ACCOUNT}"
|
||||
# echo "Account detail: $ARG_JE"
|
||||
else
|
||||
echo "Bank URI or account not given, skipping JSON generation for exchange"
|
||||
echo "Bank URL or account not given, skipping JSON generation for exchange"
|
||||
fi
|
||||
else
|
||||
echo "Wire format is not 'test', not auto-generating JSON"
|
||||
@ -185,9 +185,9 @@ then
|
||||
$CS -s exchange-wire-$WMETHOD -o ENABLE -V YES || exit 1
|
||||
|
||||
# If possible, initialize outgoing wire account details ('test' method only)
|
||||
if (test "test" = "$WMETHOD" -a ! -z "$ARG_BANK_URI")
|
||||
if (test "test" = "$WMETHOD" -a ! -z "$ARG_BANK_URL")
|
||||
then
|
||||
$CS -s exchange-wire-test -o BANK_URI -V "$ARG_BANK_URI" || exit 1
|
||||
$CS -s exchange-wire-test -o BANK_URL -V "$ARG_BANK_URL" || exit 1
|
||||
else
|
||||
echo "Skipped generating wire account details for exchange"
|
||||
fi
|
||||
@ -236,7 +236,7 @@ then
|
||||
if (test 1 = "$ARG_E")
|
||||
then
|
||||
EPORT=`$CS -s exchange -o PORT`
|
||||
$CS -s merchant-exchange-test -o URI -V "http://localhost:$EPORT/" || exit
|
||||
$CS -s merchant-exchange-test -o URL -V "http://localhost:$EPORT/" || exit
|
||||
$CS -s merchant-exchange-test -o MASTER_KEY -V `$CS -s exchange -o MASTER_PUBLIC_KEY`
|
||||
else
|
||||
echo "Need to be configuring exchange as well for -t to be useful."
|
||||
|
@ -64,7 +64,7 @@ CLOSING-FEE-2026 = EUR:0.01
|
||||
|
||||
|
||||
# What is the main website of the bank?
|
||||
BANK_URI = "http://localhost:8082/"
|
||||
BANK_URL = "http://localhost:8082/"
|
||||
|
||||
# From which account at the 'bank' should outgoing
|
||||
# wire transfers be made?
|
||||
|
@ -66,7 +66,7 @@ CLOSING-FEE-2026 = EUR:0.01
|
||||
|
||||
|
||||
# What is the main website of the bank?
|
||||
BANK_URI = "http://localhost:8082/"
|
||||
BANK_URL = "http://localhost:8082/"
|
||||
|
||||
# From which account at the 'bank' should outgoing
|
||||
# wire transfers be made?
|
||||
|
@ -434,7 +434,7 @@ do_deposit (struct Command *cmd)
|
||||
/* Build JSON for wire details */
|
||||
deposit.receiver_wire_account = json_pack ("{s:s, s:s, s:I}",
|
||||
"type", "test",
|
||||
"bank_uri", "http://localhost:8082/",
|
||||
"bank_url", "http://localhost:8082/",
|
||||
"account_number", (json_int_t) cmd->details.deposit.merchant_account);
|
||||
GNUNET_assert (GNUNET_OK ==
|
||||
TALER_JSON_hash (deposit.receiver_wire_account,
|
||||
|
@ -37,7 +37,7 @@ DB_CONN_STR = "postgres:///talercheck"
|
||||
ENABLE = YES
|
||||
|
||||
# What is the main website of the bank?
|
||||
BANK_URI = "http://localhost:8082/"
|
||||
BANK_URL = "http://localhost:8082/"
|
||||
|
||||
# From which account at the 'bank' should outgoing
|
||||
# wire transfers be made?
|
||||
|
@ -2,7 +2,7 @@
|
||||
"salt": "AZPRFVJ58NM6M7J5CZQPJAH3EW5DYM52AEZ9Y1C1ER3W94QV8D8TQKF6CK8MYQRA9QMSKDQTGZ306ZS9GQ0M6R01CJ20KPP49WFDZK8",
|
||||
"name": "The exchange",
|
||||
"account_number": 3,
|
||||
"bank_uri": "http://localhost:8082/",
|
||||
"bank_url": "http://localhost:8082/",
|
||||
"type": "test",
|
||||
"sig": "RPQXP9S4P8PQP7HEZQNRSZCT0ATNEP8GW0P5TPM34V5RX86FCD670V44R9NETSYDDKB8SZV7TKY9PAJYTY51D3VDWY9XXQ5BPFRXR28"
|
||||
}
|
@ -212,7 +212,7 @@ struct TALER_BANK_TransferDetails
|
||||
|
||||
/**
|
||||
* Wire transfer subject. Usually a reserve public key
|
||||
* followed by the BASE URI of the exchange.
|
||||
* followed by the base URL of the exchange.
|
||||
*/
|
||||
char *wire_transfer_subject;
|
||||
|
||||
|
@ -33,9 +33,9 @@ struct TemplateClosure
|
||||
{
|
||||
|
||||
/**
|
||||
* URI of the bank for sending funds to the bank.
|
||||
* URL of the bank for sending funds to the bank.
|
||||
*/
|
||||
char *bank_uri;
|
||||
char *bank_url;
|
||||
|
||||
/**
|
||||
* Which currency do we support?
|
||||
@ -285,12 +285,12 @@ libtaler_plugin_wire_template_init (void *cls)
|
||||
if (GNUNET_OK !=
|
||||
GNUNET_CONFIGURATION_get_value_string (cfg,
|
||||
"exchange-wire-template",
|
||||
"bank_uri",
|
||||
&tc->bank_uri))
|
||||
"bank_url",
|
||||
&tc->bank_url))
|
||||
{
|
||||
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
|
||||
"exchange-wire-template",
|
||||
"bank_uri");
|
||||
"bank_url");
|
||||
GNUNET_free (tc);
|
||||
return NULL;
|
||||
}
|
||||
@ -303,7 +303,7 @@ libtaler_plugin_wire_template_init (void *cls)
|
||||
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
|
||||
"taler",
|
||||
"CURRENCY");
|
||||
GNUNET_free (tc->bank_uri);
|
||||
GNUNET_free (tc->bank_url);
|
||||
GNUNET_free (tc);
|
||||
return NULL;
|
||||
}
|
||||
@ -336,7 +336,7 @@ libtaler_plugin_wire_template_done (void *cls)
|
||||
struct TALER_WIRE_Plugin *plugin = cls;
|
||||
struct TemplateClosure *tc = plugin->cls;
|
||||
|
||||
GNUNET_free (tc->bank_uri);
|
||||
GNUNET_free (tc->bank_url);
|
||||
GNUNET_free (tc->currency);
|
||||
GNUNET_free (tc);
|
||||
GNUNET_free (plugin);
|
||||
|
@ -41,9 +41,9 @@ struct TestClosure
|
||||
char *currency;
|
||||
|
||||
/**
|
||||
* URI of our bank.
|
||||
* URL of our bank.
|
||||
*/
|
||||
char *bank_uri;
|
||||
char *bank_url;
|
||||
|
||||
/**
|
||||
* Authentication information.
|
||||
@ -187,12 +187,12 @@ test_amount_round (void *cls,
|
||||
* Compute purpose for signing.
|
||||
*
|
||||
* @param account number of the account
|
||||
* @param bank_uri URI of the bank
|
||||
* @param bank_url URL of the bank
|
||||
* @param[out] wsd purpose to be signed
|
||||
*/
|
||||
static void
|
||||
compute_purpose (uint64_t account,
|
||||
const char *bank_uri,
|
||||
const char *bank_url,
|
||||
struct TALER_MasterWireDetailsPS *wsd)
|
||||
{
|
||||
struct GNUNET_HashContext *hc;
|
||||
@ -208,8 +208,8 @@ compute_purpose (uint64_t account,
|
||||
&n,
|
||||
sizeof (n));
|
||||
GNUNET_CRYPTO_hash_context_read (hc,
|
||||
bank_uri,
|
||||
strlen (bank_uri) + 1);
|
||||
bank_url,
|
||||
strlen (bank_url) + 1);
|
||||
GNUNET_CRYPTO_hash_context_finish (hc,
|
||||
&wsd->h_sepa_details);
|
||||
}
|
||||
@ -236,7 +236,7 @@ test_wire_validate (void *cls,
|
||||
struct TestClosure *tc = cls;
|
||||
json_error_t error;
|
||||
json_int_t account_no;
|
||||
const char *bank_uri;
|
||||
const char *bank_url;
|
||||
const char *sig_s;
|
||||
struct TALER_MasterWireDetailsPS wsd;
|
||||
struct TALER_MasterSignatureP sig;
|
||||
@ -248,7 +248,7 @@ test_wire_validate (void *cls,
|
||||
0,
|
||||
"{s:I, s:s}",
|
||||
"account_number", &account_no,
|
||||
"bank_uri", &bank_uri))
|
||||
"bank_url", &bank_url))
|
||||
{
|
||||
char *dump;
|
||||
|
||||
@ -270,14 +270,14 @@ test_wire_validate (void *cls,
|
||||
account_no);
|
||||
return TALER_EC_DEPOSIT_INVALID_WIRE_FORMAT_ACCOUNT_NUMBER;
|
||||
}
|
||||
if ( (NULL != tc->bank_uri) &&
|
||||
(0 != strcmp (bank_uri,
|
||||
tc->bank_uri)) )
|
||||
if ( (NULL != tc->bank_url) &&
|
||||
(0 != strcmp (bank_url,
|
||||
tc->bank_url)) )
|
||||
{
|
||||
GNUNET_asprintf (emsg,
|
||||
"Wire specifies bank URI `%s', but this exchange only supports `%s'\n",
|
||||
bank_uri,
|
||||
tc->bank_uri);
|
||||
"Wire specifies bank URL `%s', but this exchange only supports `%s'\n",
|
||||
bank_url,
|
||||
tc->bank_url);
|
||||
return TALER_EC_DEPOSIT_INVALID_WIRE_FORMAT_BANK;
|
||||
}
|
||||
if (NULL == master_pub)
|
||||
@ -298,7 +298,7 @@ test_wire_validate (void *cls,
|
||||
return TALER_EC_DEPOSIT_INVALID_WIRE_FORMAT_SIGNATURE;
|
||||
}
|
||||
compute_purpose (account_no,
|
||||
bank_uri,
|
||||
bank_url,
|
||||
&wsd);
|
||||
if (GNUNET_OK !=
|
||||
GNUNET_STRINGS_string_to_data (sig_s,
|
||||
@ -616,7 +616,7 @@ test_sign_wire_details (void *cls,
|
||||
struct TALER_MasterSignatureP *sig)
|
||||
{
|
||||
struct TALER_MasterWireDetailsPS wsd;
|
||||
const char *bank_uri;
|
||||
const char *bank_url;
|
||||
const char *type;
|
||||
json_int_t account;
|
||||
json_error_t err;
|
||||
@ -627,7 +627,7 @@ test_sign_wire_details (void *cls,
|
||||
0 /* flags */,
|
||||
"{s:s, s:s, s:I}",
|
||||
"type", &type,
|
||||
"bank_uri", &bank_uri,
|
||||
"bank_url", &bank_url,
|
||||
"account_number", &account))
|
||||
{
|
||||
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
|
||||
@ -644,7 +644,7 @@ test_sign_wire_details (void *cls,
|
||||
return GNUNET_SYSERR;
|
||||
}
|
||||
compute_purpose (account,
|
||||
bank_uri,
|
||||
bank_url,
|
||||
&wsd);
|
||||
GNUNET_CRYPTO_eddsa_sign (&key->eddsa_priv,
|
||||
&wsd.purpose,
|
||||
@ -736,7 +736,7 @@ test_execute_wire_transfer (void *cls,
|
||||
wire_s = GNUNET_STRINGS_data_to_string_alloc (&bf.wtid,
|
||||
sizeof (bf.wtid));
|
||||
eh->aaih = TALER_BANK_admin_add_incoming (tc->ctx,
|
||||
tc->bank_uri,
|
||||
tc->bank_url,
|
||||
&tc->auth,
|
||||
exchange_base_url,
|
||||
wire_s,
|
||||
@ -972,7 +972,7 @@ test_get_history (void *cls,
|
||||
whh->hres_cb = hres_cb;
|
||||
whh->hres_cb_cls = hres_cb_cls;
|
||||
whh->hh = TALER_BANK_history (tc->ctx,
|
||||
tc->bank_uri,
|
||||
tc->bank_url,
|
||||
&tc->auth,
|
||||
(uint64_t) tc->exchange_account_no,
|
||||
direction,
|
||||
@ -1089,7 +1089,7 @@ test_reject_transfer (void *cls,
|
||||
rh->rej_cb = rej_cb;
|
||||
rh->rej_cb_cls = rej_cb_cls;
|
||||
rh->brh = TALER_BANK_reject (tc->ctx,
|
||||
tc->bank_uri,
|
||||
tc->bank_url,
|
||||
&tc->auth,
|
||||
(uint64_t) tc->exchange_account_no,
|
||||
GNUNET_ntohll (*rowid_b64),
|
||||
@ -1150,12 +1150,12 @@ libtaler_plugin_wire_test_init (void *cls)
|
||||
if (GNUNET_OK !=
|
||||
GNUNET_CONFIGURATION_get_value_string (cfg,
|
||||
"exchange-wire-test",
|
||||
"BANK_URI",
|
||||
&tc->bank_uri))
|
||||
"BANK_URL",
|
||||
&tc->bank_url))
|
||||
{
|
||||
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
|
||||
"exchange-wire-test",
|
||||
"BANK_URI");
|
||||
"BANK_URL");
|
||||
GNUNET_free (tc);
|
||||
return NULL;
|
||||
}
|
||||
@ -1168,7 +1168,7 @@ libtaler_plugin_wire_test_init (void *cls)
|
||||
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
|
||||
"exchange-wire-test",
|
||||
"EXCHANGE_ACCOUNT_NUMBER");
|
||||
GNUNET_free (tc->bank_uri);
|
||||
GNUNET_free (tc->bank_url);
|
||||
GNUNET_free (tc);
|
||||
return NULL;
|
||||
}
|
||||
@ -1181,7 +1181,7 @@ libtaler_plugin_wire_test_init (void *cls)
|
||||
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
|
||||
"taler",
|
||||
"CURRENCY");
|
||||
GNUNET_free (tc->bank_uri);
|
||||
GNUNET_free (tc->bank_url);
|
||||
GNUNET_free (tc);
|
||||
return NULL;
|
||||
}
|
||||
@ -1194,7 +1194,7 @@ libtaler_plugin_wire_test_init (void *cls)
|
||||
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
|
||||
"exchange-wire-test",
|
||||
"USERNAME");
|
||||
GNUNET_free (tc->bank_uri);
|
||||
GNUNET_free (tc->bank_url);
|
||||
GNUNET_free (tc);
|
||||
return NULL;
|
||||
}
|
||||
@ -1207,7 +1207,7 @@ libtaler_plugin_wire_test_init (void *cls)
|
||||
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
|
||||
"exchange-wire-test",
|
||||
"PASSWORD");
|
||||
GNUNET_free (tc->bank_uri);
|
||||
GNUNET_free (tc->bank_url);
|
||||
GNUNET_free (tc);
|
||||
GNUNET_free (user);
|
||||
return NULL;
|
||||
@ -1222,7 +1222,7 @@ libtaler_plugin_wire_test_init (void *cls)
|
||||
{
|
||||
GNUNET_break (0);
|
||||
GNUNET_free (tc->currency);
|
||||
GNUNET_free (tc->bank_uri);
|
||||
GNUNET_free (tc->bank_url);
|
||||
GNUNET_free (tc->auth.details.basic.username);
|
||||
GNUNET_free (tc->auth.details.basic.password);
|
||||
GNUNET_free (tc);
|
||||
@ -1287,7 +1287,7 @@ libtaler_plugin_wire_test_done (void *cls)
|
||||
break;
|
||||
}
|
||||
GNUNET_free_non_null (tc->currency);
|
||||
GNUNET_free_non_null (tc->bank_uri);
|
||||
GNUNET_free_non_null (tc->bank_url);
|
||||
GNUNET_free (tc);
|
||||
GNUNET_free (plugin);
|
||||
return NULL;
|
||||
|
@ -73,7 +73,7 @@ static struct TestBlock tests[] = {
|
||||
},
|
||||
{
|
||||
.plugin_name = "test",
|
||||
.json_proto = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost/\", \"account_number\":42 }",
|
||||
.json_proto = "{ \"type\":\"test\", \"bank_url\":\"http://localhost/\", \"account_number\":42 }",
|
||||
.round_in = "KUDOS:0.123456",
|
||||
.round_out = "KUDOS:0.12",
|
||||
.currency = "KUDOS"
|
||||
|
@ -13,9 +13,9 @@ SEPA_RESPONSE_FILE = test_wire_plugin_sepa.json
|
||||
|
||||
[exchange-wire-test]
|
||||
# For transfers made by the exchange, we need to know
|
||||
# the URI of the bank (where the /admin/add/incoming API
|
||||
# the URL of the bank (where the /admin/add/incoming API
|
||||
# is avaialble).
|
||||
BANK_URI = http://localhost/
|
||||
BANK_URL = http://localhost/
|
||||
|
||||
[taler]
|
||||
CURRENCY = "EUR"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"type": "test",
|
||||
"bank_uri": "http://localhost/",
|
||||
"bank_url": "http://localhost/",
|
||||
"sig": "KX1CMHNFH1WE10244AEF07AXHJCF9PZDZVNZBC9P4EJEQ1MH1Y3C2TWF08VTQMK4N5TCV0V1VTGWSV0WB8TB9YQRZW87F5A6KCEZ81R",
|
||||
"account_number": 42,
|
||||
"salt": "EZV905MQPVAZEMGC6SEZQF2Z75P6ZKTN8TX00JHN11S7J81DQ78G8Z551K6TGR9WHPP0JW1X9J9X9CVRY48JTHBCP6Q4XKJ6R2G18G0"
|
||||
|
@ -38,7 +38,7 @@
|
||||
* Input for the wire transfer details.
|
||||
*/
|
||||
static const char *json_proto =
|
||||
"{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8088/\", \"account_number\":42 }";
|
||||
"{ \"type\":\"test\", \"bank_url\":\"http://localhost:8088/\", \"account_number\":42 }";
|
||||
|
||||
|
||||
/**
|
||||
|
@ -7,9 +7,9 @@ TEST_RESPONSE_FILE = test_wire_plugin_test.json
|
||||
|
||||
[exchange-wire-test]
|
||||
# For transfers made by the exchange, we need to know
|
||||
# the URI of the bank (where the /admin/add/incoming API
|
||||
# the URL of the bank (where the /admin/add/incoming API
|
||||
# is avaialble).
|
||||
BANK_URI = http://localhost:8088/
|
||||
BANK_URL= http://localhost:8088/
|
||||
|
||||
[taler]
|
||||
CURRENCY = "KUDOS"
|
||||
|
@ -14,8 +14,8 @@ TEST_RESPONSE_FILE = ${TALER_CONFIG_HOME}/exchange/wire/test.json
|
||||
EXCHANGE_ACCOUNT_NUMBER = 2
|
||||
|
||||
# For accessing transfers, we need to know
|
||||
# the URI of the bank (where the /history API is available).
|
||||
# BANK_URI = https://bank.demo.taler.net/
|
||||
# the URL of the bank (where the /history API is available).
|
||||
# BANK_URL = https://bank.demo.taler.net/
|
||||
|
||||
# Authentication information for basic authentication
|
||||
USERNAME = user
|
||||
|
Loading…
Reference in New Issue
Block a user