public function search($query)
{
$criteria = [];
foreach ($query as $term) {
$criteria[$term->name] = $term->toparam();
}
$path = $this->_config->merchantPath() . '/transactions/advanced_search_ids';
$response = $this->_http->post($path, ['search' => $criteria]);
if (array_key_exists('searchResults', $response)) {
$pager = ['object' => $this, 'method' => 'fetch', 'methodArgs' => [$query]];
return new ResourceCollection($response, $pager);
} else {
throw new Exception\DownForMaintenance();
}
}