From 777d92174c8ce96ddfe76acf7ce72c3a6250e62d Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Wed, 1 Apr 2020 11:10:10 -0700 Subject: [PATCH] send invoice to hub, let hub create invoices --- api/grpc/index.ts | 8 ++++++-- api/hub.ts | 16 ++++++++++++++++ app.ts | 7 +++++++ dist/api/grpc/index.js | 6 +++++- dist/api/grpc/index.js.map | 2 +- dist/api/hub.js | 16 ++++++++++++++++ dist/api/hub.js.map | 2 +- dist/app.js | 6 ++++++ dist/app.js.map | 2 +- 9 files changed, 59 insertions(+), 6 deletions(-) diff --git a/api/grpc/index.ts b/api/grpc/index.ts index f52ff73..6eef6b3 100644 --- a/api/grpc/index.ts +++ b/api/grpc/index.ts @@ -1,6 +1,6 @@ import {models} from '../models' import * as socket from '../utils/socket' -import { sendNotification } from '../hub' +import { sendNotification, sendInvoice } from '../hub' import * as jsonUtils from '../utils/json' import * as decodeUtils from '../utils/decode' import {loadLightning, SPHINX_CUSTOM_RECORD_KEY} from '../utils/lightning' @@ -74,9 +74,13 @@ function subscribeInvoices(actions) { const invoice = await models.Message.findOne({ where: { type: constants.message_types.invoice, payment_request: response['payment_request'] } }) if (invoice == null) { // console.log("ERROR: Invoice " + response['payment_request'] + " not found"); + const payReq = response['payment_request'] + if (process.env.HOSTING_PROVIDER==='true'){ + sendInvoice(payReq) + } socket.sendJson({ type: 'invoice_payment', - response: {invoice: response['payment_request']} + response: {invoice: payReq} }) return } diff --git a/api/hub.ts b/api/hub.ts index 4399f33..2aaf6ca 100644 --- a/api/hub.ts +++ b/api/hub.ts @@ -111,6 +111,22 @@ const checkInvitesHubInterval = (ms) => { setInterval(checkInviteHub, ms) } +export function sendInvoice(payReq) { + console.log('[hub] sending invoice') + fetch(config.hub_api_url + '/invoices', { + method: 'POST', + body: JSON.stringify({invoice:payReq}), + headers: { 'Content-Type': 'application/json' } + }) + .then(res => res.json()) + .then(json => { + // ? + }) + .catch(error => { + console.log('[hub error]', error) + }) +} + const finishInviteInHub = (params, onSuccess, onFailure) => { fetch(config.hub_api_url + '/invites/finish', { method: 'POST' , diff --git a/app.ts b/app.ts index e9362c8..700bb4c 100644 --- a/app.ts +++ b/app.ts @@ -94,6 +94,13 @@ async function authModule(req, res, next) { return } + if (process.env.HOSTING_PROVIDER==='true'){ + if (req.path === '/invoices') { + next() + return + } + } + const token = req.headers['x-user-token'] || req.cookies['x-user-token'] if (token == null) { diff --git a/dist/api/grpc/index.js b/dist/api/grpc/index.js index 598c7d8..a2b74bb 100644 --- a/dist/api/grpc/index.js +++ b/dist/api/grpc/index.js @@ -87,9 +87,13 @@ function subscribeInvoices(actions) { const invoice = yield models_1.models.Message.findOne({ where: { type: constants.message_types.invoice, payment_request: response['payment_request'] } }); if (invoice == null) { // console.log("ERROR: Invoice " + response['payment_request'] + " not found"); + const payReq = response['payment_request']; + if (process.env.HOSTING_PROVIDER === 'true') { + hub_1.sendInvoice(payReq); + } socket.sendJson({ type: 'invoice_payment', - response: { invoice: response['payment_request'] } + response: { invoice: payReq } }); return; } diff --git a/dist/api/grpc/index.js.map b/dist/api/grpc/index.js.map index e25d21d..de9deca 100644 --- a/dist/api/grpc/index.js.map +++ b/dist/api/grpc/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../api/grpc/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,0CAAyC;AACzC,gCAAyC;AACzC,2CAA0C;AAC1C,+CAA8C;AAC9C,kDAA0E;AAE1E,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,GAAG,8BAA8B,CAAC,CAAC;AAEtE,SAAS,mBAAmB,CAAC,CAAC,EAAE,OAAO;IACtC,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,cAAc,CAAA;IAC/D,MAAM,GAAG,GAAG,IAAI,IAAI,IAAI,CAAC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js +++ b/dist/api/hub.js @@ -107,6 +107,22 @@ const checkInvitesHubInterval = (ms) => { setInterval(checkInviteHub, ms); }; exports.checkInvitesHubInterval = checkInvitesHubInterval; +function sendInvoice(payReq) { + console.log('[hub] sending invoice'); + fetch(config.hub_api_url + '/invoices', { + method: 'POST', + body: JSON.stringify({ invoice: payReq }), + headers: { 'Content-Type': 'application/json' } + }) + .then(res => res.json()) + .then(json => { + // ? + }) + .catch(error => { + console.log('[hub error]', error); + }); +} +exports.sendInvoice = sendInvoice; const finishInviteInHub = (params, onSuccess, onFailure) => { fetch(config.hub_api_url + '/invites/finish', { method: 'POST', diff --git a/dist/api/hub.js.map b/dist/api/hub.js.map index 8a3d9ee..cafd3e9 100644 --- a/dist/api/hub.js.map +++ b/dist/api/hub.js.map @@ -1 +1 @@ -{"version":3,"file":"hub.js","sourceRoot":"","sources":["../../api/hub.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,qCAA+B;AAC/B,oCAAmC;AACnC,yCAA8B;AAC9B,yCAAwC;AACxC,0CAAyC;AACzC,qCAAoC;AACpC,+CAAyC;AACzC,iDAAiD;AAEjD,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,GAAG,2BAA2B,CAAC,CAAC;AACnE,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC,GAAG,CAAC,CAAC;AAElD,MAAM,cAAc,GAAG,CAAO,MAAM,GAAG,EAAE,EAAE,EAAE;IAC3C,IAAI,GAAG,IAAI,YAAY,EAAE;QACvB,OAAM;KACP;IACD,MAAM,KAAK,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAC,CAAC,CAAA;IAEvE,4CAA4C;IAE5C,MAAM,aAAa,GAAG,MAAM,eAAM,CAAC,MAAM,CAAC,OAAO,C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,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC,CAAA;AACxD,CAAC,CAAA,CAAA;AAMC,4CAAgB"} \ No newline at end of file diff --git a/dist/app.js b/dist/app.js index 5eca833..4b53e8d 100644 --- a/dist/app.js +++ b/dist/app.js @@ -99,6 +99,12 @@ function authModule(req, res, next) { next(); return; } + if (process.env.HOSTING_PROVIDER === 'true') { + if (req.path === '/invoices') { + next(); + return; + } + } const token = req.headers['x-user-token'] || req.cookies['x-user-token']; if (token == null) { res.writeHead(401, 'Access invalid for user', { 'Content-Type': 'text/plain' }); diff --git a/dist/app.js.map b/dist/app.js.map index 3620a38..eceaf22 100644 --- a/dist/app.js.map +++ b/dist/app.js.map @@ -1 +1 @@ -{"version":3,"file":"app.js","sourceRoot":"","sources":["../app.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mCAAkC;AAClC,0CAAyC;AACzC,iCAAgC;AAChC,8CAA6C;AAC7C,iCAAgC;AAChC,yCAAmC;AACnC,+CAAuC;AACvC,mCAAkE;AAClE,6CAA+C;AAC/C,iDAAgD;AAChD,6CAA4C;AAE5C,IAAI,MAAM,GAAQ,IAAI,CAAA;AACtB,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC;AACtC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,kBAAkB,CAAC,CAAC,GAAG,CAAC,CAAC;AAE5D,OAAO,CAAC,GAAG,CAAC,sBAAsB,GAAG,YAAY,CAAA;AAEjD,IAAI,CAAC,GAAG,CAAC,CAAA;AAET,eAAe;AACf,YAAY,EAAE,CAAA;AAEd,SAAe,YAAY;;QAC1B,CAAC,EAAE,CAAA;QACH,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,EAAE,CAAC,CAAA;QACnD,IAAI;YACH,MAAM,WAAW,CAAC,oBAAoB,EAAE,C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