remove redundant METHOD option, we can derive it from PAYTO_URI

This commit is contained in:
Florian Dold 2020-01-19 19:12:47 +01:00
parent 6074790867
commit cb58740fbd
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
15 changed files with 14 additions and 43 deletions

View File

@ -80,7 +80,6 @@ CURRENCY = TESTKUDOS
[exchange-account-1]
WIRE_RESPONSE = ${TALER_DATA_HOME}/exchange/account-1.json
PAYTO_URI = payto://x-taler-bank/localhost/Exchange
METHOD = x-taler-bank
enable_debit = yes
enable_credit = yes
WIRE_GATEWAY_URL = "http://localhost:8082/taler-wire-gateway/Exchange/"
@ -91,7 +90,6 @@ PASSWORD = x
[merchant-account-merchant]
PAYTO_URI = payto://x-taler-bank/localhost/42
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/merchant/account-3.json
METHOD = x-taler-bank
HONOR_default = YES
ACTIVE_default = YES

View File

@ -5,7 +5,6 @@ TINY_AMOUNT = TESTKUDOS:0.01
[exchange-account-1]
WIRE_RESPONSE = ${TALER_DATA_HOME}/exchange/account-1.json
PAYTO_URI = payto://x-taler-bank/localhost/Exchange
METHOD = x-taler-bank
enable_debit = yes
enable_credit = yes
WIRE_GATEWAY_URL = "http://localhost:8082/taler-wire-gateway/Exchange/"

View File

@ -51,8 +51,6 @@ WIRE_GATEWAY_URL = http://localhost:8082/2/
# This is the response we give out for the /wire request. It provides
# wallets with the bank information for transfers to the exchange.
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-2.json
# Which wire method should we use to calculate fees?
METHOD = x-taler-bank
# Authentication information for basic authentication
WIRE_GATEWAY_AUTH_METHOD = "basic"
username = user

View File

@ -431,8 +431,7 @@ find_account_by_url (const char *url)
/**
* Function called with information about a wire account. Adds
* the account to our list (if it is enabled and we can load the
* plugin).
* the account to our list.
*
* @param cls closure, NULL
* @param ai account information
@ -442,6 +441,7 @@ add_account_cb (void *cls,
const struct TALER_EXCHANGEDB_AccountInfo *ai)
{
struct WireAccount *wa;
char *payto_uri;
(void) cls;
if (GNUNET_YES != ai->debit_enabled)
@ -450,22 +450,24 @@ add_account_cb (void *cls,
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (cfg,
ai->section_name,
"METHOD",
&wa->method))
"PAYTO_URI",
&payto_uri))
{
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
ai->section_name,
"METHOD");
"PAYTO_URI");
GNUNET_free (wa);
return;
}
wa->method = TALER_payto_get_method (payto_uri);
GNUNET_free (payto_uri);
if (GNUNET_OK !=
TALER_BANK_auth_parse_cfg (cfg,
ai->section_name,
&wa->auth))
{
GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
"Failed to load account `%s'\n",
"Failed to load exchange account `%s'\n",
ai->section_name);
GNUNET_free (wa->method);
GNUNET_free (wa);

View File

@ -49,7 +49,6 @@ CONFIG = "postgres:///talercheck"
[exchange-account-1]
PAYTO_URI = "payto://x-taler-bank/localhost:8082/3"
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-1.json
METHOD = "x-taler-bank"
ENABLE_DEBIT = YES
ENABLE_CREDIT = YES
TALER_BANK_AUTH_METHOD = NONE

View File

@ -78,15 +78,12 @@ check_for_account (void *cls,
"PAYTO_URI");
return;
}
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (ctx->cfg,
section,
"METHOD",
&method))
method = TALER_payto_get_method (payto_uri);
if (NULL == method)
{
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING,
section,
"METHOD");
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"payto URI in config ([%s]/PAYTO_URI) malformed\n",
section);
GNUNET_free (payto_uri);
return;
}

View File

@ -462,8 +462,7 @@ TALER_BANK_debit_history_cancel (struct TALER_BANK_DebitHistoryHandle *hh);
/**
* Convenience method for parsing configuration section with bank
* authentication data. The section must contain an option
* "METHOD", plus other options that depend on the METHOD specified.
* authentication data.
*
* @param cfg configuration to parse
* @param section the section with the configuration data

View File

@ -62,7 +62,6 @@ WIRE_GATEWAY_URL = "http://localhost:8082/2/"
WIRE_GATEWAY_AUTH_METHOD = basic
USERNAME = Exchange
PASSWORD = x
method = "x-taler-bank"
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-1.json
ENABLE_DEBIT = YES
ENABLE_CREDIT = YES

View File

@ -53,7 +53,6 @@ WIRE_GATEWAY_AUTH_METHOD = basic
USERNAME = Exchange
PASSWORD = x
METHOD = x-taler-bank
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-1.json
PLUGIN = "taler_bank"
ENABLE_DEBIT = YES

View File

@ -65,9 +65,6 @@ WIRE_GATEWAY_URL = "http://localhost:8082/42/"
# wallets with the bank information for transfers to the exchange.
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-1.json
# Which wire plugin should we used to access the account?
METHOD = x-taler-bank
[bank]
HTTP_PORT = 8082
@ -82,9 +79,6 @@ PAYTO_URI = "payto://x-taler-bank/localhost/2"
# wallets with the bank information for transfers to the exchange.
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-2.json
# Which wire plugin should we used to access the account?
METHOD = x-taler-bank
# Authentication information for basic authentication
WIRE_GATEWAY_AUTH_METHOD = "basic"
USERNAME = user

View File

@ -5,7 +5,6 @@ currency = KUDOS
[exchange-account-2]
PAYTO_URI = payto://x-taler-bank/localhost/2
METHOD = x-taler-bank
WIRE_GATEWAY_URL = "http://localhost:8081/2/"
WIRE_GATEWAY_AUTH_METHOD = basic
USERNAME = Exchange

View File

@ -35,7 +35,6 @@ PAYTO_URI = payto://x-taler-bank/localhost/1
[exchange-account-2]
PAYTO_URI = payto://x-taler-bank/localhost/Exchange
METHOD = x-taler-bank
WIRE_GATEWAY_URL = "http://localhost:8888/taler-wire-gateway/Exchange/"
WIRE_GATEWAY_AUTH_METHOD = basic
USERNAME = Exchange

View File

@ -64,8 +64,6 @@ PAYTO_URI = "payto://x-taler-bank/localhost/42"
# This is the response we give out for the /wire request. It provides
# wallets with the bank information for transfers to the exchange.
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-1.json
# Which wire plugin should we used to access the account?
METHOD = x-taler-bank
WIRE_GATEWAY_URL = "http://localhost:9081/42/"
@ -84,8 +82,6 @@ WIRE_GATEWAY_AUTH_METHOD = basic
USERNAME = Exchange
PASSWORD = x
METHOD = x-taler-bank
WIRE_GATEWAY_URL = "http://localhost:9081/2/"
ENABLE_DEBIT = YES

View File

@ -73,8 +73,6 @@ WIRE_RESPONSE = ${TALER_CONFIG_HOME}/iban.json
# What is the URL of our bank account? Must match WIRE_RESPONSE above!
PAYTO_URI = payto://x-taler-bank/localhost/42
METHOD = "x-taler-bank"
WIRE_GATEWAY_URL = "http://localhost:9082/42/"
@ -88,8 +86,6 @@ PAYTO_URI = payto://x-taler-bank/localhost/2
WIRE_GATEWAY_URL = "http://localhost:9082/2/"
METHOD = "x-taler-bank"
# Authentication information for basic authentication
TALER_BANK_AUTH_METHOD = "basic"
USERNAME = user

View File

@ -62,8 +62,6 @@ PAYTO_URI = "payto://x-taler-bank/localhost/42"
# This is the response we give out for the /wire request. It provides
# wallets with the bank information for transfers to the exchange.
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-1.json
# Which wire plugin should we used to access the account?
METHOD = x-taler-bank
WIRE_GATEWAY_URL = "http://localhost:9081/42/"
WIRE_GATEWAY_AUTH_METHOD = NONE
@ -77,7 +75,6 @@ USERNAME = user
PASSWORD = pass
ENABLE_DEBIT = YES
ENABLE_CREDIT = YES
METHOD = x-taler-bank
[bank]