[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-merchant] branch master updated: add first template for show_orde
From: |
gnunet |
Subject: |
[taler-merchant] branch master updated: add first template for show_order_details |
Date: |
Mon, 03 Aug 2020 14:12:26 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository merchant.
The following commit(s) were added to refs/heads/master by this push:
new c8347f5 add first template for show_order_details
c8347f5 is described below
commit c8347f5b77d1b4636613d05564fb70ad2878e95e
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Mon Aug 3 14:12:24 2020 +0200
add first template for show_order_details
---
contrib/offer_refund.en.must | 2 +-
contrib/show_order_details.en.must | 64 ++++++++++++++++++++++++
src/backend/taler-merchant-httpd_get-orders-ID.c | 39 +++++++++++----
3 files changed, 95 insertions(+), 10 deletions(-)
diff --git a/contrib/offer_refund.en.must b/contrib/offer_refund.en.must
index aaa4e34..49a7dce 100644
--- a/contrib/offer_refund.en.must
+++ b/contrib/offer_refund.en.must
@@ -22,7 +22,7 @@
<noscript>
<meta http-equiv="refresh" content="1">
</noscript>
- <title>Payment required for {{order_summary}}</title>
+ <title>Refund available for {{order_summary}}</title>
<!-- FIXME: inline this? How to best serve this without using 3rd party? -->
<link rel="stylesheet"
href="https://unpkg.com/purecss@2.0.3/build/pure-min.css"
diff --git a/contrib/show_order_details.en.must
b/contrib/show_order_details.en.must
new file mode 100644
index 0000000..c114ee9
--- /dev/null
+++ b/contrib/show_order_details.en.must
@@ -0,0 +1,64 @@
+<!DOCTYPE html>
+<!--
+ This file is part of GNU TALER.
+ Copyright (C) 2014-2020 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/>
+-->
+
+<html data-taler-nojs="true">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <noscript>
+ <meta http-equiv="refresh" content="1">
+ </noscript>
+ <title>Status of your order for {{order_summary}}</title>
+ <!-- FIXME: inline this? How to best serve this without using 3rd party? -->
+ <link rel="stylesheet"
+ href="https://unpkg.com/purecss@2.0.3/build/pure-min.css"
+
integrity="sha384-cg6SkqEOCV1NbJoCu11+bm0NvBRc8IYLRGXkmNrqUBfTjmMYwNKPWBTIKyw9mHNJ"
+ crossorigin="anonymous">
+ <style>
+.content {
+ overflow-x: auto;
+ padding-left: 15%;
+ padding-right: 15%;
+}
+#main a:link, #main a:visited, #main a:hover, #main a:active {
+ color: black;
+}
+ </style>
+</head>
+
+<body>
+<h1>Order details</h1>
+
+<div>
+This is the default status page for your order for <b>{{order_summary}}</b>.
+</div>
+
+
+<h2>Refund status</h2>
+<div>
+The merchant has granted you refunds on the purchase of
<b>{{refund_amount}}</b>.
+</div>
+
+<h2>Full contract details</h2>
+
+!-- FIXME #6459: expand the contract JSON in all its glory here -->
+<pre>
+ {{{contract}}}
+</pre>
+
+</body>
+</html>
diff --git a/src/backend/taler-merchant-httpd_get-orders-ID.c
b/src/backend/taler-merchant-httpd_get-orders-ID.c
index 020eea0..37dfd88 100644
--- a/src/backend/taler-merchant-httpd_get-orders-ID.c
+++ b/src/backend/taler-merchant-httpd_get-orders-ID.c
@@ -1336,6 +1336,11 @@ TMH_get_orders_ID (const struct TMH_RequestHandler *rh,
}
{
struct KVC kvc[] = {
+ { "order_summary",
+ // FIXME #6458: implement logic to extract summary based on
+ // language preferences from summary_i18n if present.
+ json_string_value (json_object_get (god->contract_terms,
+ "summary")) },
{ "refund_amount",
TALER_amount2s (&god->refund_amount) },
{ "taler_refund_uri",
@@ -1356,15 +1361,31 @@ TMH_get_orders_ID (const struct TMH_RequestHandler *rh,
}
else
{
- struct KVC kvc[] = {
- { NULL, NULL }
- };
-
- res = TMH_return_from_template (god->sc.con,
- MHD_HTTP_OK,
- "show_order_details",
- NULL,
- kvc);
+ char *j;
+
+ j = json_dumps (god->contract_terms,
+ JSON_COMPACT | JSON_SORT_KEYS); /* use most efficient
encoding */
+ {
+ struct KVC kvc[] = {
+ { "order_summary",
+ // FIXME #6458: implement logic to extract summary based on
+ // language preferences from summary_i18n if present.
+ json_string_value (json_object_get (god->contract_terms,
+ "summary")) },
+ { "refund_amount",
+ TALER_amount2s (&god->refund_amount) },
+ { "contract",
+ j },
+ { NULL, NULL }
+ };
+
+ res = TMH_return_from_template (god->sc.con,
+ MHD_HTTP_OK,
+ "show_order_details",
+ NULL,
+ kvc);
+ }
+ free (j);
}
if (GNUNET_SYSERR == res)
{
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-merchant] branch master updated: add first template for show_order_details,
gnunet <=