[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-bank] branch master updated: parsing amount from payto line
From: |
gnunet |
Subject: |
[taler-bank] branch master updated: parsing amount from payto line |
Date: |
Thu, 15 Oct 2020 22:23:09 +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 63c7279 parsing amount from payto line
63c7279 is described below
commit 63c7279e3d39bfdef255a9e22a855389af204adc
Author: MS <ms@taler.net>
AuthorDate: Thu Oct 15 22:22:45 2020 +0200
parsing amount from payto line
---
talerbank/app/tests.py | 5 ++++-
talerbank/app/views.py | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/talerbank/app/tests.py b/talerbank/app/tests.py
index 288fc60..d42a9b5 100644
--- a/talerbank/app/tests.py
+++ b/talerbank/app/tests.py
@@ -298,9 +298,12 @@ class ReservePubExtractionTestCase(TestCase):
class PaytoParseTestCase(TestCase):
def test_payto_parse(self):
- parsed =
PaytoParse("payto://x-taler-bank/bank.int.taler.net/Exchange?subject=0T096A11M57GWGG0P6ZM9Z8G5829BFJFH2AN9R5T80FJ931DX7GG")
+ parsed =
PaytoParse("payto://x-taler-bank/bank.int.taler.net/Exchange?subject=0T096A11M57GWGG0P6ZM9Z8G5829BFJFH2AN9R5T80FJ931DX7GG&amount=EUR:1")
self.assertTrue("Exchange" == parsed.account)
self.assertTrue("0T096A11M57GWGG0P6ZM9Z8G5829BFJFH2AN9R5T80FJ931DX7GG"
== parsed.subject)
+ self.assertTrue(parsed.amount.value == 1)
+ self.assertTrue(parsed.amount.fraction == 0)
+ self.assertTrue(parsed.amount.currency == "EUR")
class PublicAccountsTestCase(TestCase):
def setUp(self):
diff --git a/talerbank/app/views.py b/talerbank/app/views.py
index f61333a..1e435ca 100644
--- a/talerbank/app/views.py
+++ b/talerbank/app/views.py
@@ -103,6 +103,7 @@ class PaytoParse:
self.account = path_as_list[-1]
params = dict(parse_qsl(parsed_payto.query))
self.subject = params.get("subject")
+ self.amount = Amount.parse(params.get("amount"))
##
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-bank] branch master updated: parsing amount from payto line,
gnunet <=