original_string: protected function getPayId($payment) {
  		if (!is_string($payment) and $payment instanceof Payment) {
  			$payment = $payment->getPayId();
  			if (!$payment) {
  				throw new Exception("Given Payment object does not have payId. Please call paymentInit() first.");
  			}
  		}
  		if (is_array($payment) and isset($payment["payId"])) {
  			$payment = $payment["payId"];
  		}
  		if (!is_string($payment) or strlen($payment) != 15) {
  			throw new Exception("Given Payment ID is not valid - it should be a string with length 15 characters.");
  		}
  		return $payment;
  	}
code: protected function getPayId($payment) {
  		if (!is_string($payment) and $payment instanceof Payment) {
  			$payment = $payment->getPayId();
  			if (!$payment) {
  				throw new Exception("Given Payment object does not have payId. Please call paymentInit() first.");
  			}
  		}
  		if (is_array($payment) and isset($payment["payId"])) {
  			$payment = $payment["payId"];
  		}
  		if (!is_string($payment) or strlen($payment) != 15) {
  			throw new Exception("Given Payment ID is not valid - it should be a string with length 15 characters.");
  		}
  		return $payment;
  	}
code_tokens: protected function getPayId ( $ payment ) { if ( ! is_string ( $ payment ) and $ payment instanceof Payment ) { $ payment = $ payment -> getPayId ( ) ; if ( ! $ payment ) { throw new Exception ( "Given Payment object does not have payId. Please call paymentInit() first." ) ; } } if ( is_array ( $ payment ) and isset ( $ payment [ "payId" ] ) ) { $ payment = $ payment [ "payId" ] ; } if ( ! is_string ( $ payment ) or strlen ( $ payment ) != 15 ) { throw new Exception ( "Given Payment ID is not valid - it should be a string with length 15 characters." ) ; } return $ payment ; }
docstring: Get payId as string and validate it.
  @ignore
  @param Payment|string|array $payment String, Payment object or array as returned from paymentInit call
  @return string
  @throws Exception
docstring_tokens: Get payId as string and validate it .