libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit e63854eb7b08631c813e2ae79bfea0239993497a
parent 536bb0c78f6a3d41eceac35faa95d8daa9403e18
Author: MS <ms@taler.net>
Date:   Mon, 16 Jan 2023 20:38:04 +0100

Importing the SMS/e-mail commands to send the TAN.

Diffstat:
Acontrib/libeufin-tan-email.sh | 3+++
Acontrib/libeufin-tan-sms.sh | 28++++++++++++++++++++++++++++
2 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/contrib/libeufin-tan-email.sh b/contrib/libeufin-tan-email.sh @@ -0,0 +1,3 @@ +#!/bin/sh +# This file is in the public domain. +exec mail -s "Libeufin" -r noreply "$1" diff --git a/contrib/libeufin-tan-sms.sh b/contrib/libeufin-tan-sms.sh @@ -0,0 +1,28 @@ +#!/bin/sh +# This file is in the public domain. +set -eu +. telesign-secrets +# Set AUTH_TOKEN=... + +MESSAGE=`cat -` +TMPFILE=`mktemp /tmp/sms-loggingXXXXXX` +STATUS=$(curl --request POST \ + --url https://rest-api.telesign.com/v1/messaging \ + --header 'authorization: Basic $AUTH_TOKEN' \ + --header 'content-type: application/x-www-form-urlencoded' \ + --data account_livecycle_event=transact \ + --data "message=$MESSAGE" \ + --data message_type=OTP \ + --data "phone_number=$1" \ + -w "%{http_code}" -s -o $TMPFILE) +echo `cat $TMPFILE` >> /var/log/sms.log +rm -f $TMPFILE +case $STATUS in + 200|203|250|290|291|295) + exit 0; + ;; + *) + exit 1; + ;; +esac +exit 1