diff --git a/assets/js/checkPay.js b/assets/js/checkPay.js index 40f9982..0d5bd9d 100644 --- a/assets/js/checkPay.js +++ b/assets/js/checkPay.js @@ -7,7 +7,10 @@ const regExpr = /^([A-Za-zÁÉÍÓÚñáéíóúÑ]{0}?[A-Za-zÁÉÍÓÚñáéíóúÑ\']+[\s])+([A-Za-zÁÉÍÓÚñáéíóúÑ]{0}?[A-Za-zÁÉÍÓÚñáéíóúÑ\'])+[\s]?([A-Za-zÁÉÍÓÚñáéíóúÑ]{0}?[A-Za-zÁÉÍÓÚñáéíóúÑ\'])?$/g; //Expresión regular para validar un código promocional: -const refExprCode = /^0?[xX]?[0-9a-fA-F]*$/; +const regExprCode = /^0?[xX]?[0-9a-fA-F]*$/; + +//Fecha acutal: +const fecha = new Date(); $(document).ready(function() { @@ -33,7 +36,7 @@ $(document).ready(function() { const cardHolder = $("#card-holder"); cardHolder[0].setCustomValidity(""); - if(cardHolder.val().length > 5 && holderCheck(cardHolder.val())){ + if(cardHolder.val().length > 5 && !holderCheck(cardHolder.val())){ $("#cardNameValid").show(); $("#cardNameInvalid").hide(); cardHolder[0].setCustomValidity(""); diff --git a/purchase/includes/formPurchase.php b/purchase/includes/formPurchase.php index 4db5923..561ec8a 100644 --- a/purchase/includes/formPurchase.php +++ b/purchase/includes/formPurchase.php @@ -125,7 +125,7 @@ class FormPurchase extends Form {
".$errorCVV."

-
".$errorCardExpirationMonth.$errorCardExpirationYear."

+
".$errorCardExpirationMonth.$errorCardExpirationYear."

@@ -167,7 +167,9 @@ class FormPurchase extends Form { } $month = $this->test_input($datos['card-expiration-month']) ?? null; - if ( empty($month) ) { + //$TODAY = getdate(); + //$actualMonth = "$TODAY[month]"; + if ( empty($month) /*|| $month < $actualMonth*/) { $result['card-expiration-month'] = "El mes de expiración no es correcto."; }