bill reporting WIP

This commit is contained in:
Josh Harvey 2014-06-23 08:34:43 -04:00
parent 8c50444e80
commit 3ed2a96263
3 changed files with 21 additions and 8 deletions

View file

@ -60,6 +60,12 @@ var trade = function (req, res) {
res.json({err: null});
};
var event = function (req, res) {
var fingerprint = req.connection.getPeerCertificate().fingerprint;
_trader.event(req.body, fingerprint);
res.json({err: null});
};
var send = function(req, res) {
var fingerprint = req.connection.getPeerCertificate().fingerprint;
_trader.sendBitcoins(fingerprint, req.body, function(err, txHash) {
@ -96,6 +102,7 @@ exports.init = function(app, config, trader, authMiddleware) {
app.get('/poll', authMiddleware, poll);
app.post('/send', authMiddleware, send);
app.post('/trade', authMiddleware, trade);
app.post('/event', authMiddleware, event);
app.post('/pair', pair);
return app;