From 9a6633bbd145652e85aed92bd92b2d369a71ee2d Mon Sep 17 00:00:00 2001 From: Nick Sergeant Date: Fri, 30 May 2014 14:30:35 -0400 Subject: [PATCH] Support custom plans via URL. --- templates/pro.html | 6 +++--- views.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/templates/pro.html b/templates/pro.html index e77248a..1b62084 100644 --- a/templates/pro.html +++ b/templates/pro.html @@ -33,7 +33,7 @@ Your card was declined. You have not been charged. Please try again. {% endif %} -
+
Subscribe for just $5/mo, $49/yr, or $149 once. @@ -49,8 +49,8 @@
diff --git a/views.py b/views.py index cd9dd02..3c09fe4 100644 --- a/views.py +++ b/views.py @@ -119,10 +119,10 @@ def pro_complete(request): # Recurring plans. else: - if request.POST['plan'] == 'monthly': - plan = 'snipt-monthly' - elif request.POST['plan'] == 'yearly': - plan = 'snipt-yearly' + if 'plan' in request.GET: + plan = request.GET['plan'] + else: + plan = request.POST['plan'] try: customer = stripe.Customer.create(card=token,