diff options
author | Torsten Grote <t@grobox.de> | 2020-05-08 10:13:52 -0300 |
---|---|---|
committer | Torsten Grote <t@grobox.de> | 2020-05-08 10:13:52 -0300 |
commit | 122574fe05a7f568d4fa968ff4fcde0c403c8a4d (patch) | |
tree | 0e3f98ed83a0a35da03b5b5233287b626285d9c8 /integrationtests/test-refund.sh | |
parent | 06aa5abcc7b96236b42fdf33af347f09632b6560 (diff) | |
download | wallet-core-122574fe05a7f568d4fa968ff4fcde0c403c8a4d.tar.xz |
Add test for refund and tip, fix cli testing gen-*-uri
Diffstat (limited to 'integrationtests/test-refund.sh')
-rwxr-xr-x | integrationtests/test-refund.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/integrationtests/test-refund.sh b/integrationtests/test-refund.sh new file mode 100755 index 000000000..40dc65f57 --- /dev/null +++ b/integrationtests/test-refund.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Script to check that the wallet can handle refund URIs and actually process the refund + +source "common.sh" +normal_start_and_wait "refund" + +echo "Withdraw TESTKUDOS" +taler-wallet-cli --wallet-db="$WALLET_DB" --no-throttle testing withdraw -e "$EXCHANGE_URL" -b "$BANK_URL" -a "TESTKUDOS:10" >>"$LOG" 2>>"$LOG" +echo -n "Balance after withdrawal: " +taler-wallet-cli --wallet-db="$WALLET_DB" balance 2>>"$LOG" +REFUND_URI=$(taler-wallet-cli --wallet-db="$WALLET_DB" --no-throttle testing gen-refund-uri \ + -m "$MERCHANT_URL" -k sandbox \ + -s "first refund" -a "TESTKUDOS:8" -r "TESTKUDOS:2" 2>>"$LOG" | grep -E -m 1 -o "taler://refund.*insecure=1") +echo -n "Balance after payment: " +taler-wallet-cli --wallet-db="$WALLET_DB" balance 2>>"$LOG" +echo "Handling refund: $REFUND_URI" +taler-wallet-cli --wallet-db="$WALLET_DB" --no-throttle handle-uri "$REFUND_URI" 2>"$LOG" +taler-wallet-cli --wallet-db="$WALLET_DB" run-until-done 2>>"$LOG" >>"$LOG" +echo -n "Balance after first refund: " +taler-wallet-cli --wallet-db="$WALLET_DB" balance 2>>"$LOG" +# TODO how to test second refund for same purchase? + +echo "SUCCESS" +exit 0 |