mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Fixes for WePay Credit Card form
This commit is contained in:
parent
ce656c213f
commit
c178e883f7
File diff suppressed because one or more lines are too long
@ -18,7 +18,7 @@
|
|||||||
"/js/clients/linkify-urls.js": "/js/clients/linkify-urls.js?id=dd6a49267dfe156c3bc9",
|
"/js/clients/linkify-urls.js": "/js/clients/linkify-urls.js?id=dd6a49267dfe156c3bc9",
|
||||||
"/js/clients/payments/braintree-credit-card.js": "/js/clients/payments/braintree-credit-card.js?id=a334dd9257dd510a1feb",
|
"/js/clients/payments/braintree-credit-card.js": "/js/clients/payments/braintree-credit-card.js?id=a334dd9257dd510a1feb",
|
||||||
"/js/clients/payments/braintree-paypal.js": "/js/clients/payments/braintree-paypal.js?id=37950e8a39281d2f596a",
|
"/js/clients/payments/braintree-paypal.js": "/js/clients/payments/braintree-paypal.js?id=37950e8a39281d2f596a",
|
||||||
"/js/clients/payments/wepay-credit-card.js": "/js/clients/payments/wepay-credit-card.js?id=4cca92fb8fca891d9376",
|
"/js/clients/payments/wepay-credit-card.js": "/js/clients/payments/wepay-credit-card.js?id=46a2e42f062134310b3a",
|
||||||
"/js/clients/payment_methods/wepay-bank-account.js": "/js/clients/payment_methods/wepay-bank-account.js?id=8328c6c32a65cd3e8a3d",
|
"/js/clients/payment_methods/wepay-bank-account.js": "/js/clients/payment_methods/wepay-bank-account.js?id=8328c6c32a65cd3e8a3d",
|
||||||
"/js/clients/payments/paytrace-credit-card.js": "/js/clients/payments/paytrace-credit-card.js?id=59d9913b746fe5a540ff",
|
"/js/clients/payments/paytrace-credit-card.js": "/js/clients/payments/paytrace-credit-card.js?id=59d9913b746fe5a540ff",
|
||||||
"/js/clients/payments/mollie-credit-card.js": "/js/clients/payments/mollie-credit-card.js?id=c2cf632fb3cc91b4ff7c",
|
"/js/clients/payments/mollie-credit-card.js": "/js/clients/payments/mollie-credit-card.js?id=c2cf632fb3cc91b4ff7c",
|
||||||
|
@ -32,39 +32,31 @@ class WePayCreditCard {
|
|||||||
this.errors.textContent = "Cardholder name required.";
|
this.errors.textContent = "Cardholder name required.";
|
||||||
this.errors.hidden = false;
|
this.errors.hidden = false;
|
||||||
|
|
||||||
return false;
|
return;
|
||||||
} else if (this.myCard.CardJs('cardNumber').replace(/[^\d]/g, '') === "") {
|
} else if (this.myCard.CardJs('cardNumber').replace(/[^\d]/g, '') === "") {
|
||||||
document.getElementById('card_number').focus();
|
document.getElementById('card_number').focus();
|
||||||
this.errors.textContent = "Card number required.";
|
this.errors.textContent = "Card number required.";
|
||||||
this.errors.hidden = false;
|
this.errors.hidden = false;
|
||||||
|
|
||||||
return false;
|
return;
|
||||||
} else if (this.myCard.CardJs('cvc').replace(/[^\d]/g, '') === "") {
|
} else if (this.myCard.CardJs('cvc').replace(/[^\d]/g, '') === "") {
|
||||||
document.getElementById('cvv').focus();
|
document.getElementById('cvv').focus();
|
||||||
this.errors.textContent = "CVV number required.";
|
this.errors.textContent = "CVV number required.";
|
||||||
this.errors.hidden = false;
|
this.errors.hidden = false;
|
||||||
|
|
||||||
return false;
|
return;
|
||||||
} else if (this.myCard.CardJs('expiryMonth').replace(/[^\d]/g, '') === "") {
|
} else if (this.myCard.CardJs('expiryMonth').replace(/[^\d]/g, '') === "") {
|
||||||
|
// document.getElementById('expiry_month').focus();
|
||||||
this.errors.textContent = "Expiry Month number required.";
|
this.errors.textContent = "Expiry Month number required.";
|
||||||
this.errors.hidden = false;
|
this.errors.hidden = false;
|
||||||
|
|
||||||
return false;
|
return;
|
||||||
} else if (this.myCard.CardJs('expiryYear').replace(/[^\d]/g, '') === "") {
|
} else if (this.myCard.CardJs('expiryYear').replace(/[^\d]/g, '') === "") {
|
||||||
|
// document.getElementById('expiry_year').focus();
|
||||||
this.errors.textContent = "Expiry Year number required.";
|
this.errors.textContent = "Expiry Year number required.";
|
||||||
this.errors.hidden = false;
|
this.errors.hidden = false;
|
||||||
|
|
||||||
return false;
|
return;
|
||||||
}else if (document.querySelector('input[name="expiry-year"]').value === "") {
|
|
||||||
this.errors.textContent = "Expiry Year number required.";
|
|
||||||
this.errors.hidden = false;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}else if (document.querySelector('input[name="expiry-month"]').value === "") {
|
|
||||||
this.errors.textContent = "Expiry Month number required.";
|
|
||||||
this.errors.hidden = false;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -117,10 +109,11 @@ class WePayCreditCard {
|
|||||||
|
|
||||||
completePaymentWithoutToken() {
|
completePaymentWithoutToken() {
|
||||||
if (!this.validateCreditCardFields()) {
|
if (!this.validateCreditCardFields()) {
|
||||||
this.payNowButton = document.getElementById('pay-now');
|
|
||||||
this.payNowButton.disabled = false;
|
document.getElementById('pay-now').disabled = false;
|
||||||
this.payNowButton.querySelector('svg').classList.add('hidden');
|
document.querySelector('#pay-now > svg').classList.add('hidden');
|
||||||
this.payNowButton.querySelector('span').classList.remove('hidden');
|
document.querySelector('#pay-now > span').classList.remove('hidden');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user