diff --git a/media/js/src/modules/partials/billing.html b/media/js/src/modules/partials/billing.html index c03dc28..63e6c92 100644 --- a/media/js/src/modules/partials/billing.html +++ b/media/js/src/modules/partials/billing.html @@ -5,27 +5,30 @@

-
+
{[{ user.stripeAccount.name || 'Loading...' }]}
-
+
+ One-time payment +
+
${[{ user.stripeAccount.amount / 100 }]}.00 USD / {[{ user.stripeAccount.interval }]} Loading...
-
+
xxxx-xxxx-xxxx-{[{ user.stripeAccount.last4 || 'Loading...' }]} Loading...
-
+
{[{ user.stripeAccount.status || 'Loading...' }]}
{[{ user.stripeAccount.created * 1000 |date:'fullDate' }]} Loading...
-
+
{[{ user.stripeAccount.nextBill * 1000 |date:'fullDate' }]} Loading...
-

Need to cancel? Email Nick.

+

Need to cancel? Email Nick.

diff --git a/templates/pro.html b/templates/pro.html index d4ed0ef..e77248a 100644 --- a/templates/pro.html +++ b/templates/pro.html @@ -36,7 +36,7 @@
- Subscribe for just $5/month or $49/year. + Subscribe for just $5/mo, $49/yr, or $149 once.

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, API, @@ -51,6 +51,7 @@

diff --git a/templates/registration/registration_form.html b/templates/registration/registration_form.html index 1b96d0e..e918a6c 100644 --- a/templates/registration/registration_form.html +++ b/templates/registration/registration_form.html @@ -22,7 +22,7 @@ {% endif %}
- Free for 7 days, then just $5/month or $49/year. + Free for 7 days, then just $5/mo, $49/yr, or $149 once.

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, API, diff --git a/views.py b/views.py index f61cb9f..cd9dd02 100644 --- a/views.py +++ b/views.py @@ -104,19 +104,32 @@ def pro_complete(request): token = request.POST['token'] stripe.api_key = STRIPE_SECRET_KEY - plan = 'snipt-monthly' + # One-time plan. + if request.POST['plan'] == 'onetime': + customer = stripe.Customer.create(email=request.user.email, + card=token) + try: + stripe.Charge.create(amount=14900, + currency='usd', + customer=customer.id, + description='Snipt.net') + except stripe.CardError: + return HttpResponseRedirect('/pro/?declined=true') - if request.POST['plan'] == 'monthly': - plan = 'snipt-monthly' - elif request.POST['plan'] == 'yearly': - plan = 'snipt-yearly' + # Recurring plans. + else: - try: - customer = stripe.Customer.create(card=token, - plan=plan, - email=request.user.email) - except stripe.CardError: - return HttpResponseRedirect('/pro/?declined=true') + if request.POST['plan'] == 'monthly': + plan = 'snipt-monthly' + elif request.POST['plan'] == 'yearly': + plan = 'snipt-yearly' + + try: + customer = stripe.Customer.create(card=token, + plan=plan, + email=request.user.email) + except stripe.CardError: + return HttpResponseRedirect('/pro/?declined=true') profile = request.user.profile profile.is_pro = True