gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-bank] branch stable updated (c189692 -> 45fce74)


From: gnunet
Subject: [GNUnet-SVN] [taler-bank] branch stable updated (c189692 -> 45fce74)
Date: Wed, 08 May 2019 04:19:53 +0200

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

dold pushed a change to branch stable
in repository bank.

    from c189692  use payto URIs
     add 45fce74  rudimentary payto support

No new revisions were added by this update.

Summary of changes:
 talerbank/app/schemas.py |  2 +-
 talerbank/app/views.py   | 14 ++++++++------
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/talerbank/app/schemas.py b/talerbank/app/schemas.py
index f61e448..cf11bdc 100644
--- a/talerbank/app/schemas.py
+++ b/talerbank/app/schemas.py
@@ -221,7 +221,7 @@ PIN_TAN_ARGS = {
         "amount_currency": {"type": "string"},
         "exchange": {"type": "string"},
         "reserve_pub": {"type": "string"},
-        "exchange_wire_details": {"format": "wiredetails_string"}
+        "exchange_wire_details": {"format": "string"}
     }
 }
 
diff --git a/talerbank/app/views.py b/talerbank/app/views.py
index d3adf08..6c01c52 100644
--- a/talerbank/app/views.py
+++ b/talerbank/app/views.py
@@ -25,6 +25,7 @@ import logging
 import hashlib
 import random
 import re
+from urllib.parse import urlparse
 import django.contrib.auth
 import django.contrib.auth.views
 import django.contrib.auth.forms
@@ -307,6 +308,11 @@ def make_question():
     return question, hash_answer(answer)
 
 
+def get_acct_from_payto(s: str) -> int:
+    wire_uri = urlparse(wire_details)
+    if wire_uri.scheme != "payto":
+        raise Exception("exchange_wire_details must be a payto URI")
+    return int(wire_uri.split("/")[-1])
 
 
 ##
@@ -323,17 +329,13 @@ def pin_tan_question(request):
     validate_data(request, request.GET.dict())
     user_account = BankAccount.objects.get(user=request.user)
     wire_details = json.loads(request.GET["exchange_wire_details"])
-    request.session["exchange_account_number"] = \
-        wire_details["test"]["account_number"]
+
+    request.session["exchange_account_number"] = 
get_acct_from_payto(wire_details)
     amount = Amount(request.GET["amount_currency"],
                     int(request.GET["amount_value"]),
                     int(request.GET["amount_fraction"]))
     request.session["amount"] = amount.dump()
     request.session["reserve_pub"] = request.GET["reserve_pub"]
-    request.session["sender_wiredetails"] = {
-        "type": "test",
-        "bank_url": request.build_absolute_uri(reverse("index")),
-        "account_number": user_account.account_no}
     fail_message, success_message, hint = get_session_hint(request, 
"captcha_failed")
     question, hashed_answer = make_question()
     context = dict(

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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