// static/main.js console.log("Sanity Check"); fetch("/schasite/config/") .then((result) => {return result.json(); }) .then((data) => { const stripe = Stripe(data.publicKey); // Event Handler document.querySelector("#submitBtn").addEventListener("click", () => { // Get Checkout Session ID fetch("/schasite/create-checkout-session/") .then((result) => { return result.json(); }) .then((data) => { console.log(data); // Redirect to Stripe Checkout return stripe.redirectToCheckout({sessionId: data.sessionId}) }) .then((res) => { console.log(res); }); }); });