From 96650bc39149011007f54ba3a31533f8035e9bea Mon Sep 17 00:00:00 2001 From: Nick Sergeant Date: Thu, 18 Jun 2015 13:58:30 -0400 Subject: [PATCH] Switch to monthly plans. --- templates/pro.html | 16 ++++++++++++++-- templates/registration/registration_form.html | 2 +- views.py | 14 ++++++++------ 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/templates/pro.html b/templates/pro.html index 0aec7b9..15aa963 100644 --- a/templates/pro.html +++ b/templates/pro.html @@ -35,7 +35,7 @@
- Go Pro for just $29 (one-time fee). + Go Pro for just five bucks a month.

As a paid Snipt member, you'll have unrestricted access to the app, API, custom-domain blogging, instant chat support, and more. @@ -46,6 +46,15 @@

Please wait…
+
+ +
+ +
+
@@ -104,7 +113,7 @@
{% csrf_token %} - +
Secure by default. Every Snipt page is secure.
@@ -112,6 +121,9 @@ Your credit card is stored securely with Stripe and we use Stripe.js for maximum security.
+
+ Prefer to pay by PayPal? Email support@snipt.net +
{% endblock %} diff --git a/templates/registration/registration_form.html b/templates/registration/registration_form.html index 6f112d0..0b9498f 100644 --- a/templates/registration/registration_form.html +++ b/templates/registration/registration_form.html @@ -22,7 +22,7 @@ {% endif %}
- Free for 7 days, then just $29 (one-time fee). + Free for 7 days, then just five bucks a month.

Your free trial comes with unrestricted access to the app,
API, instant chat support, and more. diff --git a/views.py b/views.py index c12b910..cc559c3 100644 --- a/views.py +++ b/views.py @@ -105,13 +105,15 @@ def pro_complete(request): token = request.POST['token'] stripe.api_key = os.environ.get('STRIPE_SECRET_KEY', settings.STRIPE_SECRET_KEY) + if 'plan' in request.GET: + plan = request.GET['plan'] + else: + plan = request.POST['plan'] + try: - customer = stripe.Customer.create(email=request.user.email, - card=token) - stripe.Charge.create(amount=2900, - currency='usd', - customer=customer.id, - description='Snipt.net') + customer = stripe.Customer.create(card=token, + plan=plan, + email=request.user.email) except stripe.CardError, e: error_message = e.json_body['error']['message'] return HttpResponseRedirect('/pro/?declined=%s' % error_message or 'Your card was declined.')