You are here

public static function Braintree_Customer::find in Commerce Braintree 7

find a customer by id

@access public

Parameters

string id customer Id:

Return value

object Braintree_Customer

Throws

Braintree_Exception_NotFound

7 calls to Braintree_Customer::find()
Braintree_CustomerTest::testDelete_deletesTheCustomer in braintree_php/tests/integration/CustomerTest.php
Braintree_CustomerTest::testFind in braintree_php/tests/integration/CustomerTest.php
Braintree_CustomerTest::testFindErrorsOnBlankId in braintree_php/tests/unit/CustomerTest.php
Braintree_CustomerTest::testFindErrorsOnWhitespaceId in braintree_php/tests/unit/CustomerTest.php
Braintree_CustomerTest::testFind_throwsExceptionIfNotFound in braintree_php/tests/integration/CustomerTest.php

... See full list

File

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

Class

Braintree_Customer
Creates and manages Customers

Code

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