From 38972c5e5941133b53695ab5ad1a6c1452c29056 Mon Sep 17 00:00:00 2001 From: Christian Blättler Date: Mon, 15 Apr 2024 20:01:38 +0200 Subject: improve output of test --- src/testing/test_merchant_order_creation.sh | 34 +++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'src/testing/test_merchant_order_creation.sh') diff --git a/src/testing/test_merchant_order_creation.sh b/src/testing/test_merchant_order_creation.sh index bf1c5d02..845a356e 100755 --- a/src/testing/test_merchant_order_creation.sh +++ b/src/testing/test_merchant_order_creation.sh @@ -246,7 +246,7 @@ echo "OK" # # CREATE TOKEN FAMILY AND V1 ORDER WITH CHOICES # -echo -n "Creating token family..." +echo -n "Creating token family ..." NOW=$(date +%s) IN_A_YEAR=$((NOW + 31536000)) STATUS=$(curl 'http://localhost:9966/private/tokenfamilies' \ @@ -259,7 +259,9 @@ then exit_fail "Expected 204, token family created. got: $STATUS" fi -echo -n "Creating v1 order with token family..." +echo " OK" + +echo -n "Creating v1 order with token family ..." STATUS=$(curl 'http://localhost:9966/private/orders' \ -d '{"order":{"version":"1","amount":"TESTKUDOS:7","summary":"with_subscription","fulfillment_message":"Payed successfully","choices":[{"inputs":[{"kind":"token","count":1,"token_family_slug":"test-sub","valid_after":{"t_s":'$NOW'}}],"outputs":[{"kind":"token","count":1,"token_family_slug":"test-sub","valid_after":{"t_s":'$NOW'}}]}]}}' \ -w "%{http_code}" -s -o "$LAST_RESPONSE") @@ -270,6 +272,10 @@ then exit_fail "Expected 200, order created. got: $STATUS" fi +echo " OK" + +echo -n "Claming order with token family ..." + ORDER_ID=$(jq -r .order_id < "$LAST_RESPONSE") TOKEN=$(jq -r .token < "$LAST_RESPONSE") @@ -283,6 +289,30 @@ then exit_fail "Expected 200, order claimed. got: $STATUS" fi +echo " OK" + +# echo -n "Fetching pay URL for order ..." +# STATUS=$(curl "http://localhost:9966/private/orders/${ORDER_ID}" \ +# -w "%{http_code}" -s -o "$LAST_RESPONSE") + +# if [ "$STATUS" != "200" ] +# then +# jq . < "$LAST_RESPONSE" +# exit_fail "Expected 200, getting order info before claming it. got: $STATUS" +# fi + +# PAY_URL=$(jq -e -r .taler_pay_uri < "$LAST_RESPONSE") + +# echo " OK" + +# NOW=$(date +%s) + +# echo -n "Pay for order ${PAY_URL} ..." +# taler-wallet-cli --no-throttle --wallet-db="$WALLET_DB" handle-uri "${PAY_URL}" -y 2> wallet-pay1.err > wallet-pay1.log +# taler-wallet-cli --no-throttle --wallet-db="$WALLET_DB" run-until-done 2> wallet-finish-pay1.err > wallet-finish-pay1.log +# NOW2=$(date +%s) +# echo " OK (took $(( NOW2 - NOW )) secs )" + # # CREATE ORDER WITH NON-INVENTORY AND CHECK # -- cgit v1.2.3