/** * find an address by id * * Finds the address with the given <b>addressId</b> that is associated * to the given <b>customerOrId</b>. * If the address cannot be found, a NotFound exception will be thrown. * * * @access public * @param mixed $customerOrId * @param string $addressId * @return object Address * @throws Exception\NotFound */ public function find($customerOrId, $addressId) { $customerId = $this->_determineCustomerId($customerOrId); $this->_validateId($addressId); try { $path = $this->_config->merchantPath() . '/customers/' . $customerId . '/addresses/' . $addressId; $response = $this->_http->get($path); return Address::factory($response['address']); } catch (Exception\NotFound $e) { throw new Exception\NotFound('address for customer ' . $customerId . ' with id ' . $addressId . ' not found.'); } }
public function testSandboxSSL() { try { Braintree\Configuration::environment('sandbox'); $this->setExpectedException('Braintree\\Exception\\Authentication'); $http = new Braintree\Http(Braintree\Configuration::$global); $http->get('/'); } catch (Braintree\Exception $e) { Braintree\Configuration::environment('development'); throw $e; } Braintree\Configuration::environment('development'); }