From 8ccce14a8610e15e2507d4ba099bbdb62985149d Mon Sep 17 00:00:00 2001 From: eileenmcnaugton Date: Sun, 16 Aug 2015 07:48:57 +1200 Subject: [PATCH] CRM-16808 follow up - paypal express being validated as paypal pro --- CRM/Core/Payment/PayPalImpl.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CRM/Core/Payment/PayPalImpl.php b/CRM/Core/Payment/PayPalImpl.php index 72e86d23e9..0af967fd7d 100644 --- a/CRM/Core/Payment/PayPalImpl.php +++ b/CRM/Core/Payment/PayPalImpl.php @@ -155,6 +155,21 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { return TRUE; } + /** + * 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. + * + * @param array $values + * @param array $errors + */ + public function validatePaymentInstrument($values, &$errors) { + if ($this->_paymentProcessor['payment_processor_type'] == 'PayPal_Pro') { + CRM_Core_Payment_Form::validateCreditCard($values, $errors); + } + } + /** * Express checkout code. Check PayPal documentation for more information * -- 2.25.1