From 6b1a1b17025a193cc17fbf079889402ae4ff0b81 Mon Sep 17 00:00:00 2001
From: Sander Roosendaal Donations are welcome to keep this web site going. To help cover the hosting
+ costs, I have created several paid plans offering advanced functionality.
+ Once I process your
+ donation, I will give you access to some The following table gives an overview of the different plans. As we are
+ constantly developing new functionality, the table might be slightly outdated. Don't
+ hesitate to contact us. The Pro membership is open for a free 14 day trial
+ Payments
+
+
+
special
features on this
+ website.
+
+
+
+
+
+
+
+ BASIC
+ PRO
+ SELF-COACH
+ COACH
+
+
+ Basic rowing metrics (spm, time, distance, heart rate, power)
+ ✔
+ ✔
+ ✔
+ ✔
+
+
+ Manual Import, Export, Synchronization and download of all your data
+ ✔
+ ✔
+ ✔
+ ✔
+
+
+ Automatic Synchronization with other fitness sites
+
+ ✔
+ ✔
+ ✔
+
+
+ Heart rate and power zones
+ ✔
+ ✔
+ ✔
+ ✔
+
+
+ Ranking Pieces, Stroke Analysis
+ ✔
+ ✔
+ ✔
+ ✔
+
+
+ Advanced Analysis (Critical Power, Stats, Box Chart, Trend Flex)
+
+ ✔
+ ✔
+ ✔
+
+
+ Compare Workouts
+
+ ✔
+ ✔
+ ✔
+
+
+ Empower Stroke Profile
+
+ ✔
+ ✔
+ ✔
+
+
+ Sensor Fusion, Split Workout, In-stroke metrics
+
+ ✔
+ ✔
+ ✔
+
+
+ Create Training plans, tests and challenges for yourself. Track your performance
+ against plan.
+
+
+ ✔
+ ✔
+
+
+ Create Training plans, tests and challenges for your athletes. Track their performance
+ against plan.
+
+
+
+ ✔
+
+
+ Create and manage teams.
+
+
+
+ ✔
+
+
+
+ Manage your athlete's workouts
+
+
+
+ ✔
+
The Coach plan functionality listed is available to the coach only. Individual athletes + can purchase upgrades to "Pro" and "Self-Coach" plans. +
+ +Rowsandall.com's Training Planning functionality + is part of the paid "Self-Coach" and "Coach" plans.
+ +On the "Self-Coach" plan, you can plan your own sessions.
+ +On the "Coach" plan, you can establish teams, see workouts done by + athletes on your team, and plan individual and group sessions for your + athletes. +
+ +If you would like to find a coach who helps you plan your training + through rowsandall.com, contact me throught the contact form.
+ + {% if user.rower.rowerplan == 'basic' and user.rower.protrialexpires|date_dif == 1 %} ++ You qualify for a 14 day free trial. No credit card needed. + Try out Pro or Self-Coach membership for two weeks. Click the button below to + sign up for the trial. After your trial period expires, you will be + automatically reset to the Basic plan, unless you upgrade to Pro. +
+Yes, I want to try Pro membership for 14 days for free. No strings attached.
+Yes, I want to try Self-Coach membership for 14 days for free. No strings attached.
+ {% endif %} + +Click on the PayPal button to pay for your Pro membership. Before you pay, please register for the free Basic membership and add your user name to the form. + Your payment will be valid for one year. + You will be taken to the secure PayPal payment site. +
+You need a Paypal account for this. This is plan will automatically renew each year.
++
+ +Only a credit card needed. Will not automatically renew
+ ++
+ +After you do the payment, we will manually change your membership to + "Pro". Depending on our availability, this may take some time + (typically one working day). Don't hesitate to contact us + if you have any questions at this stage.
+ +If, for any reason, you are not happy with your Pro membership, please let me know through the contact form. I will contact you as soon as possible to discuss how we can make things better.
+ +If, for any reason, you are not happy with your Pro membership, please let me know through the contact form. I will contact you as soon as possible to discuss how we can make things better.
+ diff --git a/rowers/urls.py b/rowers/urls.py index 242c07b4..ee3aa1ce 100644 --- a/rowers/urls.py +++ b/rowers/urls.py @@ -437,6 +437,8 @@ urlpatterns = [ url(r'^analysis/$', views.analysis_view,name='analysis'), url(r'^laboratory/$', views.laboratory_view,name='laboratory'), url(r'^promembership', TemplateView.as_view(template_name='promembership.html'),name='promembership'), + url(r'^checkouts',views.checkouts_view,name='checkouts'), + url(r'^payments',views.payments_view,name='payments'), url(r'^planrequired',views.planrequired_view), url(r'^starttrial$',views.start_trial_view), url(r'^startplantrial$',views.start_plantrial_view), diff --git a/rowers/views.py b/rowers/views.py index 8a32085c..de29e3f2 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -28,6 +28,7 @@ import isodate import re import cgi from icalendar import Calendar, Event +import braintree from django.shortcuts import render from django.template.loader import render_to_string @@ -50,7 +51,7 @@ from rowers.forms import ( RaceResultFilterForm,PowerIntervalUpdateForm,FlexAxesForm, FlexOptionsForm,DataFrameColumnsForm,OteWorkoutTypeForm, MetricsForm,DisqualificationForm,disqualificationreasons, - disqualifiers,SearchForm, + disqualifiers,SearchForm,BrainTreeForm ) from django.core.urlresolvers import reverse, reverse_lazy @@ -139,6 +140,7 @@ from rowsandall_app.settings import ( UNDERARMOUR_CLIENT_SECRET,UNDERARMOUR_CLIENT_KEY, RUNKEEPER_CLIENT_ID,RUNKEEPER_REDIRECT_URI,RUNKEEPER_CLIENT_SECRET, TP_CLIENT_ID,TP_REDIRECT_URI,TP_CLIENT_KEY,TP_CLIENT_SECRET, + BRAINTREE_MERCHANT_ID,BRAINTREE_PUBLIC_KEY,BRAINTREE_PRIVATE_KEY ) from rowers.tasks_standalone import addcomment2 @@ -1027,6 +1029,87 @@ def add_defaultfavorites(r): f.save() return 1 +# Experimental - Payments +@login_required() +def payments_view(request): + + r = getrequestrower(request) + + gateway = braintree.BraintreeGateway( + braintree.Configuration( + braintree.Environment.Sandbox, + merchant_id=BRAINTREE_MERCHANT_ID, + public_key=BRAINTREE_PUBLIC_KEY, + private_key=BRAINTREE_PRIVATE_KEY, + ) + ) + + # add code to store customer_id + + client_token = gateway.client_token.generate({ + "customer_id": r.id, + }) + + return render(request, + "payments.html", + { + 'client_token':client_token, + }) + + +@login_required() +def checkouts_view(request): + + r = getrequestrower(request) + + if request.method != 'POST': + url = reverse(payments_view) + return HttpResponseRedirect(url) + + # we're still here + gateway = braintree.BraintreeGateway( + braintree.Configuration( + braintree.Environment.Sandbox, + merchant_id=BRAINTREE_MERCHANT_ID, + public_key=BRAINTREE_PUBLIC_KEY, + private_key=BRAINTREE_PRIVATE_KEY, + ) + ) + + form = BrainTreeForm(request.POST) + if form.is_valid(): + nonce_from_the_client = form.cleaned_data['payment_method_nonce'] + amount = form.cleaned_data['amount'] + amount = str(amount) + + result = gateway.transaction.sale({ + "amount": amount, + "payment_method_nonce": nonce_from_the_client, + "options": { + "submit_for_settlement": True + } + }) + if result.is_success: + transaction = result.transaction + amount = transaction.amount + messages.info(request, + "We have successfully received your payment of {amount} Euro".format( + amount=amount + ) + ) + else: + messages.error(request,"We are sorry but there was an error with the payment") + url = reverse(payments_view) + return HttpResponseRedirect(url) + + else: + messages.error(request,"There was an error in the payment form") + url = reverse(payments_view) + return HttpResponseRedirect(url) + + url = reverse(payments_view) + return HttpResponseRedirect(url) + # User registration def rower_register_view(request): diff --git a/rowsandall_app/settings.py b/rowsandall_app/settings.py index 93bfb4a4..61484bbf 100644 --- a/rowsandall_app/settings.py +++ b/rowsandall_app/settings.py @@ -421,3 +421,20 @@ try: except KeyError: workoutemailbox = 'workouts@rowsandall.com' + +# payments + +try: + BRAINTREE_MERCHANT_ID = CFG['braintree_merchant_id'] +except KeyError: + BRAINTREE_MERCHANT_ID = '' + +try: + BRAINTREE_PUBLIC_KEY = CFG['braintree_public_key'] +except KeyError: + BRAINTREE_PUBLIC_KEY = '' + +try: + BRAINTREE_PRIVATE_KEY = CFG['braintree_private_key'] +except KeyError: + BRAINTREE_PRIVATE_KEY = '' From c48175bb4a5fd52678517748f6ed915af8baa137 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal- Download your data + Download your data
- Deactivate Account + Deactivate Account
Delete Account @@ -79,7 +99,7 @@
+
| Subscription | Next Billing Date | Price | + |
|---|---|---|---|
| + {{ subscription|lookup:"plan" }} + | ++ {{ subscription|lookup:"end_date" }} + | ++ {{ subscription|lookup:"price" }} € + | ++ Stop this plan + | +
+
+ By clicking on the link to stop the plan, you will downgrade to the Basic plan. + Future payments will be stopped. +
+ {% else %} ++ You don't have any subscriptions or your subscriptions cannot be automatically stopped + from the site. +
++ If you have paid through PayPal, log in to your PayPal account and cancel the recurring payment + there. We will manually downgrade your subscription. +
++ If you have questions, don't hesitate to contact us. +
+ {% endif %} +For tax reasons, we need your country of residence. You should + update this when it is incorrect.
++ Your upgrade will be effective immediately. For the current billing + cycle, you will be charged for a prorated amount. For example, when + you upgrade from a 15€ plan to a 65€ plan (a difference of + 50€) in the 6th month of the 12 month billing cycle, you + will be charged 35€. +
++ Looking for the downgrade option? +
++
| Plan | {{ plan.name }} | +
|---|---|
| Payment Type | {{ plan.paymenttype }} | +
| Plan Duration | 1 year starting today | +
| Total | € {{ plan.price|currency }} + {% if plan.paymenttype == 'recurring' %} + /year + {% endif %} + | +
+
| Street Address | {{ user.rower.street_address }} | +
|---|---|
| City | {{ user.rower.city }} | +
| Postal Code | {{ user.rower.postal_code }} | +
| Country | {{ user.rower.country }} + | +
+ Change Upgrade +
+ Your upgrade will be effective immediately. For the current billing + cycle, you will be charged for a prorated amount. For example, when + you upgrade from a 15€ plan to a 65€ plan (a difference of + 50€) in the 6th month of the 12 month billing cycle, you + will be charged 35€. +
++ User {{ name }} tried to cancel his subscription with id "{{ id }}" on {{ siteurl }} but failed. +
+ ++ User name: {{ username }} +
+ ++ User email: {{ email }} +
+ + ++ Best Regards, the Rowsandall Team +
+{% endblock %} + diff --git a/rowers/templates/paymentconfirmationemail.html b/rowers/templates/paymentconfirmationemail.html new file mode 100644 index 00000000..0bc62f45 --- /dev/null +++ b/rowers/templates/paymentconfirmationemail.html @@ -0,0 +1,19 @@ +{% extends "emailbase.html" %} + +{% block body %} +Dear {{ name }},
+ ++ Thank you. We have received the payment of € {{ amount }} for Rowsandall related services. +
+ ++ Please contact our customer service by replying to this email if you have any further + questions regarding the payment. +
+ ++ Best Regards, the Rowsandall Team +
+{% endblock %} + diff --git a/rowers/templates/rower_form.html b/rowers/templates/rower_form.html index ce5aea0c..b58f18fb 100644 --- a/rowers/templates/rower_form.html +++ b/rowers/templates/rower_form.html @@ -52,7 +52,7 @@ {% endif %} {% csrf_token %} - {% if rower.rowerplan != 'coach' and rower.user == user %} + {% if rower.clubsize < 100 and rower.user == user %} diff --git a/rowers/templates/subscription_create_email.html b/rowers/templates/subscription_create_email.html new file mode 100644 index 00000000..c312a6b1 --- /dev/null +++ b/rowers/templates/subscription_create_email.html @@ -0,0 +1,60 @@ +{% extends "emailbase.html" %} + +{% block body %} +Dear {{ name }},
+ ++ Thank you. We have received the payment of € {{ amount }} for your new + subscription to the Rowsandall paid plan "{{ planname }}". +
+ +{% if recurring %} ++ Your next charge is due on {{ end_of_billing_period }}. We will charge your {{ paymentmethod }} + on that date. +
+ ++ The subscription will keep running until you change or stop it. At any point in time you + can change the automatically renewing subscription to a "one year only" subscription through + the upgrade page. On this page, you can also + upgrade your subscription. +
+ +{% else %} ++ This one year subscription will automatically end on {{ end_of_billing_period }}. You can + renew your subscription after that. +
+ ++ At any point in time, you can change your subscription to an automatically renewing subscription. + You can do this on the upgrade page. + Here, you can also upgrade your subscription. +
+ +{% endif %} + ++ Upgrades in the middle of a billing cycle will be charged pro-rated. For the current billing + cycle, you will only be charged for the price difference for the remaining fraction of the + billing cycle. If you downgrade to a lower cost subscription, the pro-rated difference will be + used as a credit, lowering the amount charged on the next billing cycle. +
+ ++ You can stop the subscription through + the subscription management page. The + subscription will be stopped immediately without a refund. +
+ ++ Please contact our customer service by replying to this email if you have any further + questions regarding your subscription. +
+ ++ Best Regards, the Rowsandall Team +
+{% endblock %} + diff --git a/rowers/templates/subscription_update_email.html b/rowers/templates/subscription_update_email.html new file mode 100644 index 00000000..339c00fc --- /dev/null +++ b/rowers/templates/subscription_update_email.html @@ -0,0 +1,63 @@ +{% extends "emailbase.html" %} + +{% block body %} +Dear {{ name }},
+ ++ Thank you. We have received the payment of € {{ amount }} for + your updated Rowsandall subscription. + You are now on the Rowsandall paid plan "{{ planname }}". +
+ +{% if recurring %} ++ The subscription cost is €{{ price }} per year. + Your next charge is due on {{ end_of_billing_period }}. We will charge your {{ paymentmethod }} + on that date. +
+ ++ The subscription will keep running until you change or stop it. At any point in time you + can change the automatically renewing subscription to a "one year only" subscription through + the upgrade page. On this page, you can also + upgrade your subscription. +
+ +{% else %} ++ The price of the subscription is €{{ price }}. You have paid €{{ amount }} as a + prorated cost of your upgrade. + This one year subscription will automatically end on {{ end_of_billing_period }}. You can + renew your subscription after that. +
+ ++ At any point in time, you can change your subscription to an automatically renewing subscription. + You can do this on the upgrade page. + Here, you can also upgrade your subscription. +
+{% endif %} + ++ Upgrades in the middle of a billing cycle are charged pro-rated. For the current billing + cycle, you have only been charged for the price difference for the remaining fraction of the + billing cycle. If you downgraded to a lower cost subscription, the pro-rated difference will be + used as a credit, lowering the amount charged on the next billing cycle. +
+ ++ You can stop the subscription through + the subscription management page. The + subscription will be stopped immediately without a refund. +
+ ++ Please contact our customer service by replying to this email if you have any further + questions regarding your subscription. +
+ ++ Best Regards, the Rowsandall Team +
+{% endblock %} + diff --git a/rowers/templates/upgradeconfirm.html b/rowers/templates/upgradeconfirm.html index d064c78b..d4cc67ac 100644 --- a/rowers/templates/upgradeconfirm.html +++ b/rowers/templates/upgradeconfirm.html @@ -19,7 +19,7 @@User {{ name }} has created a subscription.
+ ++ New plan: "{{ planname }}". +
+ +{% if recurring %} ++ The subscription cost is €{{ price }} per year. + The next charge is due on {{ end_of_billing_period }}. on that date. +
+{% else %} ++ The subscription cost is €{{ price }}. The subscription ends on {{ end_of_billing_period }} +
+{% endif %} + ++ Amount charged: €{{ amount }} +
+ + ++ Best Regards, the Rowsandall Team +
+{% endblock %} + diff --git a/rowers/templates/subscription_update_email.html b/rowers/templates/subscription_update_email.html index 339c00fc..c50e1b08 100644 --- a/rowers/templates/subscription_update_email.html +++ b/rowers/templates/subscription_update_email.html @@ -12,7 +12,7 @@ {% if recurring %}The subscription cost is €{{ price }} per year. - Your next charge is due on {{ end_of_billing_period }}. We will charge your {{ paymentmethod }} + Your next charge is due on {{ end_of_billing_period }}. We will charge you automatically on that date.
diff --git a/rowers/templates/subscription_update_notification.html b/rowers/templates/subscription_update_notification.html new file mode 100644 index 00000000..1df49f73 --- /dev/null +++ b/rowers/templates/subscription_update_notification.html @@ -0,0 +1,30 @@ +{% extends "emailbase.html" %} + +{% block body %} +User {{ name }} has updated his subscription.
+ ++ New plan: "{{ planname }}". +
+ +{% if recurring %} ++ The subscription cost is €{{ price }} per year. + The next charge is due on {{ end_of_billing_period }}. on that date. +
+{% else %} ++ The subscription cost is €{{ price }}. The subscription ends on {{ end_of_billing_period }} +
+{% endif %} + ++ Amount charged: €{{ amount }} +
+ + ++ Best Regards, the Rowsandall Team +
+{% endblock %} + From ab9579a048d970487b584a78b59c0a350201adcb Mon Sep 17 00:00:00 2001 From: Sander RoosendaalFor tax reasons, we need your country of residence. You should + update this when it is incorrect.
++ Your downgrade will be effective immediately. + The price difference for the current billing cycle will + be credited to your next charge (prorated). For example, + when you downgrade from a 65€ plan to a 15€ plan + (50€ difference), in the 6th month of the 12 month + billing cycle, you will have a credit of 25€ which + will be used for the next billing cycles. +
+ ++ Looking for the downgrade option? +
++ Thank you for changing to {{ user.rower.paidplan.name }}. You're all settled. + membership. +
+ ++ {% if user.rower.paymenttype == 'recurring' %} + Your next payment will be automatically processed on {{ user.rower.planexpires }} + {% else %} + Your plan will end automatically on {{ user.rower.planexpires }} + {% endif %} +
+ +{% endblock %} + +{% block sidebar %} +{% include 'menu_profile.html' %} +{% endblock %} + diff --git a/rowers/templates/downgradeconfirm.html b/rowers/templates/downgradeconfirm.html new file mode 100644 index 00000000..c5bb79b2 --- /dev/null +++ b/rowers/templates/downgradeconfirm.html @@ -0,0 +1,118 @@ +{% extends "newbase.html" %} +{% block title %}Rowsandall Paid Membership{% endblock title %} +{% load rowerfilters %} +{% block main %} + ++
| Plan | {{ plan.name }} | +
|---|---|
| Payment Type | {{ plan.paymenttype }} | +
| Billing Cycle | 1 year | +
| Total | € {{ plan.price|currency }} + {% if plan.paymenttype == 'recurring' %} + /year + {% endif %} + | +
+
| Street Address | {{ user.rower.street_address }} | +
|---|---|
| City | {{ user.rower.city }} | +
| Postal Code | {{ user.rower.postal_code }} | +
| Country | {{ user.rower.country }} + | +
+ Change Downgrade +
+ Your downgrade will be effective immediately. You will not be charged. +
+Dear {{ name }},
+ ++ Thank you. You have successfully changed your plan to "{{ planname }}". +
+ +{% if recurring %} ++ The subscription cost is €{{ price }} per year. + Your next charge is due on {{ end_of_billing_period }}. We will charge you automatically + on that date. Because you downgraded, you have a credit on your account which will be + used before charging your payment method. +
+ ++ The subscription will keep running until you change or stop it. At any point in time you + can change the automatically renewing subscription to a "one year only" subscription through + the upgrade page. On this page, you can also + upgrade your subscription. +
+ +{% else %} ++ The price of the subscription is €{{ price }}. + This one year subscription will automatically end on {{ end_of_billing_period }}. You can + renew your subscription after that. Because you downgraded, you have a credit on your + account which will be used for future subscriptions or upgrades. +
+ ++ At any point in time, you can change your subscription to an automatically renewing subscription. + You can do this on the upgrade page. + Here, you can also upgrade your subscription. +
+{% endif %} + ++ Upgrades in the middle of a billing cycle are charged pro-rated. For the current billing + cycle, you have only been charged for the price difference for the remaining fraction of the + billing cycle. If you downgraded to a lower cost subscription, the pro-rated difference will be + used as a credit, lowering the amount charged on the next billing cycle. +
+ ++ You can stop the subscription through + the subscription management page. The + subscription will be stopped immediately without a refund. +
+ ++ Please contact our customer service by replying to this email if you have any further + questions regarding your subscription. +
+ ++ Best Regards, the Rowsandall Team +
+{% endblock %} + diff --git a/rowers/templates/subscription_downgrade_notification.html b/rowers/templates/subscription_downgrade_notification.html new file mode 100644 index 00000000..dce13caf --- /dev/null +++ b/rowers/templates/subscription_downgrade_notification.html @@ -0,0 +1,26 @@ +{% extends "emailbase.html" %} + +{% block body %} +User {{ name }} has downgraded his subscription.
+ ++ New plan: "{{ planname }}". +
+ +{% if recurring %} ++ The subscription cost is €{{ price }} per year. + The next charge is due on {{ end_of_billing_period }}. on that date. +
+{% else %} ++ The subscription cost is €{{ price }}. The subscription ends on {{ end_of_billing_period }} +
+{% endif %} + + ++ Best Regards, the Rowsandall Team +
+{% endblock %} + diff --git a/rowers/urls.py b/rowers/urls.py index 646ac0cf..474946e3 100644 --- a/rowers/urls.py +++ b/rowers/urls.py @@ -440,14 +440,18 @@ urlpatterns = [ url(r'^promembership', TemplateView.as_view(template_name='promembership.html'),name='promembership'), url(r'^checkout/(?P{% if user|team_members %} diff --git a/rowers/templates/transactions.html b/rowers/templates/transactions.html new file mode 100644 index 00000000..08cd6a0a --- /dev/null +++ b/rowers/templates/transactions.html @@ -0,0 +1,24 @@ +{% extends "newbase.html" %} +{% load staticfiles %} +{% load rowerfilters %} + +{% block main %} +
+ Transactions will be procesed by Braintree (A PayPal service): +
+
+
+
+
+
+ Payments will be procesed by Braintree (A PayPal service): +
+
+
+
+
+
diff --git a/rowers/templates/privacypolicy.html b/rowers/templates/privacypolicy.html index 34f72020..087f52c3 100644 --- a/rowers/templates/privacypolicy.html +++ b/rowers/templates/privacypolicy.html @@ -202,6 +202,15 @@ You agree to such cross-border transfers of personal information.
++ We user PayPal and Braintree (a PayPal service) to process payments. + Your payment information, such as credit card information, is not + stored on our servers, but is stored in a secure vault at our payment + processors PayPal and Braintree. +
+diff --git a/rowers/templates/upgradeconfirm.html b/rowers/templates/upgradeconfirm.html index 6d88470b..0776fccf 100644 --- a/rowers/templates/upgradeconfirm.html +++ b/rowers/templates/upgradeconfirm.html @@ -7,6 +7,15 @@
+ Payments will be procesed by Braintree (A PayPal service): +
+
+
+
+
+
diff --git a/rowers/views.py b/rowers/views.py
index 73e3dad9..a60d9df7 100644
--- a/rowers/views.py
+++ b/rowers/views.py
@@ -1063,6 +1063,8 @@ def add_defaultfavorites(r):
def paidplans_view(request):
if not request.user.is_anonymous():
r = getrequestrower(request)
+ if r.paymentprocessor != 'braintree' and r.paymenttype == 'recurring':
+ messages.error(request,'Automated payment processing is currently only available through BrainTree (by PayPal). You are currently on a recurring payment plan with PayPal. Contact the site administrator at support@rowsandall.com before you proceed')
else:
r = None
@@ -1080,6 +1082,9 @@ def billing_view(request):
r = getrequestrower(request)
+ if r.paymentprocessor != 'braintree' and r.paymenttype == 'recurring':
+ messages.error(request,'Automated payment processing is currently only available through BrainTree (by PayPal). You are currently on a recurring payment plan with PayPal. Contact the site administrator at support@rowsandall.com before you proceed')
+
if payments.is_existing_customer(r):
url = reverse(upgrade_view)
return HttpResponseRedirect(url)
@@ -1127,6 +1132,9 @@ def upgrade_view(request):
r = getrequestrower(request)
+ if r.paymentprocessor != 'braintree' and r.paymenttype == 'recurring':
+ messages.error(request,'Automated payment processing is currently only available through BrainTree (by PayPal). You are currently on a recurring payment plan with PayPal. Contact the site administrator at support@rowsandall.com before you proceed')
+
if r.subscription_id is None or r.subscription_id == '':
url = reverse(billing_view)
return HttpResponseRedirect(url)
@@ -1169,6 +1177,9 @@ def downgrade_view(request):
r = getrequestrower(request)
+ if r.paymentprocessor != 'braintree' and r.paymenttype == 'recurring':
+ messages.error(request,'Automated payment processing is currently only available through BrainTree (by PayPal). You are currently on a recurring payment plan with PayPal. Contact the site administrator at support@rowsandall.com before you proceed')
+
if r.subscription_id is None or r.subscription_id == '':
url = reverse(billing_view)
return HttpResponseRedirect(url)
@@ -1223,6 +1234,9 @@ def plan_stop_view(request):
subscriptions = []
+ if r.paymentprocessor != 'braintree' and r.paymenttype == 'recurring':
+ messages.error(request,'Automated payment processing is currently only available through BrainTree (by PayPal). You are currently on a recurring payment plan with PayPal. Contact the site administrator at support@rowsandall.com before you proceed')
+
if r.paidplan is not None and r.paidplan.paymentprocessor == 'braintree':
try:
subscriptions = braintreestuff.find_subscriptions(r)
@@ -1275,6 +1289,9 @@ def upgrade_confirm_view(request,planid = 0):
r = getrequestrower(request)
+ if r.paymentprocessor != 'braintree' and r.paymenttype == 'recurring':
+ messages.error(request,'Automated payment processing is currently only available through BrainTree (by PayPal). You are currently on a recurring payment plan with PayPal. Contact the site administrator at support@rowsandall.com before you proceed')
+
client_token = braintreestuff.get_client_token(r)
return render(request,
@@ -1326,6 +1343,9 @@ def payment_confirm_view(request,planid = 0):
r = getrequestrower(request)
+ if r.paymentprocessor != 'braintree' and r.paymenttype == 'recurring':
+ messages.error(request,'Automated payment processing is currently only available through BrainTree (by PayPal). You are currently on a recurring payment plan with PayPal. Contact the site administrator at support@rowsandall.com before you proceed')
+
client_token = braintreestuff.get_client_token(r)
return render(request,
@@ -1342,10 +1362,13 @@ def checkouts_view(request):
if not PAYMENT_PROCESSING_ON:
url = reverse('promembership')
return HttpResponseRedirect(url)
-
+
r = getrequestrower(request)
+ if r.paymentprocessor != 'braintree' and r.paymenttype == 'recurring':
+ messages.error(request,'Automated payment processing is currently only available through BrainTree (by PayPal). You are currently on a recurring payment plan with PayPal. Contact the site administrator at support@rowsandall.com before you proceed')
+
if request.method != 'POST':
url = reverse(paidplans_view)
return HttpResponseRedirect(url)
diff --git a/rowsandall_app/settings.py b/rowsandall_app/settings.py
index b96c3f66..63f81dac 100644
--- a/rowsandall_app/settings.py
+++ b/rowsandall_app/settings.py
@@ -125,6 +125,7 @@ TEMPLATES = [
'django.template.context_processors.i18n',
# 'context_processors.google_analytics',
'context_processors.warning_message',
+ 'rowers.context_processors.braintree_merchant',
],
# 'loaders': [
# 'django.template.loaders.app_directories.Loader',
From a9b315e8bfee929289276292f08dfcbc9297093f Mon Sep 17 00:00:00 2001
From: Sander Roosendaal
The subscription cost is €{{ price }} per year.
- The next charge is due on {{ end_of_billing_period }}. on that date.
+ The next charge is due on {{ end_of_billing_period }}.
diff --git a/rowers/templates/subscription_downgrade_notification.html b/rowers/templates/subscription_downgrade_notification.html
index dce13caf..6fb0589d 100644
--- a/rowers/templates/subscription_downgrade_notification.html
+++ b/rowers/templates/subscription_downgrade_notification.html
@@ -10,7 +10,7 @@
{% if recurring %}
The subscription cost is €{{ price }} per year.
- The next charge is due on {{ end_of_billing_period }}. on that date.
+ The next charge is due on {{ end_of_billing_period }}.
diff --git a/rowers/templates/subscription_update_notification.html b/rowers/templates/subscription_update_notification.html
index 1df49f73..ce72fe97 100644
--- a/rowers/templates/subscription_update_notification.html
+++ b/rowers/templates/subscription_update_notification.html
@@ -10,7 +10,7 @@
{% if recurring %}
The subscription cost is €{{ price }} per year.
- The next charge is due on {{ end_of_billing_period }}. on that date.
+ The next charge is due on {{ end_of_billing_period }}.