adding braintree info
This commit is contained in:
6
rowers/context_processors.py
Normal file
6
rowers/context_processors.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
from django.conf import settings # import the settings file
|
||||||
|
|
||||||
|
def braintree_merchant(request):
|
||||||
|
# return the value you want as a dictionnary. you may add multiple values in there.
|
||||||
|
# return {'BRAINTREE_MERCHANT_ID': settings.BRAINTREE_MERCHANT_ID}
|
||||||
|
return {'BRAINTREE_MERCHANT_ID': 'jytq7yxsm66qqdzb' }
|
||||||
@@ -34,6 +34,9 @@ def setrowerplans():
|
|||||||
|
|
||||||
def is_existing_customer(rower):
|
def is_existing_customer(rower):
|
||||||
if rower.country is not None and rower.customer_id is not None and rower.country != '':
|
if rower.country is not None and rower.customer_id is not None and rower.country != '':
|
||||||
|
if rower.subscription_id is None or rower.subscription_id == '':
|
||||||
|
return False
|
||||||
|
else:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|||||||
@@ -5,6 +5,15 @@
|
|||||||
|
|
||||||
<h1>Downgrade</h1>
|
<h1>Downgrade</h1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Transactions will be procesed by Braintree (A PayPal service):
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<a href="https://www.braintreegateway.com/merchants/{{ BRAINTREE_MERCHANT_ID }}/verified" target="_blank">
|
||||||
|
<img src="https://s3.amazonaws.com/braintree-badges/braintree-badge-light.png" width="164px" height ="44px" border="0"/>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
<ul class="main-content">
|
<ul class="main-content">
|
||||||
<li class="grid_3">
|
<li class="grid_3">
|
||||||
|
|||||||
@@ -7,6 +7,15 @@
|
|||||||
|
|
||||||
<h2>Order Overview</h2>
|
<h2>Order Overview</h2>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Payments will be procesed by Braintree (A PayPal service):
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<a href="https://www.braintreegateway.com/merchants/{{ BRAINTREE_MERCHANT_ID }}/verified" target="_blank">
|
||||||
|
<img src="https://s3.amazonaws.com/braintree-badges/braintree-badge-light.png" width="164px" height ="44px" border="0"/>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
<ul class="main-content">
|
<ul class="main-content">
|
||||||
<li class="grid_2">
|
<li class="grid_2">
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -202,6 +202,15 @@
|
|||||||
You agree to such cross-border transfers of personal information.
|
You agree to such cross-border transfers of personal information.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<h3>Payment Information</h3>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
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.
|
||||||
|
</p>
|
||||||
|
|
||||||
<h3>Team Functionality</h3>
|
<h3>Team Functionality</h3>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -7,6 +7,15 @@
|
|||||||
|
|
||||||
<h2>Order Overview</h2>
|
<h2>Order Overview</h2>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Payments will be procesed by Braintree (A PayPal service):
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<a href="https://www.braintreegateway.com/merchants/{{ BRAINTREE_MERCHANT_ID }}/verified" target="_blank">
|
||||||
|
<img src="https://s3.amazonaws.com/braintree-badges/braintree-badge-light.png" width="164px" height ="44px" border="0"/>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
<ul class="main-content">
|
<ul class="main-content">
|
||||||
<li class="grid_2">
|
<li class="grid_2">
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -1063,6 +1063,8 @@ def add_defaultfavorites(r):
|
|||||||
def paidplans_view(request):
|
def paidplans_view(request):
|
||||||
if not request.user.is_anonymous():
|
if not request.user.is_anonymous():
|
||||||
r = getrequestrower(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')
|
||||||
else:
|
else:
|
||||||
r = None
|
r = None
|
||||||
|
|
||||||
@@ -1080,6 +1082,9 @@ def billing_view(request):
|
|||||||
|
|
||||||
r = getrequestrower(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):
|
if payments.is_existing_customer(r):
|
||||||
url = reverse(upgrade_view)
|
url = reverse(upgrade_view)
|
||||||
return HttpResponseRedirect(url)
|
return HttpResponseRedirect(url)
|
||||||
@@ -1127,6 +1132,9 @@ def upgrade_view(request):
|
|||||||
|
|
||||||
r = getrequestrower(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 == '':
|
if r.subscription_id is None or r.subscription_id == '':
|
||||||
url = reverse(billing_view)
|
url = reverse(billing_view)
|
||||||
return HttpResponseRedirect(url)
|
return HttpResponseRedirect(url)
|
||||||
@@ -1169,6 +1177,9 @@ def downgrade_view(request):
|
|||||||
|
|
||||||
r = getrequestrower(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 == '':
|
if r.subscription_id is None or r.subscription_id == '':
|
||||||
url = reverse(billing_view)
|
url = reverse(billing_view)
|
||||||
return HttpResponseRedirect(url)
|
return HttpResponseRedirect(url)
|
||||||
@@ -1223,6 +1234,9 @@ def plan_stop_view(request):
|
|||||||
|
|
||||||
subscriptions = []
|
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':
|
if r.paidplan is not None and r.paidplan.paymentprocessor == 'braintree':
|
||||||
try:
|
try:
|
||||||
subscriptions = braintreestuff.find_subscriptions(r)
|
subscriptions = braintreestuff.find_subscriptions(r)
|
||||||
@@ -1275,6 +1289,9 @@ def upgrade_confirm_view(request,planid = 0):
|
|||||||
|
|
||||||
r = getrequestrower(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')
|
||||||
|
|
||||||
client_token = braintreestuff.get_client_token(r)
|
client_token = braintreestuff.get_client_token(r)
|
||||||
|
|
||||||
return render(request,
|
return render(request,
|
||||||
@@ -1326,6 +1343,9 @@ def payment_confirm_view(request,planid = 0):
|
|||||||
|
|
||||||
r = getrequestrower(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')
|
||||||
|
|
||||||
client_token = braintreestuff.get_client_token(r)
|
client_token = braintreestuff.get_client_token(r)
|
||||||
|
|
||||||
return render(request,
|
return render(request,
|
||||||
@@ -1346,6 +1366,9 @@ def checkouts_view(request):
|
|||||||
|
|
||||||
r = getrequestrower(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 request.method != 'POST':
|
if request.method != 'POST':
|
||||||
url = reverse(paidplans_view)
|
url = reverse(paidplans_view)
|
||||||
return HttpResponseRedirect(url)
|
return HttpResponseRedirect(url)
|
||||||
|
|||||||
@@ -125,6 +125,7 @@ TEMPLATES = [
|
|||||||
'django.template.context_processors.i18n',
|
'django.template.context_processors.i18n',
|
||||||
# 'context_processors.google_analytics',
|
# 'context_processors.google_analytics',
|
||||||
'context_processors.warning_message',
|
'context_processors.warning_message',
|
||||||
|
'rowers.context_processors.braintree_merchant',
|
||||||
],
|
],
|
||||||
# 'loaders': [
|
# 'loaders': [
|
||||||
# 'django.template.loaders.app_directories.Loader',
|
# 'django.template.loaders.app_directories.Loader',
|
||||||
|
|||||||
Reference in New Issue
Block a user