def sepa_transfer(self, account: SEPAAccount, pain_message: str, multiple=False,
                      control_sum=None, currency='EUR', book_as_single=False,
                      pain_descriptor='urn:iso:std:iso:20022:tech:xsd:pain.001.001.03'):
        """
        Custom SEPA transfer.

        :param account: SEPAAccount to send the transfer from.
        :param pain_message: SEPA PAIN message containing the transfer details.
        :param multiple: Whether this message contains multiple transfers.
        :param control_sum: Sum of all transfers (required if there are multiple)
        :param currency: Transfer currency
        :param book_as_single: Kindly ask the bank to put multiple transactions as separate lines on the bank statement (defaults to ``False``)
        :param pain_descriptor: URN of the PAIN message schema used.
        :return: Returns either a NeedRetryResponse or TransactionResponse
        """

        with self._get_dialog() as dialog:
            if multiple:
                command_class = HKCCM1
            else:
                command_class = HKCCS1

            hiccxs, hkccx = self._find_highest_supported_command(
                command_class,
                return_parameter_segment=True
            )

            seg = hkccx(
                account=hkccx._fields['account'].type.from_sepa_account(account),
                sepa_descriptor=pain_descriptor,
                sepa_pain_message=pain_message.encode(),
            )

            if multiple:
                if hiccxs.parameter.sum_amount_required and control_sum is None:
                    raise ValueError("Control sum required.")
                if book_as_single and not hiccxs.parameter.single_booking_allowed:
                    raise FinTSUnsupportedOperation("Single booking not allowed by bank.")

                if control_sum:
                    seg.sum_amount.amount = control_sum
                    seg.sum_amount.currency = currency

                if book_as_single:
                    seg.request_single_booking = True

            return self._send_with_possible_retry(dialog, seg, self._continue_sepa_transfer)
def sepa_transfer ( self , account : SEPAAccount , pain_message : str , multiple = False , control_sum = None , currency = 'EUR' , book_as_single = False , pain_descriptor = 'urn:iso:std:iso:20022:tech:xsd:pain.001.001.03' ) : with self . _get_dialog ( ) as dialog : if multiple : command_class = HKCCM1 else : command_class = HKCCS1 hiccxs , hkccx = self . _find_highest_supported_command ( command_class , return_parameter_segment = True ) seg = hkccx ( account = hkccx . _fields [ 'account' ] . type . from_sepa_account ( account ) , sepa_descriptor = pain_descriptor , sepa_pain_message = pain_message . encode ( ) , ) if multiple : if hiccxs . parameter . sum_amount_required and control_sum is None : raise ValueError ( "Control sum required." ) if book_as_single and not hiccxs . parameter . single_booking_allowed : raise FinTSUnsupportedOperation ( "Single booking not allowed by bank." ) if control_sum : seg . sum_amount . amount = control_sum seg . sum_amount . currency = currency if book_as_single : seg . request_single_booking = True return self . _send_with_possible_retry ( dialog , seg , self . _continue_sepa_transfer )
Custom SEPA transfer.

        :param account: SEPAAccount to send the transfer from.
        :param pain_message: SEPA PAIN message containing the transfer details.
        :param multiple: Whether this message contains multiple transfers.
        :param control_sum: Sum of all transfers (required if there are multiple)
        :param currency: Transfer currency
        :param book_as_single: Kindly ask the bank to put multiple transactions as separate lines on the bank statement (defaults to ``False``)
        :param pain_descriptor: URN of the PAIN message schema used.
        :return: Returns either a NeedRetryResponse or TransactionResponse