public function validatePaymentInstrument($values, &$errors) {
CRM_Core_Form::validateMandatoryFields($this->getMandatoryFields(), $values, $errors);
if ($this->_paymentProcessor['payment_type'] == 1) {
- CRM_Core_Payment_Form::validateCreditCard($this->_paymentProcessor['id'], $values, $errors);
+ CRM_Core_Payment_Form::validateCreditCard($values, $errors, $this->_paymentProcessor['id']);
}
}
* Make sure that credit card number and cvv are valid.
* Called within the scope of a QF formRule function
*
- * @param int $processorID
* @param array $values
* @param array $errors
+ * @param int $processorID
*/
- public static function validateCreditCard($processorID = NULL, $values, &$errors) {
+ public static function validateCreditCard($values, &$errors, $processorID = NULL) {
if (!empty($values['credit_card_type']) || !empty($values['credit_card_number'])) {
if (!empty($values['credit_card_type'])) {
$processorCards = CRM_Financial_BAO_PaymentProcessor::getCreditCards($processorID);
*/
public function validatePaymentInstrument($values, &$errors) {
if ($this->_paymentProcessor['payment_processor_type'] == 'PayPal' && !$this->isPaypalExpress($values)) {
- CRM_Core_Payment_Form::validateCreditCard($this->_paymentProcessor['id'], $values, $errors);
+ CRM_Core_Payment_Form::validateCreditCard($values, $errors, $this->_paymentProcessor['id']);
CRM_Core_Form::validateMandatoryFields($this->getMandatoryFields(), $values, $errors);
}
}