Braintree\Http::delete PHP Method

delete() public method

public delete ( $path )
    public function delete($path)
    {
        $response = $this->_doRequest('DELETE', $path);
        if ($response['status'] === 200) {
            return true;
        } else {
            Util::throwStatusCodeException($response['status']);
        }
    }

Usage Example

 /**
  * delete an address by id
  *
  * @param mixed $customerOrId
  * @param string $addressId
  */
 public function delete($customerOrId = null, $addressId = null)
 {
     $this->_validateId($addressId);
     $customerId = $this->_determineCustomerId($customerOrId);
     $path = $this->_config->merchantPath() . '/customers/' . $customerId . '/addresses/' . $addressId;
     $this->_http->delete($path);
     return new Result\Successful();
 }