diff options
author | Sebastian <sebasjm@gmail.com> | 2024-03-26 16:54:35 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2024-03-26 16:57:59 -0300 |
commit | dd5aa2145f06a4744cf8f4f3fe14525b613acf87 (patch) | |
tree | 4556037bb742370774a5400c61f2b6ac1345092e /packages/taler-harness/create_merchantAndBankAccount_pdf.sh | |
parent | af633723b3beae2588c55fd94630a42f27b3f2b1 (diff) | |
download | wallet-core-dd5aa2145f06a4744cf8f4f3fe14525b613acf87.tar.gz wallet-core-dd5aa2145f06a4744cf8f4f3fe14525b613acf87.tar.bz2 wallet-core-dd5aa2145f06a4744cf8f4f3fe14525b613acf87.zip |
fix #8660
Diffstat (limited to 'packages/taler-harness/create_merchantAndBankAccount_pdf.sh')
-rw-r--r-- | packages/taler-harness/create_merchantAndBankAccount_pdf.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/packages/taler-harness/create_merchantAndBankAccount_pdf.sh b/packages/taler-harness/create_merchantAndBankAccount_pdf.sh new file mode 100644 index 000000000..4593cc9a0 --- /dev/null +++ b/packages/taler-harness/create_merchantAndBankAccount_pdf.sh @@ -0,0 +1,23 @@ +DATA=$(mktemp) +set -e + +[ -z "$1" ] && echo First parameter must be the json file result from \'taler-harness deployment provision-bank-and-merchant\'. Alternative \'-\' can be used if the file is provided from stdin. && exit 1 + +cat $1 > $DATA + +[ -z "$(jq -r '.bankUser//empty' $DATA)" ] && echo the json file is not complete: missing bankUser && exit 1 +[ -z "$(jq -r '.bankURL//empty' $DATA)" ] && echo the json file is not complete: missing bankURL && exit 1 +[ -z "$(jq -r '.merchantURL//empty' $DATA)" ] && echo the json file is not complete: missing merchantURL && exit 1 +[ -z "$(jq -r '.templateURI//empty' $DATA)" ] && echo the json file is not complete: missing templateURI && exit 1 +[ -z "$(jq -r '.password//empty' $DATA)" ] && echo the json file is not complete: missing password && exit 1 + +add_qr_image(){ + jq -r $1 $DATA | qrencode -l Q -m 2 -s 5 -o - | base64 -w 0 | jq -Rn '{"'$2'":inputs}' | jq -s add - $DATA | sponge $DATA +} + +add_qr_image .templateURI templateQR +add_qr_image .bankURL bankQR +add_qr_image .merchantURL merchantQR + +chevron pdf-template.html -d $DATA | wkhtmltopdf - out.pdf + |