public function setCardNumber($number)
    {
        $number = preg_replace('/[^\d]/', '', $number);

        if(strlen($number) > 20)
        {
            throw new ErrorException('Card number longer than twenty (20) digits');
        }

        $this->cardNumber = $number;

        return $this;
    }
public function setCardNumber($number)
    {
        $number = preg_replace('/[^\d]/', '', $number);

        if(strlen($number) > 20)
        {
            throw new ErrorException('Card number longer than twenty (20) digits');
        }

        $this->cardNumber = $number;

        return $this;
    }
public function setCardNumber ( $ number ) { $ number = preg_replace ( '/[^\d]/' , '' , $ number ) ; if ( strlen ( $ number ) > 20 ) { throw new ErrorException ( 'Card number longer than twenty (20) digits' ) ; } $ this -> cardNumber = $ number ; return $ this ; }
Sets the card number.

@param $number string The card number
@return eway
@throws ErrorException
Sets the card number .