You are here

public static function Braintree_Subscription::find in Commerce Braintree 7

4 calls to Braintree_Subscription::find()
Braintree_SubscriptionTest::testErrorsOnFindWithBlankArgument in braintree_php/tests/unit/SubscriptionTest.php
Braintree_SubscriptionTest::testErrorsOnFindWithWhitespaceArgument in braintree_php/tests/unit/SubscriptionTest.php
Braintree_SubscriptionTest::testFind in braintree_php/tests/integration/SubscriptionTest.php
Braintree_SubscriptionTest::testFind_throwsIfNotFound in braintree_php/tests/integration/SubscriptionTest.php

File

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

Class

Braintree_Subscription
Braintree Subscription module

Code

public static function find($id) {
  self::_validateId($id);
  try {
    $response = Braintree_Http::get('/subscriptions/' . $id);
    return self::factory($response['subscription']);
  } catch (Braintree_Exception_NotFound $e) {
    throw new Braintree_Exception_NotFound('subscription with id ' . $id . ' not found');
  }
}