if (!empty($self->_paymentFields)) {
CRM_Core_Form::validateMandatoryFields($self->_paymentFields, $fields, $errors);
}
- CRM_Core_Payment_Form::validatePaymentInstrument($fields, $errors, $self);
+ CRM_Core_Payment_Form::validateCreditCard($fields, $errors);
foreach (CRM_Contact_BAO_Contact::$_greetingTypes as $greeting) {
if ($greetingType = CRM_Utils_Array::value($greeting, $fields)) {
CRM_Core_Form::validateMandatoryFields($self->_fields, $fields, $errors);
// make sure that credit card number and cvv are valid
- CRM_Core_Payment_Form::validatePaymentInstrument($fields, $errors, $self);
+ CRM_Core_Payment_Form::validateCreditCard($fields, $errors);
return empty($errors) ? TRUE : $errors;
}
return FALSE;
}
- /**
- * Default payment instrument validation
- * Implement the usual Luhn algorithm via a static function in the CRM_Core_Payment_Form if it's a credit card
- * Not a static function, because I need to check for payment_type
- */
- public function validatePaymentInstrument($values, &$errors) {
- if ($this->_paymentProcessor['payment_type'] == 1) {
- CRM_Core_Payment_Form::validateCreditCard($values, $errors);
- }
- }
-
/**
* Setter for the payment form that wants to use the processor
*
}
}
- /**
- * Validate the payment instrument values before passing it to the payment processor
- * We want this to be overrideable by the payment processor, and default to using
- * this object's validCreditCard for credit cards (implemented as the default in the Payment class).
- */
- public function validatePaymentInstrument($values, &$errors, $form) {
- $paymentProcessor = CRM_Financial_BAO_PaymentProcessor::getPayment($values['payment_processor'],'live');
- $payment = CRM_Core_Payment::singleton('live', $paymentProcessor, $form);
- $payment->validatePaymentInstrument($values, $errors);
- }
-
/**
* The credit card pseudo constant results only the CC label, not the key ID
* So we normalize the name to use it as a CSS class.
CRM_Core_Form::validateMandatoryFields($self->_fields, $fields, $errors);
// make sure that credit card number and cvv are valid
- CRM_Core_Payment_Form::validatePaymentInstrument($fields, $errors, $self);
+ CRM_Core_Payment_Form::validateCreditCard($fields, $errors);
}
return empty($errors) ? TRUE : $errors;
if (!empty($values['payment_processor_id'])) {
// make sure that credit card number and cvv are valid
- CRM_Core_Payment_Form::validatePaymentInstrument($values, $errorMsg, $self);
+ CRM_Core_Payment_Form::validateCreditCard($values, $errorMsg);
}
if (!empty($values['record_contribution'])) {
CRM_Core_Form::validateMandatoryFields($self->_fields, $fields, $errors);
// make sure that credit card number and cvv are valid
- CRM_Core_Payment_Form::validatePaymentInstrument($self->_params[0], $errors, $self);
+ CRM_Core_Payment_Form::validateCreditCard($self->_params[0], $errors);
if ($errors) {
return FALSE;
if (!empty($self->_paymentFields)) {
CRM_Core_Form::validateMandatoryFields($self->_paymentFields, $fields, $errors);
}
- CRM_Core_Payment_Form::validatePaymentInstrument($fields, $errors, $self);
+ CRM_Core_Payment_Form::validateCreditCard($fields, $errors);
}
foreach (CRM_Contact_BAO_Contact::$_greetingTypes as $greeting) {
if (!empty($params['payment_processor_id'])) {
// make sure that credit card number and cvv are valid
- CRM_Core_Payment_Form::validatePaymentInstrument($params, $errors, $self);
+ CRM_Core_Payment_Form::validateCreditCard($params, $errors);
}
$joinDate = NULL;