From 508c2079317a9aea62a97b3d90e2ca51052d8128 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Wed, 24 Feb 2021 15:30:04 +0100 Subject: [PATCH] accounts/** --- .../dashboard/src/pages/api/stripe/createCheckoutSession.js | 4 ---- packages/dashboard/src/pages/payments.js | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/dashboard/src/pages/api/stripe/createCheckoutSession.js b/packages/dashboard/src/pages/api/stripe/createCheckoutSession.js index 04d0954f..249b8e15 100644 --- a/packages/dashboard/src/pages/api/stripe/createCheckoutSession.js +++ b/packages/dashboard/src/pages/api/stripe/createCheckoutSession.js @@ -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 } }); diff --git a/packages/dashboard/src/pages/payments.js b/packages/dashboard/src/pages/payments.js index 94e71048..c1cd9870 100644 --- a/packages/dashboard/src/pages/payments.js +++ b/packages/dashboard/src/pages/payments.js @@ -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 } };