merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit 332630ca9d99edf69b0525dfe1e62137df346a11
parent 0bcf8ea877423dd9401f74d9fdb4df790267548f
Author: Sebastian <sebasjm@gmail.com>
Date:   Tue, 11 May 2021 11:01:37 -0300

add test about transaction inserting

Diffstat:
Msrc/testing/test_merchant_order_creation.sh | 45+++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+), 0 deletions(-)

diff --git a/src/testing/test_merchant_order_creation.sh b/src/testing/test_merchant_order_creation.sh @@ -269,6 +269,51 @@ then exit_fail "Expected response ok, after providing transfer data. got: $STATUS" fi + +STATUS=$(curl 'http://localhost:9966/instances/default/private/transfers' \ + -d '{"credit_amount":"'$CREDIT_AMOUNT'","wtid":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","payto_uri":"'$TARGET_PAYTO'","exchange_url":"'$WURL'"}' \ + -w "%{http_code}" -s -o $LAST_RESPONSE) + +jq . < $LAST_RESPONSE + +if [ "$STATUS" != "502" ] +then + echo `cat $LAST_RESPONSE` + exit_fail "Expected response invalid since the WTID is fake. got: $STATUS" +fi + +STATUS=$(curl 'http://localhost:9966/instances/default/private/transfers' \ + -w "%{http_code}" -s -o $LAST_RESPONSE) + +jq . < $LAST_RESPONSE + +if [ "$STATUS" != "200" ] +then + echo `cat $LAST_RESPONSE` + exit_fail "Expected response ok. got: $STATUS" +fi + +TRANSFERS_LIST_SIZE=`jq -r '.transfers | length' < $LAST_RESPONSE` + +if [ "$TRANSFERS_LIST_SIZE" != "2" ] +then + echo `cat $LAST_RESPONSE` + exit_fail "Expected response ok. got: $STATUS" +fi + +#this will triger the GNUNET_break at taler-merchant-httpd_private-post-transfers.c:1030 +STATUS=$(curl 'http://localhost:9966/instances/default/private/transfers' \ + -d '{"credit_amount":"'$CREDIT_AMOUNT'","wtid":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","payto_uri":"'$TARGET_PAYTO'","exchange_url":"'$WURL'"}' \ + -w "%{http_code}" -s -o $LAST_RESPONSE) + +jq . < $LAST_RESPONSE + +if [ "$STATUS" != "502" ] +then + echo `cat $LAST_RESPONSE` + exit_fail "Expected response invalid since the WTID is fake. got: $STATUS" +fi + echo " OK" echo -n "Checking order status ..."