gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-bank] branch master updated: payto wire transfer


From: gnunet
Subject: [taler-bank] branch master updated: payto wire transfer
Date: Thu, 15 Oct 2020 23:27:32 +0200

This is an automated email from the git hooks/post-receive script.

ms pushed a commit to branch master
in repository bank.

The following commit(s) were added to refs/heads/master by this push:
     new 9359f62  payto wire transfer
9359f62 is described below

commit 9359f6281a46b86f421e4ec02ce1f90e4ac2dbd7
Author: MS <ms@taler.net>
AuthorDate: Thu Oct 15 23:27:10 2020 +0200

    payto wire transfer
    
    moving the form to a different page
---
 talerbank/app/templates/payto_wiretransfer.html | 50 +++++++++++++++++++++++++
 talerbank/app/templates/profile_page.html       | 20 +---------
 talerbank/app/urls.py                           |  1 +
 talerbank/app/views.py                          |  8 ++++
 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

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]