From 328663093100139c21bb2d01a4aaf83177ecad34 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Fri, 21 Dec 2018 15:04:35 +0100 Subject: [PATCH] adding braintree info --- rowers/context_processors.py | 6 ++++++ rowers/payments.py | 5 ++++- rowers/templates/downgrade.html | 9 +++++++++ rowers/templates/paymentconfirm.html | 9 +++++++++ rowers/templates/privacypolicy.html | 9 +++++++++ rowers/templates/upgradeconfirm.html | 9 +++++++++ rowers/views.py | 25 ++++++++++++++++++++++++- rowsandall_app/settings.py | 1 + 8 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 rowers/context_processors.py diff --git a/rowers/context_processors.py b/rowers/context_processors.py new file mode 100644 index 00000000..9aa44d1d --- /dev/null +++ b/rowers/context_processors.py @@ -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' } diff --git a/rowers/payments.py b/rowers/payments.py index 7e71aad5..503d6f4b 100644 --- a/rowers/payments.py +++ b/rowers/payments.py @@ -34,7 +34,10 @@ def setrowerplans(): def is_existing_customer(rower): if rower.country is not None and rower.customer_id is not None and rower.country != '': - return True + if rower.subscription_id is None or rower.subscription_id == '': + return False + else: + return True return False diff --git a/rowers/templates/downgrade.html b/rowers/templates/downgrade.html index 091b0dfe..bf2e7bc7 100644 --- a/rowers/templates/downgrade.html +++ b/rowers/templates/downgrade.html @@ -5,6 +5,15 @@

Downgrade

+

+ Transactions will be procesed by Braintree (A PayPal service): +

+

+ + + +

+