added stripeCheckoutUrl
This commit is contained in:
@@ -53,3 +53,5 @@ STATIC_URL = "/static/"
|
||||
|
||||
|
||||
STATICFILES_DIRS = [BASE_DIR.joinpath("static")]
|
||||
|
||||
STRIPE_CHECKOUT_URL = "http://localhost:8000/subscriptions/stripe-subscription/"
|
||||
|
||||
@@ -75,3 +75,5 @@ STATIC_URL = "/static/"
|
||||
|
||||
|
||||
STATICFILES_DIRS = [BASE_DIR.joinpath("static")]
|
||||
|
||||
STRIPE_CHECKOUT_URL = "https://staging.goodtimesltd.co.uk/subscriptions/stripe-subscription/"
|
||||
@@ -74,3 +74,5 @@ STATIC_URL = "/static/"
|
||||
|
||||
|
||||
STATICFILES_DIRS = [BASE_DIR.joinpath("static")]
|
||||
|
||||
STRIPE_CHECKOUT_URL = "https://staging.goodtimesltd.co.uk/subscriptions/stripe-subscription/"
|
||||
|
||||
@@ -74,3 +74,5 @@ STATIC_URL = "/static/"
|
||||
|
||||
|
||||
STATICFILES_DIRS = [BASE_DIR.joinpath("static")]
|
||||
|
||||
STRIPE_CHECKOUT_URL = "https://goodtimes.betadelivery.com/subscriptions/stripe-subscription/"
|
||||
|
||||
@@ -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."
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user