Browse Source

pay invoice logs

feature/dockerfile-arm v0.9.1
Evan Feenstra 5 years ago
parent
commit
cc9e0db8e5
  1. 9
      api/controllers/invoices.ts
  2. 8
      dist/api/controllers/invoices.js
  3. 2
      dist/api/controllers/invoices.js.map

9
api/controllers/invoices.ts

@ -16,6 +16,15 @@ const payInvoice = async (req, res) => {
const lightning = await loadLightning()
const { payment_request } = req.body;
if(!payment_request){
console.log('[pay invoice] "payment_request" is empty')
res.status(400)
res.json({success:false, error:'payment_request is empty'})
res.end()
return
}
console.log(`[pay invoice] ${payment_request}`)
var call = lightning.sendPayment({})
call.on('data', async response => {

8
dist/api/controllers/invoices.js

@ -24,6 +24,14 @@ const constants = require(path.join(__dirname, '../../config/constants.json'));
const payInvoice = (req, res) => __awaiter(void 0, void 0, void 0, function* () {
const lightning = yield lightning_1.loadLightning();
const { payment_request } = req.body;
if (!payment_request) {
console.log('[pay invoice] "payment_request" is empty');
res.status(400);
res.json({ success: false, error: 'payment_request is empty' });
res.end();
return;
}
console.log(`[pay invoice] ${payment_request}`);
var call = lightning.sendPayment({});
call.on('data', (response) => __awaiter(void 0, void 0, void 0, function* () {
console.log('[pay invoice data]', response);

2
dist/api/controllers/invoices.js.map

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save