Blockchain By Example
上QQ阅读APP看书,第一时间看更新

Invoicing

Finally, the system would be complete if it enabled the merchant to invoice the clients. For this purpose, you can add to your system a database-based invoice system to store the purchase invoices for future access. We can define an /invoice handler to provide the invoice details to the requester:

app.get("/invoice", urlencodedParser, function(req, res) {
var invoice_id = req.query.id;
var detail="details about the invoice N:"+invoice_id;
/*....invoice Database access..*/
res.send(detail);
});

Now, as the server is ready, we need to proceed to building the frontend part.