Merge branch 'release/v10.10'
This commit is contained in:
@@ -26,7 +26,7 @@ import pandas as pd
|
|||||||
from rowsandall_app.settings import (
|
from rowsandall_app.settings import (
|
||||||
BRAINTREE_MERCHANT_ID,BRAINTREE_PUBLIC_KEY,BRAINTREE_PRIVATE_KEY,
|
BRAINTREE_MERCHANT_ID,BRAINTREE_PUBLIC_KEY,BRAINTREE_PRIVATE_KEY,
|
||||||
BRAINTREE_SANDBOX_MERCHANT_ID,BRAINTREE_SANDBOX_PUBLIC_KEY,
|
BRAINTREE_SANDBOX_MERCHANT_ID,BRAINTREE_SANDBOX_PUBLIC_KEY,
|
||||||
BRAINTREE_SANDBOX_PRIVATE_KEY
|
BRAINTREE_SANDBOX_PRIVATE_KEY, BRAINTREE_MERCHANT_ACCOUNT_ID
|
||||||
)
|
)
|
||||||
|
|
||||||
if settings.DEBUG or 'dev' in settings.SITE_URL:
|
if settings.DEBUG or 'dev' in settings.SITE_URL:
|
||||||
@@ -240,8 +240,11 @@ def create_subscription(rower,data):
|
|||||||
nonce_from_the_client = data['payment_method_nonce']
|
nonce_from_the_client = data['payment_method_nonce']
|
||||||
nonce = gateway.payment_method_nonce.find(nonce_from_the_client)
|
nonce = gateway.payment_method_nonce.find(nonce_from_the_client)
|
||||||
info = nonce.three_d_secure_info
|
info = nonce.three_d_secure_info
|
||||||
if info is None or not info.liability_shifted:
|
paymenttype = nonce.type
|
||||||
return False,0
|
|
||||||
|
if nonce.type != 'PayPalAccount':
|
||||||
|
if info is None or not info.liability_shifted:
|
||||||
|
return False,0
|
||||||
amount = data['amount']
|
amount = data['amount']
|
||||||
|
|
||||||
planid = data['plan']
|
planid = data['plan']
|
||||||
@@ -261,7 +264,8 @@ def create_subscription(rower,data):
|
|||||||
|
|
||||||
result = gateway.subscription.create({
|
result = gateway.subscription.create({
|
||||||
"payment_method_token": payment_method_token,
|
"payment_method_token": payment_method_token,
|
||||||
"plan_id": plan.external_id
|
"plan_id": plan.external_id,
|
||||||
|
# "merchant_account_id": BRAINTREE_MERCHANT_ACCOUNT_ID,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ class BillingForm(forms.Form):
|
|||||||
max_digits=8)
|
max_digits=8)
|
||||||
plan = forms.IntegerField(widget=forms.HiddenInput())
|
plan = forms.IntegerField(widget=forms.HiddenInput())
|
||||||
payment_method_nonce = forms.CharField(max_length=255,required=True)
|
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)
|
tac= forms.BooleanField(required=True,initial=False)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,8 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (payload.liabilityShifted || payload.type !== 'CreditCard') {
|
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;
|
hiddenNonceInput.value = payload.nonce;
|
||||||
form.submit();
|
form.submit();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -97,6 +97,7 @@
|
|||||||
</section>
|
</section>
|
||||||
|
|
||||||
<input type="hidden" id="nonce" name="payment_method_nonce" />
|
<input type="hidden" id="nonce" name="payment_method_nonce" />
|
||||||
|
<input type="hidden" id="paymenttype" name="paymenttype" />
|
||||||
<input type="hidden" id="plan" name="plan" value="{{ plan.id }}">
|
<input type="hidden" id="plan" name="plan" value="{{ plan.id }}">
|
||||||
<p>
|
<p>
|
||||||
<input id="tac" type="checkbox" name="tac" value="tac">I have taken note of the
|
<input id="tac" type="checkbox" name="tac" value="tac">I have taken note of the
|
||||||
|
|||||||
@@ -95,6 +95,7 @@
|
|||||||
</section>
|
</section>
|
||||||
<div id="paymenterror2"> </div>
|
<div id="paymenterror2"> </div>
|
||||||
<input type="hidden" id="nonce" name="payment_method_nonce" />
|
<input type="hidden" id="nonce" name="payment_method_nonce" />
|
||||||
|
<input type="hidden" id="paymenttype" name="paymenttype" />
|
||||||
<input type="hidden" id="plan" name="plan" value="{{ plan.id }}">
|
<input type="hidden" id="plan" name="plan" value="{{ plan.id }}">
|
||||||
<p>
|
<p>
|
||||||
<input id="tac" type="checkbox" name="tac" value="tac">I have taken note of the
|
<input id="tac" type="checkbox" name="tac" value="tac">I have taken note of the
|
||||||
|
|||||||
@@ -372,6 +372,7 @@ class PaymentTest(TestCase):
|
|||||||
'plan': plans[1].id,
|
'plan': plans[1].id,
|
||||||
'payment_method_nonce': 'aap',
|
'payment_method_nonce': 'aap',
|
||||||
'tac':'tac',
|
'tac':'tac',
|
||||||
|
'paymenttype': 'CreditCard'
|
||||||
}
|
}
|
||||||
|
|
||||||
form = BillingForm(form_data)
|
form = BillingForm(form_data)
|
||||||
@@ -416,6 +417,7 @@ class PaymentTest(TestCase):
|
|||||||
'amount':'15.00',
|
'amount':'15.00',
|
||||||
'plan': plans[1].id,
|
'plan': plans[1].id,
|
||||||
'payment_method_nonce': 'aap',
|
'payment_method_nonce': 'aap',
|
||||||
|
'paymenttype': 'CreditCard',
|
||||||
'tac':'tac',
|
'tac':'tac',
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -460,6 +462,7 @@ class PaymentTest(TestCase):
|
|||||||
'amount':'15.00',
|
'amount':'15.00',
|
||||||
'plan': plans[1].id,
|
'plan': plans[1].id,
|
||||||
'payment_method_nonce': 'aap',
|
'payment_method_nonce': 'aap',
|
||||||
|
'paymenttype': 'CreditCard',
|
||||||
'tac':'tac',
|
'tac':'tac',
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -504,6 +507,7 @@ class PaymentTest(TestCase):
|
|||||||
'amount':'15.00',
|
'amount':'15.00',
|
||||||
'plan': plans[1].id,
|
'plan': plans[1].id,
|
||||||
'payment_method_nonce': 'aap',
|
'payment_method_nonce': 'aap',
|
||||||
|
'paymenttype': 'CreditCard',
|
||||||
'tac':True,
|
'tac':True,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -553,6 +557,7 @@ class PaymentTest(TestCase):
|
|||||||
'amount':'15.00',
|
'amount':'15.00',
|
||||||
'plan': plans[1].id,
|
'plan': plans[1].id,
|
||||||
'payment_method_nonce': 'aap',
|
'payment_method_nonce': 'aap',
|
||||||
|
'paymenttype': 'CreditCard',
|
||||||
'tac':True,
|
'tac':True,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -597,6 +602,7 @@ class PaymentTest(TestCase):
|
|||||||
'amount':'15.00',
|
'amount':'15.00',
|
||||||
'plan': plans[1].id,
|
'plan': plans[1].id,
|
||||||
'payment_method_nonce': 'aap',
|
'payment_method_nonce': 'aap',
|
||||||
|
'paymenttype': 'CreditCard',
|
||||||
'tac':True,
|
'tac':True,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
BIN
rowers/tests/testdata/testdata.csv.gz
vendored
BIN
rowers/tests/testdata/testdata.csv.gz
vendored
Binary file not shown.
@@ -390,7 +390,6 @@ def upgrade_checkouts_view(request):
|
|||||||
url = reverse('billing_view')
|
url = reverse('billing_view')
|
||||||
return HttpResponseRedirect(url)
|
return HttpResponseRedirect(url)
|
||||||
else:
|
else:
|
||||||
print('noot',form)
|
|
||||||
messages.error(request,"There was an error in the payment form")
|
messages.error(request,"There was an error in the payment form")
|
||||||
url = reverse(upgrade_view)
|
url = reverse(upgrade_view)
|
||||||
return HttpResponseRedirect(url)
|
return HttpResponseRedirect(url)
|
||||||
|
|||||||
@@ -447,6 +447,11 @@ try:
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
BRAINTREE_MERCHANT_ID = ''
|
BRAINTREE_MERCHANT_ID = ''
|
||||||
|
|
||||||
|
try:
|
||||||
|
BRAINTREE_MERCHANT_ACCOUNT_ID = CFG['braintree_merchant_account_id']
|
||||||
|
except KeyError:
|
||||||
|
BRAINTREE_MERCHANT_ACCOUNT_ID = 'rowsandallEUR'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
BRAINTREE_PUBLIC_KEY = CFG['braintree_public_key']
|
BRAINTREE_PUBLIC_KEY = CFG['braintree_public_key']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
|||||||
Reference in New Issue
Block a user