Working on new Snipt Pro flow.
parent
d93b564e0d
commit
2d80a4d594
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1928,9 +1928,9 @@ body.pro {
|
|||
div.payment-loading {
|
||||
background: rgba(#F2F2F2, .6);
|
||||
display: none;
|
||||
height: 248px;
|
||||
height: 287px;
|
||||
position: absolute;
|
||||
top: 37px;
|
||||
top: 261px;
|
||||
width: 100%;
|
||||
|
||||
span {
|
||||
|
@ -1939,7 +1939,7 @@ body.pro {
|
|||
color: #666;
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
margin: 80px auto 0 auto;
|
||||
margin: 122px auto 0 auto;
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
width: 120px;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
{% block page-title %}Sign up for Snipt Pro{% endblock %}
|
||||
|
||||
{% block body-class %}{{ block.super }} static signup pro{% endblock %}
|
||||
{% block body-class %}{{ block.super }} static signup pro pro-signup{% endblock %}
|
||||
|
||||
{% block extra-scripts %}
|
||||
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
|
||||
|
@ -39,11 +39,20 @@
|
|||
<p class="sub">
|
||||
We believe the best way to build a superior product is to charge for it.
|
||||
As a paid Snipt member, you'll have unrestricted access to the app, <a href="/api/">API</a>,
|
||||
instant chat support, and more.
|
||||
custom-domain <a href="/blogging/">blogging</a>, instant chat support, and more.
|
||||
</p>
|
||||
</div>
|
||||
<div class="payment-loading"><span>Please wait…</span></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="monthly">$5/month</option>
|
||||
<option value="yearly">$49/year</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="name">Name on card:</label>
|
||||
<div class="controls">
|
||||
|
@ -78,10 +87,8 @@
|
|||
<option value="11">11 - November</option>
|
||||
<option value="12">12 - December</option>
|
||||
</select>
|
||||
<select id="exp-year" class="span1">
|
||||
<select id="exp-year" class="span2">
|
||||
<option value="">----</option>
|
||||
<option value="2012">2012</option>
|
||||
<option value="2013">2013</option>
|
||||
<option value="2014">2014</option>
|
||||
<option value="2015">2015</option>
|
||||
<option value="2016">2016</option>
|
||||
|
@ -91,6 +98,8 @@
|
|||
<option value="2020">2020</option>
|
||||
<option value="2021">2021</option>
|
||||
<option value="2022">2022</option>
|
||||
<option value="2022">2023</option>
|
||||
<option value="2022">2024</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -5,84 +5,88 @@
|
|||
{% block body-class %}{{ block.super }} static signup{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<form class="form-horizontal static-box" method="post" action=".">
|
||||
{% if form.errors %}
|
||||
{% if form.non_field_errors %}
|
||||
<div class="alert alert-error">
|
||||
{{ form.non_field_errors }}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-error">
|
||||
Please fix the errors below.
|
||||
</div>
|
||||
{% if request.user.is_authenticated %}
|
||||
<script type="text/javascript">document.location.href = '/';</script>
|
||||
{% else %}
|
||||
<form class="form-horizontal static-box" method="post" action=".">
|
||||
{% if form.errors %}
|
||||
{% if form.non_field_errors %}
|
||||
<div class="alert alert-error">
|
||||
{{ form.non_field_errors }}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-error">
|
||||
Please fix the errors below.
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<fieldset>
|
||||
<div class="info">
|
||||
Free for 7 days, then just <span>$5/month</span> or <span>$49/year</span>.
|
||||
<p class="sub">
|
||||
We believe the best way to build a superior product is to charge for it.
|
||||
As a paid Snipt member, you'll have unrestricted access to the app, <a href="/api/">API</a>,
|
||||
instant chat support, and more.
|
||||
</p>
|
||||
</div>
|
||||
<div class="control-group {% if form.errors.username %}error{% endif %}">
|
||||
<label class="control-label" for="id_username">Username</label>
|
||||
<div class="controls">
|
||||
{{ form.username }}
|
||||
{% if form.errors.username %}
|
||||
<span class="help-inline">
|
||||
{% for error in form.errors.username %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% endif %}
|
||||
<fieldset>
|
||||
<div class="info">
|
||||
Free for 7 days, then just <span>$5/month</span> or <span>$49/year</span>.
|
||||
<p class="sub">
|
||||
We believe the best way to build a superior product is to charge for it.
|
||||
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.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group {% if form.errors.email %}error{% endif %}">
|
||||
<label class="control-label" for="id_email">Email address</label>
|
||||
<div class="controls">
|
||||
{{ form.email }}
|
||||
{% if form.errors.email %}
|
||||
<span class="help-inline">
|
||||
{% for error in form.errors.email %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% endif %}
|
||||
<div class="control-group {% if form.errors.username %}error{% endif %}">
|
||||
<label class="control-label" for="id_username">Username</label>
|
||||
<div class="controls">
|
||||
{{ form.username }}
|
||||
{% if form.errors.username %}
|
||||
<span class="help-inline">
|
||||
{% for error in form.errors.username %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group {% if form.errors.password1 %}error{% endif %}">
|
||||
<label class="control-label"l for="id_password1">Password</label>
|
||||
<div class="controls">
|
||||
{{ form.password1 }}
|
||||
{% if form.errors.password1 %}
|
||||
<span class="help-inline">
|
||||
{% for error in form.errors.password1 %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% endif %}
|
||||
<div class="control-group {% if form.errors.email %}error{% endif %}">
|
||||
<label class="control-label" for="id_email">Email address</label>
|
||||
<div class="controls">
|
||||
{{ form.email }}
|
||||
{% if form.errors.email %}
|
||||
<span class="help-inline">
|
||||
{% for error in form.errors.email %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group {% if form.errors.password2 %}error{% endif %}">
|
||||
<label class="control-label" for="id_password2">Confirm password</label>
|
||||
<div class="controls">
|
||||
{{ form.password2 }}
|
||||
{% if form.errors.password2 %}
|
||||
<span class="help-inline">
|
||||
{% for error in form.errors.password2 %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% endif %}
|
||||
<div class="control-group {% if form.errors.password1 %}error{% endif %}">
|
||||
<label class="control-label"l for="id_password1">Password</label>
|
||||
<div class="controls">
|
||||
{{ form.password1 }}
|
||||
{% if form.errors.password1 %}
|
||||
<span class="help-inline">
|
||||
{% for error in form.errors.password1 %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions group">
|
||||
<a class="btn pull-right" href="/login/">Log in</a>
|
||||
<button class="btn btn-primary" type="submit">Sign up</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
{% csrf_token %}
|
||||
</form>
|
||||
<div class="control-group {% if form.errors.password2 %}error{% endif %}">
|
||||
<label class="control-label" for="id_password2">Confirm password</label>
|
||||
<div class="controls">
|
||||
{{ form.password2 }}
|
||||
{% if form.errors.password2 %}
|
||||
<span class="help-inline">
|
||||
{% for error in form.errors.password2 %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions group">
|
||||
<a class="btn pull-right" href="/login/">Log in</a>
|
||||
<button class="btn btn-primary" type="submit">Sign up</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
{% csrf_token %}
|
||||
</form>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
5
views.py
5
views.py
|
@ -104,7 +104,10 @@ def pro_complete(request):
|
|||
token = request.POST['token']
|
||||
stripe.api_key = STRIPE_SECRET_KEY
|
||||
|
||||
plan = 'snipt-monthly'
|
||||
if request.POST['plan'] == 'monthly':
|
||||
plan = 'snipt-monthly'
|
||||
elif request.POST['plan'] == 'yearly':
|
||||
plan = 'snipt-yearly'
|
||||
|
||||
try:
|
||||
customer = stripe.Customer.create(card=token,
|
||||
|
|
Loading…
Reference in New Issue