Private
Public Access
1
0

fixing some bugs

This commit is contained in:
Sander Roosendaal
2019-07-25 15:49:06 +02:00
parent 9f98bf9b6d
commit 92f5ee76e5
4 changed files with 7 additions and 3 deletions

View File

@@ -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();
}
});