Browse Source

return failed payment too

feature/dockerfile-arm
Evan Feenstra 5 years ago
parent
commit
cc744c89e0
  1. 11
      api/controllers/payment.ts
  2. 11
      dist/api/controllers/payment.js
  3. 2
      dist/api/controllers/payment.js.map

11
api/controllers/payment.ts

@ -8,8 +8,6 @@ import * as lightning from '../utils/lightning'
import {tokenFromTerms} from '../utils/ldat'
import * as constants from '../../config/constants.json'
const sendPayment = async (req, res) => {
const {
amount,
@ -107,10 +105,13 @@ const sendPayment = async (req, res) => {
// console.log('payment sent', { data })
success(res, jsonUtils.messageToJson(message, chat))
},
failure: (error) => {
message.update({status: constants.statuses.failed})
failure: async (error) => {
await message.update({status: constants.statuses.failed})
res.status(200);
res.json({ success: false, error });
res.json({
success: false,
message: jsonUtils.messageToJson(message, chat)
});
res.end();
}
})

11
dist/api/controllers/payment.js

@ -97,12 +97,15 @@ const sendPayment = (req, res) => __awaiter(void 0, void 0, void 0, function* ()
// console.log('payment sent', { data })
res_1.success(res, jsonUtils.messageToJson(message, chat));
}),
failure: (error) => {
message.update({ status: constants.statuses.failed });
failure: (error) => __awaiter(void 0, void 0, void 0, function* () {
yield message.update({ status: constants.statuses.failed });
res.status(200);
res.json({ success: false, error });
res.json({
success: false,
message: jsonUtils.messageToJson(message, chat)
});
res.end();
}
})
});
});
exports.sendPayment = sendPayment;

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

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