From cb6246bce04802921600764dae88c316615f8bb5 Mon Sep 17 00:00:00 2001 From: Josh Creek <8179928+jcreek@users.noreply.github.com> Date: Sun, 5 May 2024 18:35:08 +0100 Subject: [PATCH] docs(*): Update documentation --- README.md | 1 - src/routes/api/checkout/+server.ts | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4bc22dc..95e6717 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,5 @@ In its current configuration, the application can be easily linked to Netlify vi ## To Do -- Style product page - Enable proper pagination for the products page - Get a proper checkout page with data from Stripe rather than re-using the old basket object diff --git a/src/routes/api/checkout/+server.ts b/src/routes/api/checkout/+server.ts index ff12fa0..8b6c306 100644 --- a/src/routes/api/checkout/+server.ts +++ b/src/routes/api/checkout/+server.ts @@ -26,5 +26,8 @@ export const POST: RequestHandler = async ({ request }) => { cancel_url: `${request.headers.get('origin')}/checkout/cancelled` }); + // TODO - Store the checkout session.id for access from the frontend + // https://docs.stripe.com/api/checkout/sessions/retrieve + return redirect(303, session.url as string); };