<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update(self,identity,params=None, headers=None):
 """Update a payment. Updates a payment object. This accepts only the metadata parameter. Args: identity (string):
 Unique identifier, beginning with "PM". params (dict, optional):
 Request body. Returns: ListResponse of Payment instances """

        path = self._sub_url_params('/payments/:identity', {
          
            'identity': identity,
          })
        
        if params is not None:
            params = {self._envelope_key(): params}

        response = self._perform_request('PUT', path, params, headers,
                                         retry_failures=True)
        return self._resource_for(response)