summaryrefslogtreecommitdiff
path: root/talerbank/app/templates
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-08-27 03:56:54 +0200
committerFlorian Dold <florian.dold@gmail.com>2019-08-28 21:28:59 +0200
commit97835ef689b538cb3e4bee294bd0fb2b3f0a9df2 (patch)
treef0ef076bfcc45285a818c75faf07a2351d20cb6e /talerbank/app/templates
parent11a193449e291c240f3cac96fe21e6c21a2a2649 (diff)
downloadbank-97835ef689b538cb3e4bee294bd0fb2b3f0a9df2.tar.gz
bank-97835ef689b538cb3e4bee294bd0fb2b3f0a9df2.tar.bz2
bank-97835ef689b538cb3e4bee294bd0fb2b3f0a9df2.zip
implement new withdraw API and support taler://withdraw
Diffstat (limited to 'talerbank/app/templates')
-rw-r--r--talerbank/app/templates/profile_page.html18
-rw-r--r--talerbank/app/templates/withdraw_confirm.html (renamed from talerbank/app/templates/pin_tan.html)7
-rw-r--r--talerbank/app/templates/withdraw_show.html76
3 files changed, 82 insertions, 19 deletions
diff --git a/talerbank/app/templates/profile_page.html b/talerbank/app/templates/profile_page.html
index abbb784..61fcd61 100644
--- a/talerbank/app/templates/profile_page.html
+++ b/talerbank/app/templates/profile_page.html
@@ -17,18 +17,6 @@
@author Marcello Stanisci
#}
-{% block head %}
- <meta name="currency" value="{{ currency }}">
- <meta name="precision" value="{{ precision }}">
- <meta name="callback-url" value="{{ url('pin-question') }}">
- {% if withdraw and withdraw == "success" %}
- <meta name="reserve-pub" value="{{ reserve_pub }}">
- {% endif %}
- {% if suggested_exchange %}
- <meta name="suggested-exchange" value="{{ suggested_exchange }}">
- {% endif %}
- <link rel="stylesheet" type="text/css" href="{{ static('disabled-button.css') }}">
-{% endblock head %}
{% block headermsg %}
<div>
<h1 class="nav">Welcome <em>{{ name }}</em>!</h1>
@@ -64,11 +52,11 @@
</article>
<article>
<div>
- <h2>Withdraw digital coins using Taler</h2>
+ <h2>Withdraw Money into a Taler wallet</h2>
<form id="reserve-form"
class="pure-form"
- action="{{ url('withdraw-nojs') }}"
+ action="{{ url('start-withdrawal') }}"
method="post"
name="tform">
<input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}" />
@@ -84,7 +72,7 @@
<input id="select-exchange"
class="pure-button pure-button-primary"
type="submit"
- value="Select exchange provider" />
+ value="Start withdrawal" />
</form>
<h2>Wire transfer</h2>
<form id="wt-form"
diff --git a/talerbank/app/templates/pin_tan.html b/talerbank/app/templates/withdraw_confirm.html
index 746f889..594d5a5 100644
--- a/talerbank/app/templates/pin_tan.html
+++ b/talerbank/app/templates/withdraw_confirm.html
@@ -20,7 +20,7 @@
{% extends "base.html" %}
{% block headermsg %}
- <h1 class="nav">PIN/TAN: Confirm transaction</h1>
+ <h1 class="nav">Confirm Withdrawal</h1>
{% endblock %}
{% block content %}
@@ -31,15 +31,14 @@
{% endif %}
<p>
{{ settings_value("TALER_CURRENCY") }} Bank needs to verify that you
- intend to withdraw <b>{{ amount }}</b> from
- <b>{{ exchange }}</b>.
+ intend to withdraw <b>{{ amount }}</b> from <b>{{ exchange }}</b>.
To prove that you are the account owner, please answer the
following &quot;security question&quot; (*):
</p>
<p>
What is {{ question }} ?
</p>
- <form method="post" action="{{ url('pin-verify') }}" class="pure-form">
+ <form method="post" action="{{ url('withdraw-confirm', withdraw_id) }}" class="pure-form">
<input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}" />
<input type="text" name="pin_0" value="" autocomplete="off" autofocus />
<input type="hidden" name="pin_1" value="{{ hashed_answer }}" />
diff --git a/talerbank/app/templates/withdraw_show.html b/talerbank/app/templates/withdraw_show.html
new file mode 100644
index 0000000..3c66732
--- /dev/null
+++ b/talerbank/app/templates/withdraw_show.html
@@ -0,0 +1,76 @@
+<!--
+ This file is part of GNU Taler.
+ Copyright (C) 2019 GNUnet e.V.
+
+ GNU Taler is free software; you can redistribute it and/or modify it under the
+ terms of the GNU Lesser General Public License as published by the Free Software
+ Foundation; either version 2.1, or (at your option) any later version.
+
+ GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License along with
+ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+
+ @author Florian Dold
+-->
+
+{% extends "base.html" %}
+
+{% block headermsg %}
+<h1 class="nav">Withdraw to a Taler Wallet</h1>
+{% endblock %}
+
+{% block head %}
+<script>
+ // prettier-ignore
+ let checkUrl = JSON.parse('{{ withdraw_check_url | tojson }}');
+ 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.selection_done) {
+ 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 head %}
+
+{% block content %}
+<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>
+
+<p>
+ You can use this QR code to withdraw to your mobile wallet:
+</p>
+{{ qrcode_svg | safe }}
+<p>
+ Click <a href="{{ taler_withdraw_uri }}">this link</a> to open your system's Taler wallet if it exists.
+</p>
+
+
+{% endblock content %} \ No newline at end of file