code: public function validate()
      {
          foreach (func_get_args() as $key) {
              $value = $this->parameters->get($key);
              if (! isset($value)) {
                  throw new InvalidRequestException("The $key parameter is required");
              }
          }
      }
docs: Validate the request.
  
  This method is called internally by gateways to avoid wasting time with an API call
  when the request is clearly invalid.
  
  @param string ... a variable length list of required parameters
  @throws InvalidRequestException