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 = gateway.payment_method_nonce.find(nonce_from_the_client)
|
||||
info = nonce.three_d_secure_info
|
||||
if info is None:
|
||||
if info is None or not info.liability_shifted:
|
||||
return False,0
|
||||
|
||||
amount = data['amount']
|
||||
@@ -138,7 +138,7 @@ def update_subscription(rower,data,method='up'):
|
||||
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:
|
||||
if info is None or not info.liability_shifted:
|
||||
return False,0
|
||||
amount = data['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 = gateway.payment_method_nonce.find(nonce_from_the_client)
|
||||
info = nonce.three_d_secure_info
|
||||
if info is None:
|
||||
if info is None or not info.liability_shifted:
|
||||
return False,0
|
||||
amount = data['amount']
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<script>
|
||||
var form = document.querySelector('#payment-form');
|
||||
var hiddenNonceInput = document.querySelector('#nonce');
|
||||
var paymenterrordiv = document.getElementById("paymenterror");
|
||||
var client_token = '{{ client_token }}';
|
||||
braintree.dropin.create({
|
||||
authorization: client_token,
|
||||
@@ -28,7 +29,8 @@
|
||||
} else {
|
||||
// Decide if you will force the user to enter a different
|
||||
// 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() {
|
||||
$(this).find("button[type='submit']").prop('disabled',true);
|
||||
console.log("disabled");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
{% extends "newbase.html" %}
|
||||
{% block title %}Rowsandall Paid Membership{% endblock title %}
|
||||
{% load rowerfilters %}
|
||||
|
||||
|
||||
{% block main %}
|
||||
|
||||
<div id="paymenterror">
|
||||
</div>
|
||||
|
||||
<h1>Confirm Your Payment</h1>
|
||||
|
||||
<h2>Order Overview</h2>
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
{% load rowerfilters %}
|
||||
{% block main %}
|
||||
|
||||
<div id="paymenterror">
|
||||
</div>
|
||||
|
||||
<h1>Confirm Your Payment</h1>
|
||||
|
||||
<h2>Order Overview</h2>
|
||||
|
||||
Reference in New Issue
Block a user