gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-merchant] branch master updated: issue #6915


From: gnunet
Subject: [taler-merchant] branch master updated: issue #6915
Date: Wed, 07 Jul 2021 06:45:04 +0200

This is an automated email from the git hooks/post-receive script.

sebasjm pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new 976860bf issue #6915
976860bf is described below

commit 976860bfecf27cd16a77ad508879c225989cb26e
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Wed Jul 7 01:44:53 2021 -0300

    issue #6915
---
 src/testing/test_merchant_order_creation.sh | 76 +++++++++++++++++++++++++++++
 1 file changed, 76 insertions(+)

diff --git a/src/testing/test_merchant_order_creation.sh 
b/src/testing/test_merchant_order_creation.sh
index f596666d..6e772b81 100755
--- a/src/testing/test_merchant_order_creation.sh
+++ b/src/testing/test_merchant_order_creation.sh
@@ -55,6 +55,82 @@ fi
 echo OK
 RANDOM_IMG='data:image/png;base64,abcdefg'
 
+#
+# CREATE AN ORDER WITHOUT TOKEN
+#
+
+echo -n "Creating order without TOKEN..."
+STATUS=$(curl 'http://localhost:9966/instances/default/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)
+
+if [ "$STATUS" != "200" ]
+then
+    echo 'should response ok, order created. got:' $STATUS `cat $LAST_RESPONSE`
+    exit 1
+fi
+
+ORDER_ID=`jq -r .order_id < $LAST_RESPONSE`
+TOKEN=`jq -r .token < $LAST_RESPONSE`
+
+if [ "$TOKEN" != "null" ]
+then
+    echo 'token should be null, got:' $TOKEN
+fi
+
+STATUS=$(curl http://localhost:9966/orders/$ORDER_ID \
+    -w "%{http_code}" -s -o $LAST_RESPONSE)
+
+PAY_URI=`jq -r .taler_pay_uri < $LAST_RESPONSE`
+
+if [ "$PAY_URI" == "null" ]
+then
+    echo 'should have a payuri. got:' $PAY_URI `cat $LAST_RESPONSE`
+    exit 1
+fi
+echo OK
+
+#
+# CREATE AN ORDER WITHOUT TOKEN WITH FULLFILMENT URL
+#
+
+echo -n "Creating order without TOKEN and fullfilment URL..."
+STATUS=$(curl 'http://localhost:9966/instances/default/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)
+
+if [ "$STATUS" != "200" ]
+then
+    echo 'should response ok, order created. got:' $STATUS `cat $LAST_RESPONSE`
+    exit 1
+fi
+
+ORDER_ID=`jq -r .order_id < $LAST_RESPONSE`
+TOKEN=`jq -r .token < $LAST_RESPONSE`
+
+if [ "$TOKEN" != "null" ]
+then
+    echo 'token should be null, got:' $TOKEN
+fi
+
+STATUS=$(curl http://localhost:9966/orders/$ORDER_ID \
+    -w "%{http_code}" -s -o $LAST_RESPONSE)
+
+PAY_URI=`jq -r .taler_pay_uri < $LAST_RESPONSE`
+FULLFILMENT_URL=`jq -r .fulfillment_url < $LAST_RESPONSE`
+
+if [ "$FULLFILMENT_URL" != "go_here_please" ]
+then
+    echo 'should have a payuri. got:' $PAY_URI `cat $LAST_RESPONSE`
+    exit 1
+fi
+
+if [ "$PAY_URI" == "null" ]
+then
+    echo 'should have a payuri. got:' $PAY_URI `cat $LAST_RESPONSE`
+    exit 1
+fi
+echo OK
 
 #
 # CREATE ORDER WITH NON-INVENTORY AND CHECK

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]