summaryrefslogtreecommitdiff
path: root/src/cli/test_iban.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli/test_iban.sh')
-rwxr-xr-xsrc/cli/test_iban.sh59
1 files changed, 13 insertions, 46 deletions
diff --git a/src/cli/test_iban.sh b/src/cli/test_iban.sh
index 8d090e1..f3f9f79 100755
--- a/src/cli/test_iban.sh
+++ b/src/cli/test_iban.sh
@@ -129,41 +129,6 @@ export B1FILE
export R2FILE
export R1FILE
-
-
-# Script's guidelines:
-
-#* uses 'CURRENCY=TESTKUDOS' and uses $CURRENCY for all
-# currencies in what follows ...
-#* for databases, use either 'anastasischeck' for Postgres
-# or an sqlite file created via "mktemp /tmp/test-XXXXXX"
-# or something like that
-#* exits with 77 if libeufin is not properly installed/available
-# installed/available
-#* starts Nexus (in background)
-#* starts sandbox (in background)
-#* creates two IBAN accounts
-#* stores IBANs of both accounts in shell variables,
-# call them IBAN_CREDIT and IBAN_DEBIT.
-#* configures an Anastasis facade for IBAN_CREDIT.
-#* exports authentication credentials (URL, access token)
-# for the facade to shell variables
-# (FACADE_URL, FACADE_AUTH_TOKEN)
-# ~~~~~~~~~
-#* contains a command to do a wire-transfer (pick your amount)
-# from DEBIT to CREDIT (setup authentication as needed to
-# trigger the transfer)
-#
-#
-#Make sure 'set -eu' and include some progress indicators, like:
-#
-#echo -n "Starting nexus ..."
-## DO WORK
-#echo " DONE"
-#echo -n "Starting sandbox ..."
-## DO WORK
-#echo " DONE"
-
echo -n "Testing for libeufin-cli"
libeufin-cli --version > /dev/null || exit_skip "libeufin-cli required"
echo " FOUND"
@@ -214,19 +179,20 @@ IBAN_DEBIT="FR1420041010050500013M02606"
export IBAN_CREDIT
export IBAN_DEBIT
-echo Preparing Sandbox ...
-echo -n "Making an ebics host at the sandbox "
+echo -n "Preparing Sandbox ..."
libeufin-cli \
sandbox --sandbox-url=$SANDBOX_URL \
ebicshost create \
--host-id=$EBICS_HOST
echo " OK"
+PERSON_CREDIT_NAME="Person Credit"
+
# note: Ebisc schema doesn't allow dashed names.
prepare_sandbox_account \
ebicsuserCredit \
ebicspartnerCredit \
- "Person Credit" \
+ "${PERSON_CREDIT_NAME}" \
sandbox-account-credit \
$IBAN_CREDIT
prepare_sandbox_account \
@@ -235,13 +201,12 @@ prepare_sandbox_account \
"Person Debit" \
sandbox-account-debit \
$IBAN_DEBIT
-echo Sandbox preparation done
-echo Preparing Nexus ...
+echo "Sandbox preparation done"
+echo -n "Preparing Nexus ..."
export LIBEUFIN_NEXUS_URL=$NEXUS_URL
# Make debit user, will buy Anastasis services.
DEBIT_USERNAME=anastasis-debit-user
DEBIT_PASSWORD=anastasis-debit-password
-echo -n create debit user at Nexus ...
libeufin-nexus superuser $DEBIT_USERNAME --password=$DEBIT_PASSWORD
echo " OK"
export LIBEUFIN_NEXUS_USERNAME=$DEBIT_USERNAME
@@ -257,7 +222,7 @@ prepare_nexus_account \
# Make credit user, will be Anastasis client.
CREDIT_USERNAME=anastasis-credit-user
CREDIT_PASSWORD=anastasis-credit-password
-echo -n "create credit user (for anastasis) at Nexus ..."
+echo -n "Create credit user (for anastasis) at Nexus ..."
libeufin-nexus superuser $CREDIT_USERNAME --password=$CREDIT_PASSWORD
echo " OK"
export LIBEUFIN_NEXUS_USERNAME=$CREDIT_USERNAME
@@ -270,7 +235,7 @@ prepare_nexus_account \
nexus-bankaccount-credit \
sandbox-account-credit
-echo -n create facade ...
+echo -n "Create facade ..."
libeufin-cli facades new-anastasis-facade \
--currency=$CURRENCY \
--facade-name=facade-credit \
@@ -279,7 +244,6 @@ echo " OK"
FACADE_URL=$(libeufin-cli facades list | jq .facades[0].baseUrl | tr -d \")
## Reach facade with: $FACADE_URL + $CREDIT_USERNAME + $CREDIT_PASSWORD
-echo Nexus preparation done.
echo -n "Initialize Anastasis database ..."
# Name of the Postgres database we will use for the script.
@@ -301,6 +265,10 @@ anastasis-config -c $CONF \
-V "${IBAN_CREDIT}"
anastasis-config -c $CONF \
-s authorization-iban \
+ -o BUSINESS_NAME \
+ -V "${PERSON_CREDIT_NAME}"
+anastasis-config -c $CONF \
+ -s authorization-iban \
-o WIRE_GATEWAY_URL \
-V "${FACADE_URL}"
anastasis-config -c $CONF \
@@ -313,7 +281,7 @@ anastasis-config -c $CONF \
-V "${LIBEUFIN_NEXUS_USERNAME}"
anastasis-config -c $CONF \
-s authorization-iban \
- -o WIRE_GATEWAY_AUTH_METHOD \
+ -o PASSWORD \
-V "${LIBEUFIN_NEXUS_PASSWORD}"
echo " OK"
@@ -461,7 +429,6 @@ wire_transfer_to_anastasis "${AMOUNT}" "${SUBJECT}"
echo " OK"
-bash
echo -n "Triggering inbound check ..."
anastasis-helper-authorization-iban -c $CONF -t
echo " OK"