works on paypal sandbox - until create subscription
This commit is contained in:
@@ -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']
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user