exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit cb58740fbd9805807dba268c65498aaa171f004f
parent 6074790867eb187f4c4de96cb6266fa541dc18ae
Author: Florian Dold <florian.dold@gmail.com>
Date:   Sun, 19 Jan 2020 19:12:47 +0100

remove redundant METHOD option, we can derive it from PAYTO_URI

Diffstat:
Msrc/auditor/generate-auditor-basedb.conf | 2--
Msrc/auditor/test-auditor.conf | 1-
Msrc/benchmark/benchmark.conf | 2--
Msrc/exchange/taler-exchange-aggregator.c | 14++++++++------
Msrc/exchange/test_taler_exchange_httpd.conf | 1-
Msrc/exchangedb/exchangedb_accounts.c | 13+++++--------
Msrc/include/taler_bank_service.h | 3+--
Msrc/testing/test-taler-exchange-aggregator-postgres.conf | 1-
Msrc/testing/test-taler-exchange-wirewatch-postgres.conf | 1-
Msrc/testing/test_auditor_api.conf | 6------
Msrc/testing/test_bank_api_fakebank.conf | 1-
Msrc/testing/test_bank_api_pybank_twisted.conf | 1-
Msrc/testing/test_exchange_api.conf | 4----
Msrc/testing/test_exchange_api_keys_cherry_picking.conf | 4----
Msrc/testing/test_exchange_api_twisted.conf | 3---
15 files changed, 14 insertions(+), 43 deletions(-)

diff --git a/src/auditor/generate-auditor-basedb.conf b/src/auditor/generate-auditor-basedb.conf @@ -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 diff --git a/src/auditor/test-auditor.conf b/src/auditor/test-auditor.conf @@ -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/" diff --git a/src/benchmark/benchmark.conf b/src/benchmark/benchmark.conf @@ -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 diff --git a/src/exchange/taler-exchange-aggregator.c b/src/exchange/taler-exchange-aggregator.c @@ -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); diff --git a/src/exchange/test_taler_exchange_httpd.conf b/src/exchange/test_taler_exchange_httpd.conf @@ -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 diff --git a/src/exchangedb/exchangedb_accounts.c b/src/exchangedb/exchangedb_accounts.c @@ -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; } diff --git a/src/include/taler_bank_service.h b/src/include/taler_bank_service.h @@ -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 diff --git a/src/testing/test-taler-exchange-aggregator-postgres.conf b/src/testing/test-taler-exchange-aggregator-postgres.conf @@ -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 diff --git a/src/testing/test-taler-exchange-wirewatch-postgres.conf b/src/testing/test-taler-exchange-wirewatch-postgres.conf @@ -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 diff --git a/src/testing/test_auditor_api.conf b/src/testing/test_auditor_api.conf @@ -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 diff --git a/src/testing/test_bank_api_fakebank.conf b/src/testing/test_bank_api_fakebank.conf @@ -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 diff --git a/src/testing/test_bank_api_pybank_twisted.conf b/src/testing/test_bank_api_pybank_twisted.conf @@ -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 diff --git a/src/testing/test_exchange_api.conf b/src/testing/test_exchange_api.conf @@ -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 diff --git a/src/testing/test_exchange_api_keys_cherry_picking.conf b/src/testing/test_exchange_api_keys_cherry_picking.conf @@ -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 diff --git a/src/testing/test_exchange_api_twisted.conf b/src/testing/test_exchange_api_twisted.conf @@ -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]