accounts/**

This commit is contained in:
Karol Wypchlo 2021-02-24 15:30:04 +01:00
parent 6c60c41ed3
commit 508c207931
2 changed files with 1 additions and 5 deletions

View File

@ -4,8 +4,6 @@ import { StatusCodes } from "http-status-codes";
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY);
export default async (req, res) => {
console.log(req.method);
if (req.method !== "POST") {
return res.status(StatusCodes.NOT_FOUND).end();
}
@ -34,8 +32,6 @@ export default async (req, res) => {
cancel_url: `${process.env.SKYNET_DASHBOARD_URL}/payments`,
});
console.log(session);
res.json({ sessionId: session.id });
} catch ({ message }) {
res.status(StatusCodes.BAD_REQUEST).json({ error: { message } });

View File

@ -51,7 +51,7 @@ export default function Payments() {
const stripe = new Stripe(process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY);
await stripe.redirectToCheckout({ sessionId });
} catch (error) {
// todo: handle error
console.log(error); // todo: handle error
}
};