fixing some bugs
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
var form = document.querySelector('#payment-form');
|
||||
var hiddenNonceInput = document.querySelector('#nonce');
|
||||
var paymenterrordiv = document.getElementById("paymenterror");
|
||||
var paymenterrordiv2 = document.getElementById("paymenterror2");
|
||||
var client_token = '{{ client_token }}';
|
||||
braintree.dropin.create({
|
||||
authorization: client_token,
|
||||
@@ -33,13 +34,15 @@
|
||||
}
|
||||
if (payload.liabilityShifted || payload.type !== 'CreditCard') {
|
||||
document.querySelector('#nonce').value = payload.nonce;
|
||||
hiddenNonceInput.value = payload.nonce;
|
||||
hiddenNonceInput.value = payload.nonce;
|
||||
paymenterrordiv2.innerHTML = '<p class="successmessage">We are submitting the payment. Do not reload or press submit more than once.</p>';
|
||||
form.submit();
|
||||
} else {
|
||||
// Decide if you will force the user to enter a different
|
||||
// payment method if liablity was not shifted
|
||||
instance.clearSelectedPaymentMethod();
|
||||
paymenterrordiv.innerHTML = '<p class="message">3D Secure Card Verification Error. Please check your card details.</p>';
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
<div id="bt-dropin"></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div id="paymenterror2"> </div>
|
||||
<input type="hidden" id="nonce" name="payment_method_nonce" />
|
||||
<input type="hidden" id="plan" name="plan" value="{{ plan.id }}">
|
||||
<p>
|
||||
|
||||
Reference in New Issue
Block a user