def retry(self,identity,params=None, headers=None):
path = self._sub_url_params('<STR_LIT>', {<EOL>'<STR_LIT>': identity,<EOL>})<EOL>if params is not None:<EOL><INDENT>params = {'<STR_LIT:data>': params}<EOL><DEDENT>response = self._perform_request('<STR_LIT:POST>', path, params, headers,<EOL>retry_failures=False)<EOL>return self._resource_for(response)<EOL>
Retry a payment.

        <a name="retry_failed"></a>Retries a failed payment if the underlying
        mandate is active. You will receive a `resubmission_requested` webhook,
        but after that retrying the payment follows the same process as its
        initial creation, so you will receive a `submitted` webhook, followed
        by a `confirmed` or `failed` event. Any metadata supplied to this
        endpoint will be stored against the payment submission event it causes.

        This will return a `retry_failed` error if the payment has not failed.

        Payments can be retried up to 3 times.

        Args:
              identity (string): Unique identifier, beginning with "PM".
              params (dict, optional): Request body.

        Returns:
              ListResponse of Payment instances