get() public method

public get ( $path )
コード例 #1
0
 /**
  * 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.');
     }
 }
コード例 #2
0
 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');
 }