Skip to content
Snippets Groups Projects
Commit 15c6517d authored by colemanw's avatar colemanw
Browse files

CRM-13475 Fix credit-card error messages

----------------------------------------
* CRM-13475: Entering an invalid credit card number gives the wrong field validation error
  http://issues.civicrm.org/jira/browse/CRM-13475
parent 5840b63d
No related branches found
No related tags found
No related merge requests found
......@@ -182,7 +182,7 @@ class CRM_Core_Payment_Form {
'title' => ts('Card Type'),
'cc_field' => TRUE,
'attributes' => $creditCardType,
'is_required' => TRUE,
'is_required' => FALSE,
);
}
......@@ -237,7 +237,7 @@ class CRM_Core_Payment_Form {
/**
* Function to add all the credit card fields
*
* @return None
* @return void
* @access public
*/
static function buildCreditCard(&$form, $useRequired = FALSE) {
......@@ -363,6 +363,9 @@ class CRM_Core_Payment_Form {
$errors['cvv2'] = ts('Please enter a valid Credit Card Verification Number');
}
}
elseif (!empty($values['credit_card_number'])) {
$errors['credit_card_number'] = ts('Please enter a valid Credit Card Number and Type');
}
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment