adding multiple subscriptions 2
This commit is contained in:
@@ -427,18 +427,14 @@
|
||||
|
||||
<script>
|
||||
console.log("Sanity check!");
|
||||
var button = document.getElementById("submitBtn");
|
||||
|
||||
// Then, disable the button
|
||||
|
||||
|
||||
|
||||
// Get Stripe publishable key
|
||||
fetch("https://goodtimes.betadelivery.com/subscriptions/stripe-subscription/")
|
||||
.then((result) => { return result.json(); })
|
||||
.then((data) => {
|
||||
// Initialize Stripe.js
|
||||
const stripe = Stripe(data.publicKey);
|
||||
|
||||
console.log("loaded stripe public key");
|
||||
// new
|
||||
// Event handler
|
||||
// document.querySelector("#submitBtn").addEventListener("click", () => {
|
||||
@@ -459,6 +455,8 @@
|
||||
document.querySelectorAll(".subscribe-btn").forEach(button => {
|
||||
button.addEventListener("click", () => {
|
||||
const subscriptionId = button.getAttribute("data-subscription-id");
|
||||
|
||||
console.log("subscriptionId: ", subscriptionId);
|
||||
button.disabled = true;
|
||||
// Create checkout session for the selected subscription
|
||||
fetch("https://goodtimes.betadelivery.com/subscriptions/create-checkout-session/", {
|
||||
|
||||
Reference in New Issue
Block a user