feat(txs): support for partial txs and full bill logging
This commit is contained in:
parent
bb4336b78f
commit
55abaa1bb9
3 changed files with 172 additions and 109 deletions
|
|
@ -63,8 +63,10 @@ function poll(req, res) {
|
|||
}
|
||||
|
||||
function trade(req, res) {
|
||||
plugins.trade(req.body, getFingerprint(req));
|
||||
res.json({err: null});
|
||||
plugins.trade(req.body, getFingerprint(req), function(err, data) {
|
||||
var statusCode = data && data.code !== null ? data.code : 201;
|
||||
res.json(statusCode, {err: null});
|
||||
});
|
||||
}
|
||||
|
||||
function deviceEvent(req, res) {
|
||||
|
|
@ -99,11 +101,12 @@ function verifyTransaction(req, res) {
|
|||
}
|
||||
|
||||
function send(req, res) {
|
||||
plugins.sendBitcoins(getFingerprint(req), req.body, function(err, txHash) {
|
||||
plugins.sendBitcoins(getFingerprint(req), req.body, function(err, status) {
|
||||
// TODO: use status.statusCode here after confirming machine compatibility
|
||||
res.json({
|
||||
errType: err && err.name,
|
||||
err: err && err.message,
|
||||
txHash: txHash,
|
||||
errType: err && err.name
|
||||
txHash: status && status.txHash
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue