diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index ee25a938677f..6d9bee416874 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -366,7 +366,7 @@ public function getPreApprovalDetails($storedDetails) { 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']); } } diff --git a/CRM/Core/Payment/Form.php b/CRM/Core/Payment/Form.php index 8101efd0bae5..905e4a68a3f4 100644 --- a/CRM/Core/Payment/Form.php +++ b/CRM/Core/Payment/Form.php @@ -326,11 +326,11 @@ public static function setDefaultValues(&$form, $contactID) { * 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); diff --git a/CRM/Core/Payment/PayPalImpl.php b/CRM/Core/Payment/PayPalImpl.php index 8ddcff0939c8..104253729131 100644 --- a/CRM/Core/Payment/PayPalImpl.php +++ b/CRM/Core/Payment/PayPalImpl.php @@ -176,7 +176,7 @@ protected function supportsRecurContributionsForPledges() { */ 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); } }