aboutsummaryrefslogtreecommitdiffstats
path: root/addInvoice.js
diff options
context:
space:
mode:
Diffstat (limited to 'addInvoice.js')
-rw-r--r--addInvoice.js27
1 files changed, 0 insertions, 27 deletions
diff --git a/addInvoice.js b/addInvoice.js
deleted file mode 100644
index fa183321..00000000
--- a/addInvoice.js
+++ /dev/null
@@ -1,27 +0,0 @@
-module.exports = (app, db, lnb) => async (req, res) => {
- let err = m => res.status(500).send(m);
- let { amount, address, tip } = req.body;
-
- let invoice;
- try {
- invoice = await lnb.addInvoice({ value: amount });
- } catch (e) {
- return err(e.message);
- }
-
- let hash = invoice.payment_request;
- if (address) hash = address;
-
- await db.Payment.create({
- user_id: req.user.id,
- hash,
- amount,
- currency: "CAD",
- rate: app.get("rates")[req.user.currency],
- tip,
- confirmed: 1,
- asset: 'LNBTC',
- });
-
- res.send(invoice);
-};