From 9d66fcc3f7b94f9783e47647dd4336da43616a59 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Fri, 9 Aug 2019 10:52:24 +0200 Subject: [PATCH] works on paypal sandbox - until create subscription --- rowers/braintreestuff.py | 7 +++++-- rowers/forms.py | 1 + rowers/templates/braintreedropin.html | 3 ++- rowers/templates/paymentconfirm.html | 1 + rowers/templates/upgradeconfirm.html | 1 + 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/rowers/braintreestuff.py b/rowers/braintreestuff.py index 45f08c85..e06adba4 100644 --- a/rowers/braintreestuff.py +++ b/rowers/braintreestuff.py @@ -240,8 +240,11 @@ def create_subscription(rower,data): nonce_from_the_client = data['payment_method_nonce'] nonce = gateway.payment_method_nonce.find(nonce_from_the_client) info = nonce.three_d_secure_info - if info is None or not info.liability_shifted: - return False,0 + paymenttype = nonce.type + + if nonce.type != 'PayPalAccount': + if info is None or not info.liability_shifted: + return False,0 amount = data['amount'] planid = data['plan'] diff --git a/rowers/forms.py b/rowers/forms.py index 0be90550..18434a88 100644 --- a/rowers/forms.py +++ b/rowers/forms.py @@ -57,6 +57,7 @@ class BillingForm(forms.Form): max_digits=8) plan = forms.IntegerField(widget=forms.HiddenInput()) payment_method_nonce = forms.CharField(max_length=255,required=True) + paymenttype = forms.CharField(max_length=255,required=True) tac= forms.BooleanField(required=True,initial=False) diff --git a/rowers/templates/braintreedropin.html b/rowers/templates/braintreedropin.html index c7d1247c..a7c1595b 100644 --- a/rowers/templates/braintreedropin.html +++ b/rowers/templates/braintreedropin.html @@ -33,7 +33,8 @@ return; } if (payload.liabilityShifted || payload.type !== 'CreditCard') { - document.querySelector('#nonce').value = payload.nonce; + document.querySelector('#nonce').value = payload.nonce; + document.querySelector('#paymenttype').value = payload.type; hiddenNonceInput.value = payload.nonce; form.submit(); } else { diff --git a/rowers/templates/paymentconfirm.html b/rowers/templates/paymentconfirm.html index 77785ed1..95caaf0f 100644 --- a/rowers/templates/paymentconfirm.html +++ b/rowers/templates/paymentconfirm.html @@ -97,6 +97,7 @@ +

I have taken note of the diff --git a/rowers/templates/upgradeconfirm.html b/rowers/templates/upgradeconfirm.html index ae2cf183..107b117f 100644 --- a/rowers/templates/upgradeconfirm.html +++ b/rowers/templates/upgradeconfirm.html @@ -95,6 +95,7 @@

+

I have taken note of the