CRM-17256 don't validate cc fields if token has been entered
authoreileenmcnaugton <eileen@fuzion.co.nz>
Tue, 13 Oct 2015 13:15:27 +0000 (02:15 +1300)
committereileenmcnaugton <eileen@fuzion.co.nz>
Tue, 13 Oct 2015 13:15:27 +0000 (02:15 +1300)
CRM/Core/Payment/PayPalImpl.php

index 8e5d0bbc15d4626b496af09ce3c792c5befe6aa0..4f12885ea87052c10308b2effd799472ba40ce46 100644 (file)
@@ -175,7 +175,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment {
    * @param array $errors
    */
   public function validatePaymentInstrument($values, &$errors) {
-    if ($this->_paymentProcessor['payment_processor_type'] == 'PayPal') {
+    if ($this->_paymentProcessor['payment_processor_type'] == 'PayPal' && empty($values['token'])) {
       CRM_Core_Payment_Form::validateCreditCard($values, $errors);
       CRM_Core_Form::validateMandatoryFields($this->getMandatoryFields(), $values, $errors);
     }