Browse Source

stripLightningPrefix

feature/dockerfile-arm v0.9.2
Evan Feenstra 5 years ago
parent
commit
77fc83985e
  1. 7
      api/controllers/invoices.ts
  2. 7
      dist/api/controllers/invoices.js
  3. 2
      dist/api/controllers/invoices.js.map

7
api/controllers/invoices.ts

@ -12,9 +12,14 @@ import * as network from '../network'
const constants = require(path.join(__dirname,'../../config/constants.json'))
function stripLightningPrefix(s){
if(s.toLowerCase().startsWith('lightning:')) return s.substring(10)
return s
}
const payInvoice = async (req, res) => {
const lightning = await loadLightning()
const { payment_request } = req.body;
const payment_request = stripLightningPrefix(req.body.payment_request)
if(!payment_request){
console.log('[pay invoice] "payment_request" is empty')

7
dist/api/controllers/invoices.js

@ -21,9 +21,14 @@ const confirmations_1 = require("./confirmations");
const path = require("path");
const network = require("../network");
const constants = require(path.join(__dirname, '../../config/constants.json'));
function stripLightningPrefix(s) {
if (s.toLowerCase().startsWith('lightning:'))
return s.substring(10);
return s;
}
const payInvoice = (req, res) => __awaiter(void 0, void 0, void 0, function* () {
const lightning = yield lightning_1.loadLightning();
const { payment_request } = req.body;
const payment_request = stripLightningPrefix(req.body.payment_request);
if (!payment_request) {
console.log('[pay invoice] "payment_request" is empty');
res.status(400);

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

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