You are here

public static function Braintree_Transaction::fetch in Commerce Braintree 7

File

braintree_php/lib/Braintree/Transaction.php, line 407

Class

Braintree_Transaction
Creates and manages transactions

Code

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