added stripeCheckoutUrl

This commit is contained in:
rizwanisready
2024-04-12 16:15:04 +05:30
parent f85ae72cc5
commit ebbe3e7792
6 changed files with 12 additions and 2 deletions

View File

@@ -53,3 +53,5 @@ STATIC_URL = "/static/"
STATICFILES_DIRS = [BASE_DIR.joinpath("static")]
STRIPE_CHECKOUT_URL = "http://localhost:8000/subscriptions/stripe-subscription/"

View File

@@ -75,3 +75,5 @@ STATIC_URL = "/static/"
STATICFILES_DIRS = [BASE_DIR.joinpath("static")]
STRIPE_CHECKOUT_URL = "https://staging.goodtimesltd.co.uk/subscriptions/stripe-subscription/"

View File

@@ -74,3 +74,5 @@ STATIC_URL = "/static/"
STATICFILES_DIRS = [BASE_DIR.joinpath("static")]
STRIPE_CHECKOUT_URL = "https://staging.goodtimesltd.co.uk/subscriptions/stripe-subscription/"

View File

@@ -74,3 +74,5 @@ STATIC_URL = "/static/"
STATICFILES_DIRS = [BASE_DIR.joinpath("static")]
STRIPE_CHECKOUT_URL = "https://goodtimes.betadelivery.com/subscriptions/stripe-subscription/"

View File

@@ -390,6 +390,7 @@ class SubscriptionPageView(TemplateView):
if subscriptions.exists():
context["subscriptions"] = subscriptions
context["stripeCheckoutUrl"] = settings.STRIPE_CHECKOUT_URL
else:
# Handle the case where no subscriptions are found for the principal type.
context["error"] = "No subscriptions found for your user type."

View File

@@ -442,9 +442,10 @@
<script>
console.log("Sanity check!");
var stripeCheckoutUrl = "{{ stripeCheckoutUrl }}";
console.log("stripeCheckoutUrl: ", stripeCheckoutUrl);
// Get Stripe publishable key
fetch("https://goodtimes.betadelivery.com/subscriptions/stripe-subscription/")
fetch(stripeCheckoutUrl)
.then((result) => { return result.json(); })
.then((data) => {
// Initialize Stripe.js