summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-07-26 15:29:28 +0200
committerChristian Grothoff <christian@grothoff.org>2020-07-26 15:29:28 +0200
commita6bc15b77838981d705e647adb40af0a51621286 (patch)
tree914a0380a6f1e2c3487b93e49865d72438c15b0b /contrib
parent4f7b141648a68137269cfca9be13fe7d20051c29 (diff)
downloadmerchant-a6bc15b77838981d705e647adb40af0a51621286.tar.gz
merchant-a6bc15b77838981d705e647adb40af0a51621286.tar.bz2
merchant-a6bc15b77838981d705e647adb40af0a51621286.zip
start to have templates
Diffstat (limited to 'contrib')
-rw-r--r--contrib/Makefile.am3
-rw-r--r--contrib/offer_refund.must28
-rw-r--r--contrib/request_payment.must69
3 files changed, 100 insertions, 0 deletions
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
new file mode 100644
index 00000000..589b36f3
--- /dev/null
+++ 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
new file mode 100644
index 00000000..913b6a5f
--- /dev/null
+++ 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
new file mode 100644
index 00000000..6e050d0f
--- /dev/null
+++ 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 %}