package com.braintree.actions.order;

import de.hybris.platform.orderprocessing.events.FraudErrorEvent;
import de.hybris.platform.orderprocessing.model.OrderProcessModel;
import de.hybris.platform.processengine.action.AbstractProceduralAction;
import de.hybris.platform.servicelayer.event.EventService;
import org.apache.log4j.Logger;

public class BrainTreeSendFraudErrorNotificationAction extends AbstractProceduralAction<OrderProcessModel> {

    private static final Logger LOG = Logger.getLogger(BrainTreeSendFraudErrorNotificationAction.class);

    private EventService eventService;

    @Override
    public void executeAction(final OrderProcessModel process) {
        eventService.publishEvent(new FraudErrorEvent(process));
        LOG.info("Process: " + process.getCode() + " in step " + getClass());
    }

    public void setEventService(final EventService eventService) {
        this.eventService = eventService;
    }

}
