code: public static function isValid($action, $throw = false)
      {
          if (in_array($action, static::getActions(), true)) {
              return true;
          }
  
          if ($throw) {
              throw new InvalidArgumentException("Unknown gateway action '$action'.");
          }
  
          return false;
      }
docs: Returns whether the given action is valid.
  
  @param string $action
  @param bool   $throw
  
  @return bool