diff options
author | Christian Blättler <blatc2@bfh.ch> | 2024-04-15 20:01:38 +0200 |
---|---|---|
committer | Christian Blättler <blatc2@bfh.ch> | 2024-04-15 20:01:38 +0200 |
commit | 38972c5e5941133b53695ab5ad1a6c1452c29056 (patch) | |
tree | 13c2c88df3bf6ff57c4cb60489f3ed3c750f65d2 | |
parent | b243c4d358fc415d2dd5ace9fd25750f65316d2c (diff) |
improve output of test
-rwxr-xr-x | src/testing/test_merchant_order_creation.sh | 34 |
1 files changed, 32 insertions, 2 deletions
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 # |