merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit a6bc15b77838981d705e647adb40af0a51621286
parent 4f7b141648a68137269cfca9be13fe7d20051c29
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun, 26 Jul 2020 15:29:28 +0200

start to have templates

Diffstat:
M.gitignore | 1+
MMakefile.am | 6+++---
Mconfigure.ac | 1+
Acontrib/Makefile.am | 3+++
Acontrib/offer_refund.must | 28++++++++++++++++++++++++++++
Acontrib/request_payment.must | 69+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 105 insertions(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -68,3 +68,4 @@ src/merchant-tools/taler-merchant-generate-payments src/merchant-tools/taler-merchant-benchmark uncrustify.cfg src/merchant-tools/taler-merchant-setup-reserve +src/mustach/libmustach.a diff --git a/Makefile.am b/Makefile.am @@ -8,9 +8,9 @@ else endif else if ENABLE_DOC - SUBDIRS = . src doc + SUBDIRS = . src contrib doc else - SUBDIRS = . src doc + SUBDIRS = . src contrib endif endif @@ -23,7 +23,7 @@ EXTRA_DIST = \ COPYING.AGPL \ COPYING.LGPL \ contrib/gnunet.tag \ - contrib/microhttpd.tag + contrib/microhttpd.tag app: mkdir -p $(PACKAGE)-frontend-$(VERSION)-app diff --git a/configure.ac b/configure.ac @@ -365,6 +365,7 @@ AM_CONDITIONAL([HAVE_EXPERIMENTAL], [test "x$enable_experimental" = "xyes"]) AC_CONFIG_FILES([Makefile +contrib/Makefile doc/Makefile doc/doxygen/Makefile src/Makefile diff --git a/contrib/Makefile.am b/contrib/Makefile.am @@ -0,0 +1,3 @@ +dist_pkgdata_DATA = \ + request_payment.must \ + offer_refund.must diff --git a/contrib/offer_refund.must b/contrib/offer_refund.must @@ -0,0 +1,28 @@ +{% extends "templates/base.html" %} + +{% block main %} + +<h1>Refund</h1> + +<div class="taler-installed-hide"> + <p> + Looks like your browser doesn't support GNU Taler payments. You can try + installing a <a href="https://taler.net/en/wallet.html">wallet browser extension</a>. + </p> +</div> + +<div> + + <p> + You can use this QR code to get a refund with your mobile wallet: + </p> + + {{ qrcode_svg | safe }} + + <p> + Click <a href="{{ taler_refund_uri }}">this link</a> to open your system's Taler wallet if it exists. + </p> + +</div> + +{% endblock main %} diff --git a/contrib/request_payment.must b/contrib/request_payment.must @@ -0,0 +1,69 @@ +{% extends "templates/base.html" %} + + +{% block meta %} +<noscript> + <meta http-equiv="refresh" content="1"> +</noscript> +{% endblock meta %} + + +{% block scripts %} +<script> + let checkUrl = decodeURIComponent("{{ check_status_url_enc }}"); + let delayMs = 500; + function check() { + let req = new XMLHttpRequest(); + req.onreadystatechange = function () { + if (req.readyState === XMLHttpRequest.DONE) { + if (req.status === 200) { + try { + let resp = JSON.parse(req.responseText); + if (resp.paid) { + document.location.reload(true); + } + } catch (e) { + console.error("could not parse response:", e); + } + } + setTimeout(check, delayMs); + } + }; + req.onerror = function () { + setTimeout(check, delayMs); + } + req.open("GET", checkUrl); + req.send(); + } + + setTimeout(check, delayMs); +</script> +{% endblock scripts %} + + +{% block main %} + +<h1>Payment Required</h1> + +<div class="taler-installed-hide"> + <p> + Looks like your browser doesn't support GNU Taler payments. You can try + installing a <a href="https://taler.net/en/wallet.html">wallet browser extension</a>. + </p> +</div> + +<div> + + <p> + You can use this QR code to pay with your mobile wallet: + </p> + + {{ qrcode_svg | safe }} + + <p> + Click <a href="{{ taler_pay_uri }}">this link</a> to open your system's Taler wallet if it exists. + </p> + +</div> + +{% endblock main %}