summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpriscilla <priscilla.huang@efrei.net>2022-12-06 09:30:56 -0500
committerpriscilla <priscilla.huang@efrei.net>2022-12-06 09:30:56 -0500
commit06ba46d76b5f70b0c06a390ef1bb2f9b2a60200d (patch)
tree9e3c23f76f5d69ca32a1f4fb23fbc36a699faef0
parente90fc21a82c6d58a3fc8154b4a708cb323245ef0 (diff)
downloadmerchant-06ba46d76b5f70b0c06a390ef1bb2f9b2a60200d.tar.gz
merchant-06ba46d76b5f70b0c06a390ef1bb2f9b2a60200d.tar.bz2
merchant-06ba46d76b5f70b0c06a390ef1bb2f9b2a60200d.zip
update
-rw-r--r--src/testing/test_merchant_template_creation.sh112
1 files changed, 0 insertions, 112 deletions
diff --git a/src/testing/test_merchant_template_creation.sh b/src/testing/test_merchant_template_creation.sh
index 2fb6ab26..e69de29b 100644
--- a/src/testing/test_merchant_template_creation.sh
+++ b/src/testing/test_merchant_template_creation.sh
@@ -1,112 +0,0 @@
-#!/bin/bash
-# This file is part of TALER
-# Copyright (C) 2014-2021 Taler Systems SA
-#
-# TALER is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 3, or
-# (at your option) any later version.
-#
-# TALER is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public
-# License along with TALER; see the file COPYING. If not, see
-# <http://www.gnu.org/licenses/>
-#
-
-. initialize_taler_system.sh
-
-echo -n "Configuring merchant instance ..."
-FORTYTHREE=`get_payto_uri fortythree x`
-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"},"payto_uris":["'$FORTYTHREE'"],"id":"default","name":"default","address":{},"jurisdiction":{},"default_max_wire_fee":"TESTKUDOS
-:1", "default_max_deposit_fee":"TESTKUDOS:1","default_wire_fee_amortization":1,"default_wire_transfer_delay":{"d_us" : 50000000},"default_pay_delay":{"d_us": 60000000}}' \
- -w "%{http_code}" -s -o /dev/null)
-
-if [ "$STATUS" != "204" ]
-then
- echo 'should respond ok, instance created. got:' $STATUS
- exit 1
-fi
-echo OK
-RANDOM_IMG='data:image/png;base64,abcdefg'
-
-INFINITE_TEMPLATE='{"template_id":"2","description":"template with id 2","image":"'$RANDOM_IMG'"}'
-MANAGED_TEMPLATE='{"template_id":"3","description":"template with id 3","image":"'$RANDOM_IMG'"}'
-
-echo -n "Creating templates..."
-STATUS=$(curl 'http://localhost:9966/instances/default/private/templates' \
- -d "$INFINITE_TEMPLATE" \
- -w "%{http_code}" -s -o /dev/null)
-
-if [ "$STATUS" != "204" ]
-then
- echo 'should respond ok, template created. got:' $STATUS
- exit 1
-fi
-
-STATUS=$(curl 'http://localhost:9966/instances/default/private/templates' \
- -d "$MANAGED_TEMPLATE" \
- -w "%{http_code}" -s -o /dev/null)
-
-if [ "$STATUS" != "204" ]
-then
- echo 'should respond ok, template created. got:' $STATUS
- exit 1
-fi
-echo OK
-
-
-TEMPLATE_DATA=$(echo $INFINITE_TEMPLATE | jq 'del(.template_id) | . + {description: "other description"}')
-
-echo -n "Updating infinite stock template..."
-STATUS=$(curl 'http://localhost:9966/instances/default/private/templates/2' -X PATCH \
- -d "$TEMPLATE_DATA" \
- -w "%{http_code}" -s -o $LAST_RESPONSE)
-
-if [ "$STATUS" != "204" ]
-then
- echo 'should respond ok, updating template. got:' $STATUS
- cat $LAST_RESPONSE
- exit 1
-fi
-
-STATUS=$(curl 'http://localhost:9966/instances/default/private/templates/2' \
- -w "%{http_code}" -s -o $LAST_RESPONSE)
-
-DESCRIPTION=`jq -r .description < $LAST_RESPONSE`
-
-if [ "$DESCRIPTION" != "other description" ]
-then
- echo 'should change description. got:' $DESCRIPTION
- cat $LAST_RESPONSE
- exit 1
-fi
-echo OK
-
-echo " OK"
-
-
-echo -n "Updating template..."
-
-TEMPLATE_DATA=$(echo $MANAGED_TEMPLATE | jq 'del(.template_id)')
-
-STATUS=$(curl 'http://localhost:9966/instances/default/private/templates/3' -X PATCH \
- -d "$TEMPLATE_DATA" \
- -w "%{http_code}" -s -o $LAST_RESPONSE)
-
-if [ "$STATUS" != "204" ]
-then
- echo 'should respond ok, updating template. got:' $STATUS
- cat $LAST_RESPONSE
- exit 1
-fi
-
-echo " OK"
-
-exit 0