gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: Testing ebics-submit.


From: gnunet
Subject: [libeufin] branch master updated: Testing ebics-submit.
Date: Wed, 01 Nov 2023 14:52:29 +0100

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

ms pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new 58d6b0aa Testing ebics-submit.
58d6b0aa is described below

commit 58d6b0aa414ca6a8a137ff6c4b301f502e8eccab
Author: MS <ms@taler.net>
AuthorDate: Wed Nov 1 14:50:37 2023 +0100

    Testing ebics-submit.
    
    Providing script that inserts mock initiated payments into
    the database, to let the ebics-submit subcommand pick them
    and send to the bank.
---
 contrib/payment_initiation_debug.sh | 51 +++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/contrib/payment_initiation_debug.sh 
b/contrib/payment_initiation_debug.sh
new file mode 100755
index 00000000..8eb64496
--- /dev/null
+++ b/contrib/payment_initiation_debug.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+# This script injects an initiated payment into its
+# table, in order to test the ebics-submit subcommand.
+
+usage() {
+  echo "Usage: ./payment_initiation.sh CONFIG_FILE IBAN_CREDITOR 
PAYMENT_SUBJECT"
+  echo
+  echo "Pays a fixed amount of 1 CHF to the IBAN_CREDITOR with the 
PAYMENT_SUBJECT."
+  echo "It requires the EBICS keying to be already carried out, see 
ebics-setup"
+  echo "subcommand at libeufin-nexus(1)"
+}
+
+# Detecting the help case.
+if test "$1" = "--help" -o "$1" = "-h" -o -z ${1:-};
+  then usage
+  exit
+fi
+
+set -eu
+
+CONFIG_FILE=$1
+IBAN_CREDITOR=$2
+PAYMENT_SUBJECT=$3
+
+# Getting the database connection.
+DB_NAME=$(taler-config -c $1 -s nexus-postgres -o config)
+echo database: $DB_NAME
+
+# Optionally reading the user-provided request UID.
+if test -n "${LIBEUFIN_SUBMIT_REQUEST_UID:-}"
+  then SUBMIT_REQUEST_UID="$LIBEUFIN_SUBMIT_REQUEST_UID"
+  else SUBMIT_REQUEST_UID=$(uuidgen)
+fi
+
+# Finally inserting the initiated payment into the database.
+INSERT_COMMAND="
+INSERT INTO libeufin_nexus.initiated_outgoing_transactions
+  (amount,
+  wire_transfer_subject,
+  initiation_time,
+  credit_payto_uri,
+  request_uid)
+  VALUES ((1,0),
+  '${PAYMENT_SUBJECT}',
+  1,
+  'payto://iban/BIC/${IBAN_CREDITOR}',
+  '${SUBMIT_REQUEST_UID}')"
+
+# Only logging errors.
+psql $DB_NAME -c "$INSERT_COMMAND" > /dev/null

-- 
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]