card verification working
This commit is contained in:
@@ -103,7 +103,7 @@ def make_payment(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:
|
if info is None or not info.liability_shifted:
|
||||||
return False,0
|
return False,0
|
||||||
|
|
||||||
amount = data['amount']
|
amount = data['amount']
|
||||||
@@ -138,7 +138,7 @@ def update_subscription(rower,data,method='up'):
|
|||||||
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:
|
if info is None or not info.liability_shifted:
|
||||||
return False,0
|
return False,0
|
||||||
amount = data['amount']
|
amount = data['amount']
|
||||||
amount = '{amount:.2f}'.format(amount=amount)
|
amount = '{amount:.2f}'.format(amount=amount)
|
||||||
@@ -240,7 +240,7 @@ 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:
|
if info is None or not info.liability_shifted:
|
||||||
return False,0
|
return False,0
|
||||||
amount = data['amount']
|
amount = data['amount']
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
<script>
|
<script>
|
||||||
var form = document.querySelector('#payment-form');
|
var form = document.querySelector('#payment-form');
|
||||||
var hiddenNonceInput = document.querySelector('#nonce');
|
var hiddenNonceInput = document.querySelector('#nonce');
|
||||||
|
var paymenterrordiv = document.getElementById("paymenterror");
|
||||||
var client_token = '{{ client_token }}';
|
var client_token = '{{ client_token }}';
|
||||||
braintree.dropin.create({
|
braintree.dropin.create({
|
||||||
authorization: client_token,
|
authorization: client_token,
|
||||||
@@ -28,7 +29,8 @@
|
|||||||
} else {
|
} else {
|
||||||
// Decide if you will force the user to enter a different
|
// Decide if you will force the user to enter a different
|
||||||
// payment method if liablity was not shifted
|
// payment method if liablity was not shifted
|
||||||
dropinInstance.clearSelectedPaymentMethod();
|
instance.clearSelectedPaymentMethod();
|
||||||
|
paymenterrordiv.innerHTML = '<p class="message">3D Secure Card Verification Error. Please check your card details.</p>';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -42,5 +44,5 @@
|
|||||||
$('#payment-form').submit(function() {
|
$('#payment-form').submit(function() {
|
||||||
$(this).find("button[type='submit']").prop('disabled',true);
|
$(this).find("button[type='submit']").prop('disabled',true);
|
||||||
console.log("disabled");
|
console.log("disabled");
|
||||||
}
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
{% extends "newbase.html" %}
|
{% extends "newbase.html" %}
|
||||||
{% block title %}Rowsandall Paid Membership{% endblock title %}
|
{% block title %}Rowsandall Paid Membership{% endblock title %}
|
||||||
{% load rowerfilters %}
|
{% load rowerfilters %}
|
||||||
|
|
||||||
|
|
||||||
{% block main %}
|
{% block main %}
|
||||||
|
|
||||||
|
<div id="paymenterror">
|
||||||
|
</div>
|
||||||
|
|
||||||
<h1>Confirm Your Payment</h1>
|
<h1>Confirm Your Payment</h1>
|
||||||
|
|
||||||
<h2>Order Overview</h2>
|
<h2>Order Overview</h2>
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
{% load rowerfilters %}
|
{% load rowerfilters %}
|
||||||
{% block main %}
|
{% block main %}
|
||||||
|
|
||||||
|
<div id="paymenterror">
|
||||||
|
</div>
|
||||||
|
|
||||||
<h1>Confirm Your Payment</h1>
|
<h1>Confirm Your Payment</h1>
|
||||||
|
|
||||||
<h2>Order Overview</h2>
|
<h2>Order Overview</h2>
|
||||||
|
|||||||
Reference in New Issue
Block a user