gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-backoffice] branch master updated: Query the backend


From: gnunet
Subject: [GNUnet-SVN] [taler-backoffice] branch master updated: Query the backend respecting the new authorization scheme.
Date: Mon, 04 Jun 2018 15:22:09 +0200

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

marcello pushed a commit to branch master
in repository backoffice.

The following commit(s) were added to refs/heads/master by this push:
     new cd56aaf  Query the backend respecting the new authorization scheme.
cd56aaf is described below

commit cd56aaf0f90c5ef15077c87309f050e156b49b3b
Author: Marcello Stanisci <address@hidden>
AuthorDate: Mon Jun 4 15:21:41 2018 +0200

    Query the backend respecting the new authorization scheme.
---
 js/backoffice.js                         | 10 +++-------
 talerbackoffice/backoffice/backoffice.py | 15 ++++++++++++---
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/js/backoffice.js b/js/backoffice.js
index 4af24dd..eeac8f3 100644
--- a/js/backoffice.js
+++ b/js/backoffice.js
@@ -162,9 +162,8 @@ var track_transfer = function(exchange, wtid, cb){
 /* Fill the information bar on the top of the page with
  * error messages.  */
 var show_error = function(response_text){
+  var msg = response_text;
 
-  console.log("Filling info bar");
-  var msg;
   try{
     var parse = JSON.parse(response_text);
     console.log("Response was at least JSON");
@@ -178,7 +177,6 @@ var show_error = function(response_text){
 
   } catch (e) {
     console.log("Must keep raw HTML-ish response");
-    msg = response_text;
   }
   
   /* msg is ready here.  */
@@ -200,14 +198,13 @@ var track_order = function(order_id, cb){
   var req = new XMLHttpRequest();
   var url = `/track/order?` +
             `order_id=${order_id}&` +
-            `instance=${get_instance()}`
+            `instance=${get_instance()}`;
   req.open("GET", url, true);
   req.onload = function(){
     if (4 == req.readyState){
       if ((200 == req.status) || (202 == req.status))
         cb(JSON.parse(req.responseText), req.status);
       else
-        console.log("Calling info bar filler");
         show_error(req.responseText);
       return;
     }
@@ -365,8 +362,7 @@ function fill_table(refresh, data, execution_time, 
wtid_marker){
       ${entry.order_id}</a>`;
     td_summary.className = "summary";
     td_summary.innerHTML = entry.summary;
-    td_amount.innerHTML = amount_to_string
-      (entry.amount || entry.deposit_value);
+    td_amount.innerHTML = entry.amount;
     td_date.innerHTML = parse_date
       (entry.timestamp || execution_time);
     row.appendChild(td_order_id);
diff --git a/talerbackoffice/backoffice/backoffice.py 
b/talerbackoffice/backoffice/backoffice.py
index 646dc64..2ce66e6 100644
--- a/talerbackoffice/backoffice/backoffice.py
+++ b/talerbackoffice/backoffice/backoffice.py
@@ -68,7 +68,10 @@ def javascript_licensing():
 def history():
     qs = get_query_string().decode("utf-8")
     url = urljoin(BACKEND_URL, "history")
-    resp = requests.get(url, params=dict(parse_qsl(qs)))
+    resp = requests.get(url,
+                        params=dict(parse_qsl(qs)),
+                        headers={"Authorization":
+                                 "ApiKey sandbox"})
     if resp.status_code != 200:
         return backend_error(resp)
     return flask.jsonify(resp.json()), resp.status_code
@@ -78,7 +81,10 @@ def history():
 def track_transfer():
     qs = get_query_string().decode("utf-8")
     url = urljoin(BACKEND_URL, "track/transfer")
-    resp = requests.get(url, params=dict(parse_qsl(qs)))
+    resp = requests.get (url,
+                         params=dict(parse_qsl(qs)),
+                         headers={"Authorization":
+                                  "ApiKey sandbox"})
     if resp.status_code != 200:
         return backend_error(resp)
     return flask.jsonify(resp.json()), resp.status_code
@@ -88,7 +94,10 @@ def track_transfer():
 def track_order():
     qs = get_query_string().decode("utf-8")
     url = urljoin(BACKEND_URL, "track/transaction")
-    resp = requests.get(url, params=dict(parse_qsl(qs)))
+    resp = requests.get(url,
+                        params=dict(parse_qsl(qs)),
+                        headers={"Authorization":
+                                 "ApiKey sandbox"})
     if resp.status_code != 200:
         return backend_error(resp)
     return flask.jsonify(resp.json()), resp.status_code

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



reply via email to

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