summaryrefslogtreecommitdiff
path: root/src/testing/test_merchant_kyc.sh
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2023-09-01 14:27:48 +0200
committerChristian Grothoff <grothoff@gnunet.org>2023-09-01 14:27:48 +0200
commit35dcd4514a93ba0f5353ecd1194fc9b515f2aad4 (patch)
tree399d8f8fbebf5e8ac383fc318b7be08901279a31 /src/testing/test_merchant_kyc.sh
parent858e3047b8b595ab693e16ce0bbe0b8983b072ed (diff)
downloadmerchant-35dcd4514a93ba0f5353ecd1194fc9b515f2aad4.tar.gz
merchant-35dcd4514a93ba0f5353ecd1194fc9b515f2aad4.tar.bz2
merchant-35dcd4514a93ba0f5353ecd1194fc9b515f2aad4.zip
new CRUD APIs for OTP devices and merchant accounts (fixes #7929, #7824), one minor test is still failing...
Diffstat (limited to 'src/testing/test_merchant_kyc.sh')
-rwxr-xr-xsrc/testing/test_merchant_kyc.sh28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/testing/test_merchant_kyc.sh b/src/testing/test_merchant_kyc.sh
index 2b3bb188..663590b1 100755
--- a/src/testing/test_merchant_kyc.sh
+++ b/src/testing/test_merchant_kyc.sh
@@ -24,12 +24,12 @@ set -eu
setup -c "test_template.conf" -m -u "exchange-account-1"
LAST_RESPONSE=$(mktemp -p "${TMPDIR:-/tmp}" test_response.conf-XXXXXX)
-echo -n "Configuring a merchant instance before configuring the default instance ..."
+echo -n "Configuring a merchant default instance ..."
STATUS=$(curl -H "Content-Type: application/json" -X POST \
-H 'Authorization: Bearer secret-token:super_secret' \
http://localhost:9966/management/instances \
- -d '{"auth":{"method":"external"},"accounts":[{"payto_uri":"payto://x-taler-bank/localhost:8082/43"},{"payto_uri":"payto://x-taler-bank/localhost:8082/44"}],"id":"default","name":"default","user_type":"business","address":{},"jurisdiction":{},"use_stefan":true,"default_wire_transfer_delay":{"d_us" : 50000000},"default_pay_delay":{"d_us": 60000000}}' \
+ -d '{"auth":{"method":"external"},"id":"default","name":"default","user_type":"business","address":{},"jurisdiction":{},"use_stefan":true,"default_wire_transfer_delay":{"d_us" : 50000000},"default_pay_delay":{"d_us": 60000000}}' \
-w "%{http_code}" -s -o /dev/null)
if [ "$STATUS" != "204" ]
@@ -37,6 +37,30 @@ then
exit_fail "Expected 204 ok, instance created. got: $STATUS"
fi
+STATUS=$(curl -H "Content-Type: application/json" -X POST \
+ -H 'Authorization: Bearer secret-token:super_secret' \
+ http://localhost:9966/instances/default/private/accounts \
+ -d '{"payto_uri":"payto://x-taler-bank/localhost:8082/43"}' \
+ -w "%{http_code}" -s -o /dev/null)
+
+
+if [ "$STATUS" != "200" ]
+then
+ exit_fail "Expected 200 OK. Got: $STATUS"
+fi
+
+STATUS=$(curl -H "Content-Type: application/json" -X POST \
+ -H 'Authorization: Bearer secret-token:super_secret' \
+ http://localhost:9966/instances/default/private/accounts \
+ -d '{"payto_uri":"payto://x-taler-bank/localhost:8082/44"}' \
+ -w "%{http_code}" -s -o /dev/null)
+
+
+if [ "$STATUS" != "200" ]
+then
+ exit_fail "Expected 200 OK. Got: $STATUS"
+fi
+
echo " OK"
echo -n "Check the instance exists ..."