def create(self,params=None, headers=None):
path = '<STR_LIT>'<EOL>if params is not None:<EOL><INDENT>params = {self._envelope_key(): params}<EOL><DEDENT>try:<EOL><INDENT>response = self._perform_request('<STR_LIT:POST>', path, params, headers,<EOL>retry_failures=True)<EOL><DEDENT>except errors.IdempotentCreationConflictError as err:<EOL><INDENT>return self.get(identity=err.conflicting_resource_id,<EOL>params=params,<EOL>headers=headers)<EOL><DEDENT>return self._resource_for(response)<EOL>
Create a payment.

        <a name="mandate_is_inactive"></a>Creates a new payment object.

        This fails with a `mandate_is_inactive` error if the linked
        [mandate](#core-endpoints-mandates) is cancelled or has failed.
        Payments can be created against mandates with status of:
        `pending_customer_approval`, `pending_submission`, `submitted`, and
        `active`.

        Args:
              params (dict, optional): Request body.

        Returns:
              ListResponse of Payment instances