exchange

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

commit b8a07ff3a314ae0e72441563f6580e07b3c83773
parent 2d4d0e7ef13016fd876c288096d4d62575403f76
Author: Christian Grothoff <christian@grothoff.org>
Date:   Wed, 10 Jan 2024 13:33:12 +0100

add support for taler-merchant-exchange to taler-unified-setup.sh

Diffstat:
Msrc/exchangedb/exchange_do_deposit.sql | 1-
Msrc/exchangedb/exchange_do_reserves_in_insert.sql | 1-
Msrc/kyclogic/plugin_kyclogic_oauth2.c | 17++++++++++++++++-
Msrc/testing/taler-unified-setup.sh | 25++++++++++++++++++-------
4 files changed, 34 insertions(+), 10 deletions(-)

diff --git a/src/exchangedb/exchange_do_deposit.sql b/src/exchangedb/exchange_do_deposit.sql @@ -42,7 +42,6 @@ AS $$ DECLARE wtsi INT8; -- wire target serial id bdsi INT8; -- batch_deposits serial id - curs REFCURSOR; i INT4; ini_amount_with_fee taler_amount; ini_coin_pub BYTEA; diff --git a/src/exchangedb/exchange_do_reserves_in_insert.sql b/src/exchangedb/exchange_do_reserves_in_insert.sql @@ -30,7 +30,6 @@ RETURNS SETOF exchange_do_array_reserve_insert_return_type LANGUAGE plpgsql AS $$ DECLARE - curs REFCURSOR; conflict BOOL; dup BOOL; uuid INT8; diff --git a/src/kyclogic/plugin_kyclogic_oauth2.c b/src/kyclogic/plugin_kyclogic_oauth2.c @@ -1060,6 +1060,15 @@ handle_curl_proof_finished (void *cls, ph->job = NULL; switch (response_code) { + case 0: + ph->status = TALER_KYCLOGIC_STATUS_PROVIDER_FAILED; + ph->response + = TALER_MHD_make_error ( + TALER_EC_EXCHANGE_KYC_PROOF_BACKEND_INVALID_RESPONSE, + "No response from KYC gateway"); + ph->http_status + = MHD_HTTP_BAD_GATEWAY; + break; case MHD_HTTP_OK: parse_proof_success_reply (ph, j); @@ -1304,13 +1313,19 @@ oauth2_proof (void *cls, ph); return ph; } - + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Requesting OAuth 2.0 data via HTTP POST `%s'\n", + pd->token_url); GNUNET_assert (CURLE_OK == curl_easy_setopt (ph->eh, CURLOPT_URL, pd->token_url)); GNUNET_assert (CURLE_OK == curl_easy_setopt (ph->eh, + CURLOPT_VERBOSE, + 1)); + GNUNET_assert (CURLE_OK == + curl_easy_setopt (ph->eh, CURLOPT_POST, 1)); { diff --git a/src/testing/taler-unified-setup.sh b/src/testing/taler-unified-setup.sh @@ -76,6 +76,7 @@ START_BANK=0 START_TRANSFER=0 START_WIREWATCH=0 START_DEPOSITCHECK=0 +START_MERCHANT_EXCHANGE=0 USE_ACCOUNT="exchange-account-1" USE_VALGRIND="" WIRE_DOMAIN="x-taler-bank" @@ -84,7 +85,7 @@ LOGLEVEL="DEBUG" DEFAULT_SLEEP="0.2" # Parse command-line options -while getopts ':abc:d:efghkL:mMnr:stu:vwWD' OPTION; do +while getopts ':abc:d:DeEfghkL:mMnr:stu:vwW' OPTION; do case "$OPTION" in a) START_AUDITOR="1" @@ -98,12 +99,15 @@ while getopts ':abc:d:efghkL:mMnr:stu:vwWD' OPTION; do d) WIRE_DOMAIN="$OPTARG" ;; - D) + D) START_DONAU="1" ;; e) START_EXCHANGE="1" ;; + E) + START_MERCHANT_EXCHANGE="1" + ;; f) START_FAKEBANK="1" ;; @@ -117,22 +121,23 @@ while getopts ':abc:d:efghkL:mMnr:stu:vwWD' OPTION; do echo ' -d $METHOD -- use wire method (default: x-taler-bank)' echo ' -D -- start donau' echo ' -e -- start exchange' + echo ' -E -- start taler-merchant-exchange' echo ' -f -- start fakebank' - echo ' -g -- start aggregator' + echo ' -g -- start taler-exchange-aggregator' echo ' -h -- print this help' # shellcheck disable=SC2016 echo ' -L $LOGLEVEL -- set log level' - echo ' -m -- start merchant' - echo ' -M -- start merchant-depositcheck' + echo ' -m -- start taler-merchant' + echo ' -M -- start taler-merchant-depositcheck' echo ' -n -- start nexus' # shellcheck disable=SC2016 echo ' -r $MEX -- which exchange to use at the merchant (optional)' echo ' -s -- start backup/sync' - echo ' -t -- start transfer' + echo ' -t -- start taler-exchange-transfer' # shellcheck disable=SC2016 echo ' -u $SECTION -- exchange account to use' echo ' -v -- use valgrind' - echo ' -w -- start wirewatch' + echo ' -w -- start taler-exchange-wirewatch' echo ' -W -- wait for signal' exit 0 ;; @@ -563,6 +568,12 @@ then $USE_VALGRIND taler-merchant-webhook \ -c "$CONF" \ -L "$LOGLEVEL" 2> taler-merchant-webhook.log & + if [ "1" = "$START_MERCHANT_EXCHANGE" ] + then + $USE_VALGRIND taler-merchant-exchange \ + -c "$CONF" \ + -L "$LOGLEVEL" 2> taler-merchant-exchange.log & + fi if [ "1" = "$START_DEPOSITCHECK" ] then $USE_VALGRIND taler-merchant-depositcheck \