summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMS <ms@taler.net>2020-10-15 23:27:10 +0200
committerMS <ms@taler.net>2020-10-15 23:27:10 +0200
commit9359f6281a46b86f421e4ec02ce1f90e4ac2dbd7 (patch)
tree03e36e9db53efa85197e459320fd86d3a60a9240
parentadbe7cbecc1c91398622dbf3f0c12f910f7c0d4d (diff)
downloadbank-9359f6281a46b86f421e4ec02ce1f90e4ac2dbd7.tar.gz
bank-9359f6281a46b86f421e4ec02ce1f90e4ac2dbd7.tar.bz2
bank-9359f6281a46b86f421e4ec02ce1f90e4ac2dbd7.zip
payto wire transfer
moving the form to a different page
-rw-r--r--talerbank/app/templates/payto_wiretransfer.html50
-rw-r--r--talerbank/app/templates/profile_page.html20
-rw-r--r--talerbank/app/urls.py1
-rw-r--r--talerbank/app/views.py8
4 files changed, 60 insertions, 19 deletions
diff --git a/talerbank/app/templates/payto_wiretransfer.html b/talerbank/app/templates/payto_wiretransfer.html
new file mode 100644
index 0000000..6acfee5
--- /dev/null
+++ b/talerbank/app/templates/payto_wiretransfer.html
@@ -0,0 +1,50 @@
+{% extends "base.html" %}
+{#
+ This file is part of GNU TALER.
+ Copyright (C) 2014, 2015, 2016 Taler Systems SA
+
+ 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.
+
+ 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
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+
+ @author Marcello Stanisci
+ @author Florian Dold <dold@taler.net>
+#}
+
+{% block headermsg %}
+ <div>
+ <a href="{{ url('logout') }}" class="pure-button">[Logout]</a><br>
+ </div>
+{% endblock headermsg %}
+{% block content %}
+ <section id="main">
+ <article>
+ <div>
+ <h2>Wire transfer</h2>
+ <p>Transfer money via the payto system:
+ <br>
+ <br>
+ <tt style="font-size: 15px">payto://x-taler-bank/[bank-hostname]/[account-number]?subject=[subject]&amount=[{{ currency }}:X.Y]</tt>
+ </p>
+ <form action="{{ url('payto-transfer') }}"
+ method="POST"
+ name="payto-form">
+ <input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}" />
+ <input name="address"
+ placeholder="payto address"
+ pattern="payto://x-taler-bank/[a-z\.]+(:[0-9]+)?/[0-9]+\?subject=[a-zA-Z0-9]+&amount={{ currency }}:[0-9]+(\.[0-9]+)?" />
+ <input class="pure-button pure-button-primary"
+ type="submit"
+ value="Confirm" />
+ </form>
+ </div>
+ </article>
+ </section>
+{% endblock %}
diff --git a/talerbank/app/templates/profile_page.html b/talerbank/app/templates/profile_page.html
index ed1e62f..0c5e4f8 100644
--- a/talerbank/app/templates/profile_page.html
+++ b/talerbank/app/templates/profile_page.html
@@ -71,25 +71,7 @@
</div>
</article>
<article>
- <div>
- <h2>Wire transfer</h2>
- <p>Transfer money via the payto system:
- <br>
- <br>
- <tt style="font-size: 15px">payto://x-taler-bank/[bank-hostname]/[account-number]?subject=[subject]&amount=[{{ currency }}:X.Y]</tt>
- </p>
- <form action="{{ url('payto-transfer') }}"
- method="POST"
- name="payto-form">
- <input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}" />
- <input name="address"
- placeholder="payto address"
- pattern="payto://x-taler-bank/[a-z\.]+(:[0-9]+)?/[0-9]+\?subject=[a-zA-Z0-9]+&amount={{ currency }}:[0-9]+(\.[0-9]+)?" />
- <input class="pure-button pure-button-primary"
- type="submit"
- value="Confirm" />
- </form>
- </div>
+ <a href={{ url('payto-form') }}>Wire money</a>
</article>
<article>
<h2>Transactions for {{ name }}</h2>
diff --git a/talerbank/app/urls.py b/talerbank/app/urls.py
index f3018c3..07f2464 100644
--- a/talerbank/app/urls.py
+++ b/talerbank/app/urls.py
@@ -118,6 +118,7 @@ urlpatterns = [
path("logout", views.logout_view, name="logout"),
path("register", views.register, name="register"),
path("profile", views.profile_page, name="profile"),
+ path("payto-form", views.payto_form, name="payto-form"),
path("history", views.serve_history, name="history"),
path("public-accounts",
views.serve_public_accounts, name="public-accounts"),
diff --git a/talerbank/app/views.py b/talerbank/app/views.py
index 1855609..ecb0ec7 100644
--- a/talerbank/app/views.py
+++ b/talerbank/app/views.py
@@ -297,6 +297,14 @@ class InputDatalist(forms.TextInput):
class PaytoTransferForm(forms.Form):
address = forms.CharField()
+
+@login_required
+def payto_form(request):
+ context = dict(
+ currency=request.user.bankaccount.balance.amount.currency,
+ )
+ return render(request, "payto_wiretransfer.html", context)
+
##
# This method serves the profile page, which is the main
# page where the user interacts with the bank, and also the