def search_by_name(name, states=["NSW"], postcode="ALL")

      begin
        client = Savon.client(self.client_options)
        request = {
          externalNameSearch: {
            authenticationGuid: self.guid, name: name,
            filters: {
              nameType: {
                tradingName: "Y", legalName: "Y"
              },
              postcode: postcode,
              "stateCode" => {
                "QLD" => states.include?("QLD") ? "Y" : "N",
                "NT" => states.include?("NT") ? "Y" : "N",
                "SA" => states.include?("SA") ? "Y" : "N",
                "WA" => states.include?("WA") ? "Y" : "N",
                "VIC" => states.include?("VIC") ? "Y" : "N",
                "ACT" => states.include?("ACT") ? "Y" : "N",
                "TAS" => states.include?("TAS") ? "Y" : "N",
                "NSW" => states.include?("NSW") ? "Y" : "N"
              }
            }
          },
          authenticationGuid: self.guid
        }

        response = client.call(:abr_search_by_name, message: request)
        result_list = response.body[:abr_search_by_name_response][:abr_payload_search_results][:response][:search_results_list]

        if result_list.empty?
          return []
        else
          results = response.body[:abr_search_by_name_response][:abr_payload_search_results][:response][:search_results_list][:search_results_record]
          return [parse_search_result(results)] if !results.is_a?(Array)
          return results.map do |r| parse_search_result(r) end
        end
      rescue => ex
        self.errors << ex.to_s
      end
    end
def search_by_name(name, states=["NSW"], postcode="ALL")

      begin
        client = Savon.client(self.client_options)
        request = {
          externalNameSearch: {
            authenticationGuid: self.guid, name: name,
            filters: {
              nameType: {
                tradingName: "Y", legalName: "Y"
              },
              postcode: postcode,
              "stateCode" => {
                "QLD" => states.include?("QLD") ? "Y" : "N",
                "NT" => states.include?("NT") ? "Y" : "N",
                "SA" => states.include?("SA") ? "Y" : "N",
                "WA" => states.include?("WA") ? "Y" : "N",
                "VIC" => states.include?("VIC") ? "Y" : "N",
                "ACT" => states.include?("ACT") ? "Y" : "N",
                "TAS" => states.include?("TAS") ? "Y" : "N",
                "NSW" => states.include?("NSW") ? "Y" : "N"
              }
            }
          },
          authenticationGuid: self.guid
        }

        response = client.call(:abr_search_by_name, message: request)
        result_list = response.body[:abr_search_by_name_response][:abr_payload_search_results][:response][:search_results_list]

        if result_list.empty?
          return []
        else
          results = response.body[:abr_search_by_name_response][:abr_payload_search_results][:response][:search_results_list][:search_results_record]
          return [parse_search_result(results)] if !results.is_a?(Array)
          return results.map do |r| parse_search_result(r) end
        end
      rescue => ex
        self.errors << ex.to_s
      end
    end
Searches the ABR registry by name. Simply pass in the search term and which state(s) to search in.

 @param [String] name - the search term
 @param [Array] states - a list of states that you wish to filter by
 @param [String] postcode - the postcode you wish to filter by
 @return [Array] search results in an array