diff options
author | Christian Grothoff <christian@grothoff.org> | 2024-02-06 00:12:10 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2024-02-06 00:12:10 +0100 |
commit | e51192f0e708670b19acfb3fc1c969f1702a334c (patch) | |
tree | b8262bfcd609762d278bb412ce3050a89dbb78e6 /src/testing/test_merchant_order_creation.sh | |
parent | 4e0b8b34dd32e233b252a76798dca1f4823b7a4f (diff) | |
download | merchant-e51192f0e708670b19acfb3fc1c969f1702a334c.tar.gz merchant-e51192f0e708670b19acfb3fc1c969f1702a334c.tar.bz2 merchant-e51192f0e708670b19acfb3fc1c969f1702a334c.zip |
deprecate '/instances/default', for clients to just use the shorter '/' path for the default instance
Diffstat (limited to 'src/testing/test_merchant_order_creation.sh')
-rwxr-xr-x | src/testing/test_merchant_order_creation.sh | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/testing/test_merchant_order_creation.sh b/src/testing/test_merchant_order_creation.sh index 38508cfb..175667b9 100755 --- a/src/testing/test_merchant_order_creation.sh +++ b/src/testing/test_merchant_order_creation.sh @@ -115,7 +115,7 @@ fi # create with 2 bank account addresses STATUS=$(curl -H "Content-Type: application/json" -X POST \ -H 'Authorization: Bearer secret-token:super_secret' \ - http://localhost:9966/instances/default/private/accounts \ + http://localhost:9966/private/accounts \ -d '{"payto_uri":"'"$FORTYTHREE"'"}' \ -w "%{http_code}" -s -o /dev/null) @@ -125,7 +125,7 @@ then fi STATUS=$(curl -H "Content-Type: application/json" -X POST \ -H 'Authorization: Bearer secret-token:super_secret' \ - http://localhost:9966/instances/default/private/accounts \ + http://localhost:9966/private/accounts \ -d '{"payto_uri":"payto://iban/SANDBOXX/DE270744?receiver-name=Forty+Four"}' \ -w "%{http_code}" -s -o /dev/null) @@ -138,7 +138,7 @@ fi echo "Ok" echo -n "Get accounts..." -STATUS=$(curl http://localhost:9966/instances/default/private/accounts \ +STATUS=$(curl http://localhost:9966/private/accounts \ -w "%{http_code}" -s -o "$LAST_RESPONSE") PAY_URI=$(jq -r .accounts[1].payto_uri < "$LAST_RESPONSE") H_WIRE=$(jq -r .accounts[1].h_wire < "$LAST_RESPONSE") @@ -153,7 +153,7 @@ echo "OK" echo -n "Deleting one account ..." STATUS=$(curl -H "Content-Type: application/json" -X PATCH \ -H 'Authorization: Bearer secret-token:super_secret' \ - "http://localhost:9966/instances/default/private/accounts/${H_WIRE}" \ + "http://localhost:9966/private/accounts/${H_WIRE}" \ -X DELETE \ -w "%{http_code}" -s -o /dev/null) @@ -170,7 +170,7 @@ RANDOM_IMG='data:image/png;base64,abcdefg' # echo -n "Creating order without TOKEN..." -STATUS=$(curl 'http://localhost:9966/instances/default/private/orders' \ +STATUS=$(curl 'http://localhost:9966/private/orders' \ -d '{"create_token":false,"order":{"amount":"TESTKUDOS:7","summary":"3","products":[{"description":"desct","image":"'"$RANDOM_IMG"'","price":"TESTKUDOS:1","taxes":[],"unit":"u","quantity":1}]}}' \ -w "%{http_code}" -s -o "$LAST_RESPONSE") @@ -206,7 +206,7 @@ echo "OK" # echo -n "Creating order without TOKEN and fullfilment URL..." -STATUS=$(curl 'http://localhost:9966/instances/default/private/orders' \ +STATUS=$(curl 'http://localhost:9966/private/orders' \ -d '{"create_token":false,"order":{"fulfillment_url":"go_here_please", "amount":"TESTKUDOS:7","summary":"3","products":[{"description":"desct","image":"'"$RANDOM_IMG"'","price":"TESTKUDOS:1","taxes":[],"unit":"u","quantity":1}]}}' \ -w "%{http_code}" -s -o "$LAST_RESPONSE") @@ -248,7 +248,7 @@ echo "OK" # echo -n "Creating order with non-inventory products..." -STATUS=$(curl 'http://localhost:9966/instances/default/private/orders' \ +STATUS=$(curl 'http://localhost:9966/private/orders' \ -d '{"order":{"amount":"TESTKUDOS:7","summary":"3","products":[{"description":"desct","image":"'"$RANDOM_IMG"'","price":"TESTKUDOS:1","taxes":[],"unit":"u","quantity":1}]}}' \ -w "%{http_code}" -s -o "$LAST_RESPONSE") @@ -290,7 +290,7 @@ echo "OK" # echo -n "Creating product..." -STATUS=$(curl 'http://localhost:9966/instances/default/private/products' \ +STATUS=$(curl 'http://localhost:9966/private/products' \ -d '{"product_id":"2","description":"product with id 2 and price :15","price":"TESTKUDOS:15","total_stock":2,"description_i18n":{},"unit":"","image":"'$RANDOM_IMG'","taxes":[],"address":{},"next_restock":{"t_s":"never"}}' \ -w "%{http_code}" -s -o /dev/null) @@ -301,7 +301,7 @@ fi echo "OK" echo -n "Creating order with inventory products..." -STATUS=$(curl 'http://localhost:9966/instances/default/private/orders' \ +STATUS=$(curl 'http://localhost:9966/private/orders' \ -d '{"order":{"amount":"TESTKUDOS:7","summary":"3"},"inventory_products":[{"product_id":"2","quantity":1}]}' \ -w "%{http_code}" -s -o "$LAST_RESPONSE") @@ -339,7 +339,7 @@ echo "OK" # -STATUS=$(curl 'http://localhost:9966/instances/default/private/products' \ +STATUS=$(curl 'http://localhost:9966/private/products' \ -d '{"product_id":"1","description":"product with id 1 and price :15","price":"USD:15","total_stock":1,"description_i18n":{},"unit":"","image":"","taxes":[],"address":{},"next_restock":{"t_s":"never"}}' \ -w "%{http_code}" -s -o /dev/null) @@ -353,7 +353,7 @@ fi # echo -n "Creating order to be paid..." -STATUS=$(curl 'http://localhost:9966/instances/default/private/orders' \ +STATUS=$(curl 'http://localhost:9966/private/orders' \ -d '{"order":{"amount":"TESTKUDOS:1","summary":"payme"},"inventory_products":[{"product_id":"2","quantity":1}]}' \ -w "%{http_code}" -s -o "$LAST_RESPONSE") @@ -366,7 +366,7 @@ fi ORDER_ID=$(jq -e -r .order_id < "$LAST_RESPONSE") TOKEN=$(jq -e -r .token < "$LAST_RESPONSE") -STATUS=$(curl "http://localhost:9966/instances/default/private/orders/${ORDER_ID}" \ +STATUS=$(curl "http://localhost:9966/private/orders/${ORDER_ID}" \ -w "%{http_code}" -s -o "$LAST_RESPONSE") if [ "$STATUS" != "200" ] @@ -387,7 +387,7 @@ taler-wallet-cli --no-throttle --wallet-db="$WALLET_DB" run-until-done 2> wallet NOW2=$(date +%s) echo " OK (took $(( NOW2 - NOW )) secs )" -STATUS=$(curl "http://localhost:9966/instances/default/private/orders/${ORDER_ID}" \ +STATUS=$(curl "http://localhost:9966/private/orders/${ORDER_ID}" \ -w "%{http_code}" -s -o "$LAST_RESPONSE") if [ "$STATUS" != "200" ] @@ -447,7 +447,7 @@ set +e echo -n "Notifying merchant of bogus wire transfer ..." -STATUS=$(curl 'http://localhost:9966/instances/default/private/transfers' \ +STATUS=$(curl 'http://localhost:9966/private/transfers' \ -d '{"credit_amount":"'"$CREDIT_AMOUNT"'1","wtid":"'"$WTID"'","payto_uri":"'"$TARGET_PAYTO"'","exchange_url":"'"$WURL"'"}' \ -m 3 \ -w "%{http_code}" -s -o "$LAST_RESPONSE") @@ -462,7 +462,7 @@ echo "OK" echo -n "Notifying merchant of correct wire transfer (conflicting with old data)..." -STATUS=$(curl 'http://localhost:9966/instances/default/private/transfers' \ +STATUS=$(curl 'http://localhost:9966/private/transfers' \ -d '{"credit_amount":"'"$CREDIT_AMOUNT"'","wtid":"'"$WTID"'","payto_uri":"'"$TARGET_PAYTO"'","exchange_url":"'"$WURL"'"}' \ -m 3 \ -w "%{http_code}" -s -o "$LAST_RESPONSE") @@ -477,9 +477,9 @@ echo " OK" echo -n "Deleting bogus wire transfer ..." -TID=$(curl -s http://localhost:9966/instances/default/private/transfers | jq -r .transfers[0].transfer_serial_id) +TID=$(curl -s http://localhost:9966/private/transfers | jq -r .transfers[0].transfer_serial_id) STATUS=$(curl -H "Content-Type: application/json" -X DELETE \ - "http://localhost:9966/instances/default/private/transfers/$TID" \ + "http://localhost:9966/private/transfers/$TID" \ -w "%{http_code}" -s -o "$LAST_RESPONSE") if [ "$STATUS" != "204" ] @@ -489,7 +489,7 @@ then fi STATUS=$(curl -H "Content-Type: application/json" -X DELETE \ - "http://localhost:9966/instances/default/private/transfers/$TID" \ + "http://localhost:9966/private/transfers/$TID" \ -w "%{http_code}" -s -o "$LAST_RESPONSE") if [ "$STATUS" != "404" ] then @@ -501,7 +501,7 @@ echo " OK" echo -n "Notifying merchant of correct wire transfer (now working)..." -STATUS=$(curl 'http://localhost:9966/instances/default/private/transfers' \ +STATUS=$(curl 'http://localhost:9966/private/transfers' \ -d '{"credit_amount":"'"$CREDIT_AMOUNT"'","wtid":"'"$WTID"'","payto_uri":"'"$TARGET_PAYTO"'","exchange_url":"'"$WURL"'"}' \ -m 3 \ -w "%{http_code}" -s -o "$LAST_RESPONSE") @@ -520,7 +520,7 @@ set -e # Test idempotence: do it again! -STATUS=$(curl 'http://localhost:9966/instances/default/private/transfers' \ +STATUS=$(curl 'http://localhost:9966/private/transfers' \ -d '{"credit_amount":"'"$CREDIT_AMOUNT"'","wtid":"'"$WTID"'","payto_uri":"'"$TARGET_PAYTO"'","exchange_url":"'"$WURL"'"}' \ -w "%{http_code}" -s -o "$LAST_RESPONSE") @@ -539,7 +539,7 @@ echo " OK" echo -n "Fetching wire transfers ..." -STATUS=$(curl 'http://localhost:9966/instances/default/private/transfers' \ +STATUS=$(curl 'http://localhost:9966/private/transfers' \ -w "%{http_code}" -s -o "$LAST_RESPONSE") if [ "$STATUS" != "200" ] @@ -559,7 +559,7 @@ fi echo "OK" echo -n "Checking order status ..." -STATUS=$(curl "http://localhost:9966/instances/default/private/orders/${ORDER_ID}?transfer=YES" \ +STATUS=$(curl "http://localhost:9966/private/orders/${ORDER_ID}?transfer=YES" \ -w "%{http_code}" -s -o "$LAST_RESPONSE") if [ "$STATUS" != "200" ] then @@ -613,7 +613,7 @@ echo " OK" echo -n "Getting information about kyc ..." STATUS=$(curl -H "Content-Type: application/json" -X GET \ - http://localhost:9966/instances/default/private/kyc \ + http://localhost:9966/private/kyc \ -w "%{http_code}" -s -o /dev/null) if [ "$STATUS" != "204" ] then |