Private
Public Access
1
0

works on paypal sandbox - until create subscription

This commit is contained in:
Sander Roosendaal
2019-08-09 10:52:24 +02:00
parent 7e284690de
commit 9d66fcc3f7
5 changed files with 10 additions and 3 deletions

View File

@@ -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']

View File

@@ -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)

View File

@@ -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 {

View File

@@ -97,6 +97,7 @@
</section>
<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 }}">
<p>
<input id="tac" type="checkbox" name="tac" value="tac">I have taken note of the

View File

@@ -95,6 +95,7 @@
</section>
<div id="paymenterror2"> </div>
<input type="hidden" id="nonce" name="payment_method_nonce" />
<input type="hidden" id="paymenttype" name="payment_type" />
<input type="hidden" id="plan" name="plan" value="{{ plan.id }}">
<p>
<input id="tac" type="checkbox" name="tac" value="tac">I have taken note of the