from ._SitefPaymentProcessor import SitefPaymentProcessor

_current_sitef_processor = None


def stop_sitef_processor():
    global _current_sitef_processor
    if _current_sitef_processor:
        _current_sitef_processor.stop()
    _current_sitef_processor = None


def get_sitef_processor(message_bus, dialog_manager, config, logger):
    global _current_sitef_processor
    if not _current_sitef_processor:
        _current_sitef_processor = SitefPaymentProcessor(message_bus, dialog_manager, config, logger)
    return _current_sitef_processor
