aboutsummaryrefslogtreecommitdiffstats
path: root/routes/send.js
blob: 222ef3e9ec7d30b66ecbebe4838879aaac68182a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { err } from "lib/logging";
import sendInternal from "lib/sendInternal";
import { requirePin } from "lib/utils";

export default async (req, res, next) => {
  try {
    await requirePin(req);
    let payment = await sendInternal(req.body, req.user);
    res.send(payment);
  } catch (e) {
    err("problem sending internal payment", e.message);
    return res.code(500).send(e.message);
  }
};