public function validate(CreditCard $creditCard)
    {
        $this->errors       = array();
        $this->creditCard   = $creditCard;

        if ($this->context == self::CONTEXT_CREDITCARD) {
            $this->validateNumber();
            $this->validateExpiration();
            $this->validateVerificationValue();
            $this->validateBrand();
            $this->validateCardHolder();
        } elseif ($this->context == self::CONTEXT_TOKEN) {
            $this->validateToken();
        }

        return $this->errors;
    }
public function validate(CreditCard $creditCard)
    {
        $this->errors       = array();
        $this->creditCard   = $creditCard;

        if ($this->context == self::CONTEXT_CREDITCARD) {
            $this->validateNumber();
            $this->validateExpiration();
            $this->validateVerificationValue();
            $this->validateBrand();
            $this->validateCardHolder();
        } elseif ($this->context == self::CONTEXT_TOKEN) {
            $this->validateToken();
        }

        return $this->errors;
    }
public function validate ( CreditCard $ creditCard ) { $ this -> errors = array ( ) ; $ this -> creditCard = $ creditCard ; if ( $ this -> context == self :: CONTEXT_CREDITCARD ) { $ this -> validateNumber ( ) ; $ this -> validateExpiration ( ) ; $ this -> validateVerificationValue ( ) ; $ this -> validateBrand ( ) ; $ this -> validateCardHolder ( ) ; } elseif ( $ this -> context == self :: CONTEXT_TOKEN ) { $ this -> validateToken ( ) ; } return $ this -> errors ; }
Validates a CreditCard object.

@param CreditCard $creditCard
@return array
Validates a CreditCard object .