Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/glacials/splits-io. a speedrunning data store and analysis engine splits.io
Something went wrong. Try again.
12345678910111213141516171819202122document.addEventListener("click", async function (event) { const subscribeButton = event.target.closest(".stripe-checkout"); if (subscribeButton === null) { return; }
event.preventDefault();
const stripe = Stripe(process.env.STRIPE_PUBLISHABLE_KEY); const result = await stripe.redirectToCheckout({ items: [{ plan: subscribeButton.dataset.planId, quantity: 1 }], successUrl: `${location.origin}/subscriptions/success?session_id={CHECKOUT_SESSION_ID}`, cancelUrl: `${location.origin}/subscriptions`, clientReferenceId: gon.user.id, customerEmail: gon.user.email, });
if (result.error) { document.getElementById("error-message").textContent = result.error.message; }});