Braintree\Http::put PHP Method

put() public method

public put ( $path, $params = null )
    public function put($path, $params = null)
    {
        $response = $this->_doRequest('PUT', $path, $this->_buildXml($params));
        $responseCode = $response['status'];
        if ($responseCode === 200 || $responseCode === 201 || $responseCode === 422 || $responseCode == 400) {
            return Xml::buildArrayFromXml($response['body']);
        } else {
            Util::throwStatusCodeException($responseCode);
        }
    }

Usage Example

 /**
  * updates the address record
  *
  * if calling this method in context,
  * customerOrId is the 2nd attribute, addressId 3rd.
  * customerOrId & addressId are not sent in object context.
  *
  *
  * @access public
  * @param array $attributes
  * @param mixed $customerOrId (only used in call)
  * @param string $addressId (only used in call)
  * @return object Result\Successful or Result\Error
  */
 public function update($customerOrId, $addressId, $attributes)
 {
     $this->_validateId($addressId);
     $customerId = $this->_determineCustomerId($customerOrId);
     Util::verifyKeys(self::updateSignature(), $attributes);
     $path = $this->_config->merchantPath() . '/customers/' . $customerId . '/addresses/' . $addressId;
     $response = $this->_http->put($path, array('address' => $attributes));
     return $this->_verifyGatewayResponse($response);
 }
All Usage Examples Of Braintree\Http::put