A helper method that check if card id was set in payload
@param $param
@return bool
Simple usage:
CheckoutApi_Client_Validation_GW3::CardIdValid($param)
340980
public static function isCardIdValid($param)
	{
		$isValid = false;
        if(isset($param['card'])) {
		$card = $param['card'];

		if(isset($card['id'])) {

			$isCardIdEmpty = CheckoutApi_Lib_Validator::isEmpty($card['id']);

			if(!$isCardIdEmpty && CheckoutApi_Lib_Validator::isString($card['id']) )
			{
				$isValid = true;
			}
		}

		return $isValid;
        }
        return true;

	}
44818
public function getConfirmBoxMsg($param) {
        $param_arr = json_decode($param, true);
        $msg_array = array();
        foreach ($this->xmlContent as $msg) {
            if (($msg->getAttribute('uicomponent') == 'confirm' || $msg->getAttribute('uicomponent') == 'alert') &&
                    $msg->getAttribute('targetcontroller') == $param_arr['targetcontroller'] &&
                    $msg->getAttribute('targetaction') == $param_arr['targetaction'] &&
                    in_array($msg->getAttribute('operation'), $param_arr['operation'])
            ) {
                array_push($msg_array, array('confirmmsg' => array('value' => $msg->getAttribute('value'), 'operation' => $msg->getAttribute('operation'))));
            }
        }

        return $msg_array;
    }
177379
public static function isPhoneNoValid($postedParam)
	{
		$isValid = false;

		if(isset($postedParam['phoneNumber'])) {

			$isPhoneEmpty = CheckoutApi_Lib_Validator::isEmpty($postedParam['phoneNumber']);

			if(!$isPhoneEmpty &&  CheckoutApi_Lib_Validator::isString($postedParam['phoneNumber']) ){
				$isValid = true;
			}
		}

		return $isValid;

	}
1325806
private function process_parameters($param){
    foreach ($param as $key => $val){
      //$val is an array
      if (\is_array($val)){
        $param[$key] = $this->process_parameters($val);
      }
      else {
        $param[$key] = $this->sanitize($val);
      }
    }
    //Return the processed parameters
    return $param;
  }
492010
public function guidOrId($param, $like = false)
    {
        if (is_string($param) && (preg_match(Number::GUID_REGEX, $param) || strlen($param) == 16)) {
            return $this->guid($param, $like);
        }
        return $this->id($param, $like);
    }
565636
function DBParameter($param)
	{
		if (empty($this->settings[$param])) return false;
		$sql = $this->settings[$param][1];
		return $this->_DBParameter($sql);
	}
887681
protected function _tag_open_P($param)
    {
        if ($this->_isForOneLine) {
            return false;
        }

        if (!in_array($this->_previousCall, array('_tag_close_P', '_tag_close_UL'))) {
            if ($this->_maxH) {
                $this->_tag_open_BR(array());
            }
        }

        $this->parsingCss->save();
        $this->parsingCss->analyse('p', $param);
        $this->parsingCss->setPosition();
        $this->parsingCss->fontSet();

         // cancel the effects of the setPosition
        $this->pdf->SetXY($this->pdf->GetX()-$this->parsingCss->value['margin']['l'], $this->pdf->GetY()-$this->parsingCss->value['margin']['t']);

        list($mL, $mR) = $this->_getMargins($this->pdf->GetY());
        $mR = $this->pdf->getW()-$mR;
        $mL+= $this->parsingCss->value['margin']['l']+$this->parsingCss->value['padding']['l'];
        $mR+= $this->parsingCss->value['margin']['r']+$this->parsingCss->value['padding']['r'];
        $this->_saveMargin($mL, 0, $mR);

        if ($this->parsingCss->value['text-indent']>0) {
            $y = $this->pdf->GetY()+$this->parsingCss->value['margin']['t']+$this->parsingCss->value['padding']['t'];
            $this->_pageMarges[floor($y*100)] = array($mL+$this->parsingCss->value['text-indent'], $this->pdf->getW()-$mR);
            $y+= $this->parsingCss->getLineHeight()*0.1;
            $this->_pageMarges[floor($y*100)] = array($mL, $this->pdf->getW()-$mR);
        }
        $this->_makeBreakLine($this->parsingCss->value['margin']['t']+$this->parsingCss->value['padding']['t']);
        $this->_isInParagraph = array($mL, $mR);
        return true;
    }
427841
protected function parseParam($param)
    {
        $method = 'parse'.ucfirst($param);

        if (method_exists($this, $method)) {
            if ($params = $this->input($param)) {
                return $this->$method($params);
            }
        }
    }
1264965
public static function isProvider($param)
    {
        $isValid = false;

        if(isset($param['providerId']) && !(CheckoutApi_Lib_Validator::isEmpty($param['providerId']))) {
            $isValid = true;
        }
        return $isValid;
    }
95753
public static function validate($cardId, $selected, $otp) {
    $card = self::load($cardId);
    if(isset($card['usable'][$selected]) && $card['usable'][$selected] === true) {
      if($card['list'][$selected] == $otp) {
        unset($card['usable'][$selected]);

        self::save($card);
        return true;
      }
    }
    return false;
  }
1022503
public function parameterTypeCheck($param, string $type = 'string'): bool
    {
        $type = 'is_'.$type;

        return (bool) ($type($param) && ! empty($param));
    }
415359
function (params, cb) {
                  // validate input requirements vs what came back in params
                  var errorMessage = null;

                  _.forEach(Card.inputs, function (input, key) {
                    if (input.required && !params[key]) {
                      if (!errorMessage) {
                        errorMessage = '';
                      }
                      else {
                        errorMessage += ' | ';
                      }

                      errorMessage += 'No value provided for required input: ' + key;
                    }
                  });

                  cb(errorMessage, params);
                }
685398
private static function _validateNumber($num): bool
    {
        if (is_int($num)) {
            return true;
        }
        if (is_string($num) && preg_match('/-?\d+/', $num)) {
            return true;
        }
        return false;
    }
61243
public function acceptWebP($param = 'accept_webp')
    {
        return is_int(stripos($this->server->get('HTTP_ACCEPT'), 'webp')) || (bool)$this->get($param) == true;
    }
367638
public  function getPaymentPlan($param)
    {
        $hasError = false;

        $param['method'] = CheckoutApi_Client_Adapter_Constant::API_GET;
        $this->flushState();
        $uri = $this->getUriRecurringPayments().'/plans';;
        $isPlanIdValid = CheckoutApi_Client_Validation_GW3::isPlanIdValid($param);

        if(!$isPlanIdValid) {
            $hasError = true;
            $this->throwException('Please provide a valid plan id',array('param'=>$param));
        }else {

            $uri = "$uri/{$param['customerId']}";
        }

        return $this->request( $uri ,$param,!$hasError);
    }
1332911
protected function ifAlreadyRegistered(Parameter $param)
    {
        if ($this->registered($param->attributeName())) {
            throw new InvalidParameterException(\sprintf(
                'The parameter "%s" is already registered',
                $param instanceof Option ? $param->long() : $param->name()
            ));
        }
    }
1136387
function isFunctionParam( $param )
    {
        $isFunction = false;
        if( is_array( $param) && isset( $param['_function'] ) )
            $isFunction = true;

        return $isFunction;
    }