Switch to monthly plans.

master
Nick Sergeant 2015-06-18 13:58:30 -04:00
parent 50c06f854f
commit 96650bc391
3 changed files with 23 additions and 9 deletions

View File

@ -35,7 +35,7 @@
<form class="form-horizontal static-box" id="pro-signup" method="post" action="/pro/complete/{% if 'plan' in request.GET %}?plan={{ request.GET.plan }}{% endif %}"> <form class="form-horizontal static-box" id="pro-signup" method="post" action="/pro/complete/{% if 'plan' in request.GET %}?plan={{ request.GET.plan }}{% endif %}">
<fieldset> <fieldset>
<div class="info"> <div class="info">
Go <span class="pro">Pro</span> for just <span>$29</span> (one-time fee). Go <span class="pro">Pro</span> for just <span>five bucks</span> a month.
<p class="sub"> <p class="sub">
As a paid Snipt member, you'll have unrestricted access to the app, <a href="/api/">API</a>, As a paid Snipt member, you'll have unrestricted access to the app, <a href="/api/">API</a>,
custom-domain <a href="/blogging/">blogging</a>, instant chat support, and more. custom-domain <a href="/blogging/">blogging</a>, instant chat support, and more.
@ -46,6 +46,15 @@
</div> </div>
<div class="payment-loading"><span>Please wait&hellip;</span></div> <div class="payment-loading"><span>Please wait&hellip;</span></div>
<div class="payment-errors alert alert-error"></div> <div class="payment-errors alert alert-error"></div>
<div class="control-group">
<label class="control-label" for="name">Payment plan:</label>
<div class="controls">
<select name="plan" type="text" class="input-medium" id="plan">
<option value="snipt-pro-monthly">$5/month</option>
<option value="snipt-pro-yearly">$60/year</option>
</select>
</div>
</div>
<div class="control-group"> <div class="control-group">
<label class="control-label" for="name">Name on card:</label> <label class="control-label" for="name">Name on card:</label>
<div class="controls"> <div class="controls">
@ -104,7 +113,7 @@
</div> </div>
<div class="form-actions"> <div class="form-actions">
{% csrf_token %} {% csrf_token %}
<button type="submit" class="btn btn-success">Pay Now</button> <button type="submit" class="btn btn-success">Subscribe</button>
<div class="security"> <div class="security">
<a href="https://stripe.com/help/security">Secure</a> by default. Every Snipt page is secure. <a href="https://stripe.com/help/security">Secure</a> by default. Every Snipt page is secure.
</div> </div>
@ -112,6 +121,9 @@
Your credit card is stored securely with <a href="https://stripe.com">Stripe</a> and we use <a href="https://stripe.com/docs/stripe.js">Stripe.js</a> for maximum security. Your credit card is stored securely with <a href="https://stripe.com">Stripe</a> and we use <a href="https://stripe.com/docs/stripe.js">Stripe.js</a> for maximum security.
</div> </div>
</div> </div>
<div class="form-actions" style="color: #A2A2A2;">
Prefer to pay by PayPal? Email <a href="mailto:support@snipt.net">support@snipt.net</a>
</div>
</fieldset> </fieldset>
</form> </form>
{% endblock %} {% endblock %}

View File

@ -22,7 +22,7 @@
{% endif %} {% endif %}
<fieldset> <fieldset>
<div class="info"> <div class="info">
Free for 7 days, then just <span>$29</span> (one-time fee). Free for 7 days, then just <span>five bucks</span> a month.
<p class="sub"> <p class="sub">
Your free trial comes with unrestricted access to the app,<br /> Your free trial comes with unrestricted access to the app,<br />
<a href="/api/">API</a>, instant chat support, and more. <a href="/api/">API</a>, instant chat support, and more.

View File

@ -105,13 +105,15 @@ def pro_complete(request):
token = request.POST['token'] token = request.POST['token']
stripe.api_key = os.environ.get('STRIPE_SECRET_KEY', settings.STRIPE_SECRET_KEY) 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: try:
customer = stripe.Customer.create(email=request.user.email, customer = stripe.Customer.create(card=token,
card=token) plan=plan,
stripe.Charge.create(amount=2900, email=request.user.email)
currency='usd',
customer=customer.id,
description='Snipt.net')
except stripe.CardError, e: except stripe.CardError, e:
error_message = e.json_body['error']['message'] error_message = e.json_body['error']['message']
return HttpResponseRedirect('/pro/?declined=%s' % error_message or 'Your card was declined.') return HttpResponseRedirect('/pro/?declined=%s' % error_message or 'Your card was declined.')