From ecb8c2078ebe94d81a6e03ebfe01ecdde53109e2 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 26 Mar 2024 18:53:47 -0300 Subject: install with tools --- packages/taler-harness/Makefile | 3 + .../bin/create_merchantAndBankAccount_pdf.sh | 27 +++++++++ packages/taler-harness/bin/pdf-template.html | 65 ++++++++++++++++++++++ .../create_merchantAndBankAccount_pdf.sh | 23 -------- packages/taler-harness/pdf-template.html | 65 ---------------------- 5 files changed, 95 insertions(+), 88 deletions(-) create mode 100755 packages/taler-harness/bin/create_merchantAndBankAccount_pdf.sh create mode 100644 packages/taler-harness/bin/pdf-template.html delete mode 100644 packages/taler-harness/create_merchantAndBankAccount_pdf.sh delete mode 100644 packages/taler-harness/pdf-template.html (limited to 'packages') diff --git a/packages/taler-harness/Makefile b/packages/taler-harness/Makefile index e9663aa61..9abc7b6b0 100644 --- a/packages/taler-harness/Makefile +++ b/packages/taler-harness/Makefile @@ -34,7 +34,10 @@ install-nodeps: install ./dist/taler-harness-bundled.cjs $(DESTDIR)$(NODEDIR)/dist/ install ./dist/taler-harness-bundled.cjs.map $(DESTDIR)$(NODEDIR)/dist/ install ./bin/taler-harness.mjs $(DESTDIR)$(NODEDIR)/bin/ + install ./bin/create_merchantAndBankAccount_pdf.sh $(DESTDIR)$(NODEDIR)/bin/ + install ./bin/pdf-template.html $(DESTDIR)$(NODEDIR)/bin/ ln -sf ../lib/taler-harness/node_modules/taler-harness/bin/taler-harness.mjs $(DESTDIR)$(BINDIR)/taler-harness + ln -sf $(DESTDIR)$(NODEDIR)/bin/create_merchantAndBankAccount_pdf.sh $(DESTDIR)$(BINDIR)/create_merchantAndBankAccount_pdf.sh deps: pnpm install --frozen-lockfile --filter @gnu-taler/taler-harness... install: diff --git a/packages/taler-harness/bin/create_merchantAndBankAccount_pdf.sh b/packages/taler-harness/bin/create_merchantAndBankAccount_pdf.sh new file mode 100755 index 000000000..cd87c18c9 --- /dev/null +++ b/packages/taler-harness/bin/create_merchantAndBankAccount_pdf.sh @@ -0,0 +1,27 @@ +#!/bin/bash +THIS_FILE=$(realpath "$0") +DIR=$(dirname "$THIS_FILE") + +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 $DIR/pdf-template.html -d $DATA | wkhtmltopdf - out.pdf + diff --git a/packages/taler-harness/bin/pdf-template.html b/packages/taler-harness/bin/pdf-template.html new file mode 100644 index 000000000..d308d67c4 --- /dev/null +++ b/packages/taler-harness/bin/pdf-template.html @@ -0,0 +1,65 @@ + + + +

Account information

+ +

The information in this page is confidentail, do not share with others.

+ +

Bank

+

+ In your bank account you will be able to see how much revenue + has been consolidated. +

+
+ +
+

URL: {{bankURL}}

+

accounts id: {{bankUser}}

+

password: {{password}}

+
+ +
+
+ +
bank URL
+
+
+
+ +
+ +

Backoffice

+

+ In this site you will be able to see how much are you selling, + make refunds or create new QR codes. +

+ +
+
+

URL: {{merchantURL}}

+

password: {{password}}

+
+
+
+ +
merchant URL
+
+
+
+ +
+
+ +
+

Payme QR code

+

+ The following QR code can be utilized in + public settings to request payments. +

+
+ +
{{templateURI}}
+
+ + + \ No newline at end of file diff --git a/packages/taler-harness/create_merchantAndBankAccount_pdf.sh b/packages/taler-harness/create_merchantAndBankAccount_pdf.sh deleted file mode 100644 index 4593cc9a0..000000000 --- a/packages/taler-harness/create_merchantAndBankAccount_pdf.sh +++ /dev/null @@ -1,23 +0,0 @@ -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 - diff --git a/packages/taler-harness/pdf-template.html b/packages/taler-harness/pdf-template.html deleted file mode 100644 index d308d67c4..000000000 --- a/packages/taler-harness/pdf-template.html +++ /dev/null @@ -1,65 +0,0 @@ - - - -

Account information

- -

The information in this page is confidentail, do not share with others.

- -

Bank

-

- In your bank account you will be able to see how much revenue - has been consolidated. -

-
- -
-

URL: {{bankURL}}

-

accounts id: {{bankUser}}

-

password: {{password}}

-
- -
-
- -
bank URL
-
-
-
- -
- -

Backoffice

-

- In this site you will be able to see how much are you selling, - make refunds or create new QR codes. -

- -
-
-

URL: {{merchantURL}}

-

password: {{password}}

-
-
-
- -
merchant URL
-
-
-
- -
-
- -
-

Payme QR code

-

- The following QR code can be utilized in - public settings to request payments. -

-
- -
{{templateURI}}
-
- - - \ No newline at end of file -- cgit v1.2.3