You are here

public static function Braintree_Customer::fetch in Commerce Braintree 7

File

braintree_php/lib/Braintree/Customer.php, line 49

Class

Braintree_Customer
Creates and manages Customers

Code

public static function fetch($query, $ids) {
  $criteria = array();
  foreach ($query as $term) {
    $criteria[$term->name] = $term
      ->toparam();
  }
  $criteria["ids"] = Braintree_CustomerSearch::ids()
    ->in($ids)
    ->toparam();
  $response = braintree_http::post('/customers/advanced_search', array(
    'search' => $criteria,
  ));
  return braintree_util::extractattributeasarray($response['customers'], 'customer');
}