aboutsummaryrefslogtreecommitdiffstats
path: root/routes/send.js
blob: 591b5ab703af89c813fb197365de1950e6f91e9e (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);
  }
};