Check individual invoice's payment
This commit is contained in:
parent
6074dc6c2c
commit
38a3dea8c2
@ -255,6 +255,19 @@ router.get('/getbtc', async function(req, res) {
|
|||||||
res.send([{ address }]);
|
res.send([{ address }]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
router.get('/checkpayment/:payment_hash', async function(req, res) {
|
||||||
|
logger.log('/checkpayment', [req.id]);
|
||||||
|
let u = new User(redis, bitcoinclient, lightning);
|
||||||
|
await u.loadByAuthorization(req.headers.authorization);
|
||||||
|
|
||||||
|
if (!u.getUserId()) {
|
||||||
|
return errorBadAuth(res);
|
||||||
|
}
|
||||||
|
|
||||||
|
let paid = !!(await u.getPaymentHashPaid(req.params.payment_hash));
|
||||||
|
res.send({paid: paid});
|
||||||
|
});
|
||||||
|
|
||||||
router.get('/balance', postLimiter, async function(req, res) {
|
router.get('/balance', postLimiter, async function(req, res) {
|
||||||
logger.log('/balance', [req.id]);
|
logger.log('/balance', [req.id]);
|
||||||
let u = new User(redis, bitcoinclient, lightning);
|
let u = new User(redis, bitcoinclient, lightning);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user