from ._CommonProcessor import _CommonProcessor
from model import ConfirmFinishPaymentData


class ConfirmFinishPaymentProcessor(_CommonProcessor):
    def parse_data(self, data, event_type):
        return ConfirmFinishPaymentData(*data.split(';'))

    def call_business(
        self,
        confirm_finish_payment_data     # type: ConfirmFinishPaymentData
    ):
        # type: (...) -> str

        processor = self.payment_router.get_payment_processor()
        if processor:
            return processor.confirm_finish_payment(confirm_finish_payment_data=confirm_finish_payment_data)
