You are here

public static function Braintree_Subscription::search in Commerce Braintree 7

21 calls to Braintree_Subscription::search()
Braintree_MultipleValueNodeTest::testIn_multipleValues in braintree_php/tests/integration/MultipleValueNodeTest.php
Braintree_MultipleValueNodeTest::testIn_singleValue in braintree_php/tests/integration/MultipleValueNodeTest.php
Braintree_MultipleValueNodeTest::testIs in braintree_php/tests/integration/MultipleValueNodeTest.php
Braintree_MultipleValueNodeTest::testSearch_statusIsExpired in braintree_php/tests/integration/MultipleValueNodeTest.php
Braintree_SubscriptionSearchTest::testSearch_billingCyclesRemaing in braintree_php/tests/integration/SubscriptionSearchTest.php

... See full list

File

braintree_php/lib/Braintree/Subscription.php, line 53

Class

Braintree_Subscription
Braintree Subscription module

Code

public static function search($query) {
  $criteria = array();
  foreach ($query as $term) {
    $criteria[$term->name] = $term
      ->toparam();
  }
  $response = braintree_http::post('/subscriptions/advanced_search_ids', array(
    'search' => $criteria,
  ));
  $pager = array(
    'className' => __CLASS__,
    'classMethod' => 'fetch',
    'methodArgs' => array(
      $query,
    ),
  );
  return new Braintree_ResourceCollection($response, $pager);
}