From 5dcaeff35f9f5843f9fb9b129ccf9e3a6a5ca693 Mon Sep 17 00:00:00 2001 From: ohanusichidubem3-maker Date: Sun, 5 Oct 2025 00:03:26 +0100 Subject: [PATCH] Create Dubem --- Dubem | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Dubem diff --git a/Dubem b/Dubem new file mode 100644 index 0000000000..69546e432e --- /dev/null +++ b/Dubem @@ -0,0 +1,15 @@ +import { loadStripe } from "@stripe/stripe-js"; + +const stripePromise = loadStripe("YOUR_STRIPE_PUBLIC_KEY"); + +const handlePayment = async (amount) => { + const res = await fetch("http://localhost:5000/api/create-checkout-session", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ amount }), + }); + + const session = await res.json(); + const stripe = await stripePromise; + await stripe.redirectToCheckout({ sessionId: session.id }); +};