commit 38972c5e5941133b53695ab5ad1a6c1452c29056
parent b243c4d358fc415d2dd5ace9fd25750f65316d2c
Author: Christian Blättler <blatc2@bfh.ch>
Date: Mon, 15 Apr 2024 20:01:38 +0200
improve output of test
Diffstat:
1 file changed, 32 insertions(+), 2 deletions(-)
diff --git 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
#