View Issue Details

IDProjectCategoryView StatusLast Update
0006459Talermechant backendpublic2020-09-05 13:46
ReporterChristian Grothoff Assigned ToFlorian Dold  
PriorityhighSeverityfeatureReproducibilityN/A
Status assignedResolutionopen 
Platformi7OSDebian GNU/LinuxOS Versionsqueeze
Product Versiongit (master) 
Target Version0.8.1 
Summary0006459: show full contract wallet-style in merchant HTML page
DescriptionASSUMING this is easily done based on what the wallet already has, we should modify the "show_order_details.en.must" template to include (existing!) JavaScript logic to properly render the JSON contract.

If such JS does not exist, and/or also in the long run, we should instead enhance our mustach template expansion capabilities so we can iterate over all contract fields and do everything mustach-template style so we can avoid needing any JavaScript.

Assigning to Florian so he can eval if existing Wallet code can easily plug this. If not, bump to 0.8.1 and we'll take care of it then via mustach.

Location in the code is marked with a FIXME and the bug number.
TagsNo tags attached.

Activities

Florian Dold

2020-08-03 14:21

manager   ~0016556

Contracts are currently rendered via React, i.e. by client-side DOM manipulation. That's necessary in the WebExtension wallet, as in a web extension we don't have any server to render stuff for us ;-)

We could of course also use this code in the the merchant backend HTML page, but that drags in a lot of dependencies (well, mainly React.JS) that we might not want. It also wouldn't work without JavaScript anymore.

Christian Grothoff

2020-08-03 14:26

manager   ~0016557

I understand that this won't work with JS anymore, that's why I suggested this as a temporary / quick fix (which means additional dependencies can also be OK). I don't think we'll have the time to do a proper (!) and fully equivalent MUST-based rendering for 0.8, and I don't think we want to show the raw JSON or _nothing_ for 0.8. So temporarily dropping in a JS-based solution seemed like an acceptable trade-off.

Florian Dold

2020-08-20 16:37

manager   ~0016685

I don't think this is viable, because the wallet's rendering of the contract terms is very minimalist right now. The functionality we get from (temporarily!) integrating the JS code in the merchant backend HTML page isn't justified.

It would be more effective to pass the contract JSON into the mustache template. The mustac library can do this for another JSON library already (json-c): https://gitlab.com/jobol/mustach/-/blob/master/mustach-json-c.h

I'll work on making jansson work with mustach.

Florian Dold

2020-08-21 17:57

manager   ~0016686

Putting this on feedback as the following questions are open:

1. Do we really need the label mechanism in the contract terms, or can we inline labels for better rendering, and introduce a tag for a "URL location"
2. The "Location" definition seems incomplete, shouldn't we at least have additional "free form" address lines?
3. What parts of the contract terms should be rendered on the page? Should we really list auditors/exchanges and h_wire? Is the following list enough?
    * summary
    * amount
    * product list (with pictures if available)
    * merchant information
  should probably be enough?

Christian Grothoff

2020-08-21 20:52

manager   ~0016694

Last edited: 2020-08-21 20:52

View 2 revisions

I would allow seeing auditors/exchanges and locations via buttons to 'expand' certain details (similar to what we used to do in some wallets).
[That is, if JavaScript is enabled. So maybe if JS is off, show everything, if it is on, hide certain details behind buttons to 'expand'].

Issue History

Date Modified Username Field Change
2020-08-03 14:17 Christian Grothoff New Issue
2020-08-03 14:17 Christian Grothoff Status new => assigned
2020-08-03 14:17 Christian Grothoff Assigned To => Florian Dold
2020-08-03 14:21 Florian Dold Note Added: 0016556
2020-08-03 14:21 Florian Dold Assigned To Florian Dold => Christian Grothoff
2020-08-03 14:24 Christian Grothoff Assigned To Christian Grothoff => Florian Dold
2020-08-03 14:26 Christian Grothoff Note Added: 0016557
2020-08-20 16:37 Florian Dold Note Added: 0016685
2020-08-21 17:57 Florian Dold Status assigned => feedback
2020-08-21 17:57 Florian Dold Note Added: 0016686
2020-08-21 20:52 Christian Grothoff Note Added: 0016694
2020-08-21 20:52 Christian Grothoff Status feedback => assigned
2020-08-21 20:52 Christian Grothoff Note Edited: 0016694 View Revisions
2020-09-05 13:46 Christian Grothoff Target Version 0.8 => 0.8.1