Add check for existing key index in table
[civicrm-core.git] / CRM / Core / Payment.php
index c88aad8f564cce29ecc4439b6cf9672af1a1bf21..0bfe0c2d2ec4788790076f2a2687c836e0d2abfa 100644 (file)
@@ -791,8 +791,16 @@ abstract class CRM_Core_Payment {
         'attributes' => array(
           'size' => 4,
           'maxlength' => 4,
+          'minlength' => 4,
           'autocomplete' => 'off',
         ),
+        'rules' => array(
+          array(
+            'rule_message' => ts('Please enter valid last 4 digit card number.'),
+            'rule_name' => 'numeric',
+            'rule_parameters' => NULL,
+          ),
+        ),
       ),
     );
   }