View Issue Details

IDProjectCategoryView StatusLast Update
0006459Talermerchant backendpublic2022-11-04 19:52
ReporterChristian Grothoff Assigned Tosebasjm Resolution deadline
ImplementerReviewer 
Release signed byDeployed by 
VerifierCommunicator 
Data protection authority notification requiredNo  
CSIRT notification requiredNo  
Estimated effort (hours)Actual effort (hours)0 
Fast-trackNo
Work packagenone
PriorityhighSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Platformi7OSDebian GNU/LinuxOS Versionsqueeze
Product Versiongit (master) 
Target Version0.9Fixed in Version0.9 
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.

Required notifications

Address or linkRemarkAdded byNotifiedActions

Activities

Florian Dold

2020-08-03 12: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 12: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 14: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 15: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 18:52

manager   ~0016694

Last edited: 2020-08-21 18:52

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'].

sebasjm

2021-08-27 15:31

developer   ~0018134

working on this.
the page should work with and without js so i will do a build time rendering.

sebasjm

2021-08-31 04:00

developer   ~0018144

there is a full react html page that mimic the same design in merchant-backoffice repository (https://git.taler.net/merchant-backoffice.git/tree/packages/backend)

we can iterate the design there and new version will be deployed with the merchant backend as the spa.html
mustache placeholders are kept for server side rendering

one last step is missing: i need help updating the Makefile.am to correctly copying from the merchant-backend submodule to the merchant distribution folder :)

Christian Grothoff

2021-08-31 09:26

manager   ~0018146

To discuss this with Belen, it would be best if you could (manually) create a full-featured contract (JSON with _all_ the optional fields set to something) and had an easy way to render this contract with your page in a browser....

belen

2021-09-22 16:08

reporter   ~0018406

I've attached some design suggestions. I agree with Florian that rendering all the items in the contract terms is probably not necessary. I've kept things quite simple as a starting point.
sample_for_the_other_pages.png (49,291 bytes)   
sample_for_the_other_pages.png (49,291 bytes)   
order_details.png (83,556 bytes)   
order_details.png (83,556 bytes)   

Christian Grothoff

2021-09-28 16:24

manager   ~0018417

Last edited: 2021-09-28 16:25

Full-contract page (with selective disclosure) is used in the following contexts:

1. Merchant SPA
2. Web Extension
3. Android Wallet
4. Merchant backend order status page (untrusted, possibly without JS).

belen

2021-09-30 15:38

reporter   ~0018423

Here comes a version 2 showing all the information in the contract except 1) nonce (I didn't think this should be included. Let me know if I am mistaken) and 2) product image (it seems somehow out of place, and I rather keep the page as simple as possible).

The approach iI followed was grouping items into logical headings, and roughly sort those headings based on their interest for the customer.

sebasjm

2021-10-04 19:18

developer   ~0018425

implemented in 62f34bf4

Issue History

Date ModifiedUsernameFieldChange
2020-08-03 12:17Christian GrothoffNew Issue
2020-08-03 12:17Christian GrothoffStatusnew => assigned
2020-08-03 12:17Christian GrothoffAssigned To => Florian Dold
2020-08-03 12:21Florian DoldNote Added: 0016556
2020-08-03 12:21Florian DoldAssigned ToFlorian Dold => Christian Grothoff
2020-08-03 12:24Christian GrothoffAssigned ToChristian Grothoff => Florian Dold
2020-08-03 12:26Christian GrothoffNote Added: 0016557
2020-08-20 14:37Florian DoldNote Added: 0016685
2020-08-21 15:57Florian DoldStatusassigned => feedback
2020-08-21 15:57Florian DoldNote Added: 0016686
2020-08-21 18:52Christian GrothoffNote Added: 0016694
2020-08-21 18:52Christian GrothoffStatusfeedback => assigned
2020-08-21 18:52Christian GrothoffNote Edited: 0016694
2020-09-05 11:46Christian GrothoffTarget Version0.8 => 0.8.1
2021-08-24 18:39Christian GrothoffTarget Version => 0.8.5
2021-08-24 18:42Christian GrothoffAssigned ToFlorian Dold => sebasjm
2021-08-27 15:31sebasjmNote Added: 0018134
2021-08-27 16:02sebasjmStatusassigned => implementing
2021-08-31 04:00sebasjmNote Added: 0018144
2021-08-31 09:26Christian GrothoffNote Added: 0018146
2021-09-22 16:08belenNote Added: 0018406
2021-09-22 16:08belenFile Added: sample_for_the_other_pages.png
2021-09-22 16:08belenFile Added: order_details.png
2021-09-28 16:24Christian GrothoffNote Added: 0018417
2021-09-28 16:25Christian GrothoffNote Edited: 0018417
2021-09-30 15:38belenNote Added: 0018423
2021-09-30 15:38belenFile Added: merchant_backend_order_status_page.png
2021-10-04 19:18sebasjmNote Added: 0018425
2021-10-04 19:18sebasjmStatusimplementing => informing
2021-10-04 19:18sebasjmResolutionopen => fixed
2022-10-20 08:45Christian GrothoffTarget Version0.8.5 => 0.9
2022-10-20 08:47Christian GrothoffFixed in Version => 0.9
2022-11-04 19:52Christian GrothoffStatusinforming => closed
2025-03-22 13:09Christian GrothoffCategorymechant backend => merchant backend