summaryrefslogtreecommitdiff
path: root/src/testing/test_merchant_order_creation.sh
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2023-12-21 09:43:33 +0800
committerChristian Grothoff <grothoff@gnunet.org>2023-12-21 09:43:33 +0800
commit4f8d213a56eaff3d9841c73656faf669663564c9 (patch)
tree18c56cd332e9e391628159f9d256153a9ebf2326 /src/testing/test_merchant_order_creation.sh
parente41f0babfc13a18c0dd3889a6801a3e7944925c5 (diff)
downloadmerchant-4f8d213a56eaff3d9841c73656faf669663564c9.tar.gz
merchant-4f8d213a56eaff3d9841c73656faf669663564c9.tar.bz2
merchant-4f8d213a56eaff3d9841c73656faf669663564c9.zip
fix tests: check for libeufin-bank, not libeufin-cli
Diffstat (limited to 'src/testing/test_merchant_order_creation.sh')
-rwxr-xr-xsrc/testing/test_merchant_order_creation.sh36
1 files changed, 9 insertions, 27 deletions
diff --git a/src/testing/test_merchant_order_creation.sh b/src/testing/test_merchant_order_creation.sh
index 6c7db54b..38508cfb 100755
--- a/src/testing/test_merchant_order_creation.sh
+++ b/src/testing/test_merchant_order_creation.sh
@@ -20,15 +20,14 @@ else
ACCOUNT="exchange-account-1"
BANK_FLAGS="-ns -d iban -u $ACCOUNT"
BANK_URL="http://localhost:18082/"
+ echo -n "Testing for libeufin-bank"
+ libeufin-bank --help >/dev/null </dev/null || exit_skip " MISSING"
+ echo " FOUND"
+
fi
. setup.sh
-# If CLI is installed, assume all the suite is.
-echo -n "Testing for libeufin(-cli)"
-libeufin-cli --help >/dev/null </dev/null || exit_skip " MISSING"
-echo " FOUND"
-
echo -n "Testing for taler-harness"
taler-harness --help >/dev/null </dev/null || exit_skip " MISSING"
echo " FOUND"
@@ -431,27 +430,11 @@ echo " DONE"
echo -n "Obtaining wire transfer details from bank ($USE_FAKEBANK)..."
-if [ 1 = "$USE_FAKEBANK" ]
-then
- BANKDATA="$(curl 'http://localhost:8082/accounts/exchange/taler-wire-gateway/history/outgoing?delta=1' -s)"
- WTID=$(echo "$BANKDATA" | jq -r .outgoing_transactions[0].wtid)
- WURL=$(echo "$BANKDATA" | jq -r .outgoing_transactions[0].exchange_base_url)
- CREDIT_AMOUNT=$(echo "$BANKDATA" | jq -r .outgoing_transactions[0].amount)
- TARGET_PAYTO=$(echo "$BANKDATA" | jq -r .outgoing_transactions[0].credit_account)
-else
- # Emulating the previous pybank-based logic of getting
- # the wire transfer information _via the exchange_ bank
- # account. NOTE: grabbing tx == 0, since the latest
- # transaction appear first in the bank's history.
- BANKDATA=$(get_bankaccount_transactions exchange x | jq '.transactions[0]')
- SUBJECT=$(echo "$BANKDATA" | jq -r .subject)
- WTID=$(echo "$SUBJECT" | awk '{print $1}')
- WURL=$(echo "$SUBJECT" | awk '{print $2}')
- CREDIT_AMOUNT="$(echo "$BANKDATA" | jq -r .currency):$(echo "$BANKDATA" | jq -r .amount)"
- TARGET=$(echo "$BANKDATA" | jq -r .creditorIban)
- # 'TARGET' is now the IBAN.
- TARGET_PAYTO="payto://iban/SANDBOXX/$TARGET?receiver-name=Forty+Three"
-fi
+BANKDATA="$(curl 'http://localhost:8082/accounts/exchange/taler-wire-gateway/history/outgoing?delta=1' -s)"
+WTID=$(echo "$BANKDATA" | jq -r .outgoing_transactions[0].wtid)
+WURL=$(echo "$BANKDATA" | jq -r .outgoing_transactions[0].exchange_base_url)
+CREDIT_AMOUNT=$(echo "$BANKDATA" | jq -r .outgoing_transactions[0].amount)
+TARGET_PAYTO=$(echo "$BANKDATA" | jq -r .outgoing_transactions[0].credit_account)
if [ "$EXCHANGE_URL" != "$WURL" ]
then
@@ -612,7 +595,6 @@ then
else
ACCOUNT_PASSWORD="fortythree:x"
BANK_HOST="localhost:18082"
- # Can be replaced by the libeufin-cli way.
STATUS=$(curl "http://$ACCOUNT_PASSWORD@$BANK_HOST/accounts/fortythree" \
-w "%{http_code}" -s -o "$LAST_RESPONSE")
if [ "$STATUS" != "200" ]