import json

from messagebus import AckMessage

from ._CommonProcessor import _CommonProcessor


class GetElectronicTypesProcessor(_CommonProcessor):
    def parse_data(self, data, event_type):
        return data

    def call_business(self, _):
        return self.payment_router.get_electronic_types()

    def format_response(self, message_bus, message, event, input_obj, result):
        message_bus.reply_message(message, AckMessage(json.dumps(result).encode("utf-8")))
