Braintree\Http::get PHP Method

get() public method

public get ( $path )
    public function get($path)
    {
        $response = $this->_doRequest('GET', $path);
        if ($response['status'] === 200) {
            return Xml::buildArrayFromXml($response['body']);
        } else {
            Util::throwStatusCodeException($response['status']);
        }
    }

Usage Example

 /**
  * 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.');
     }
 }
All Usage Examples Of Braintree\Http::get