/**
  * Listen for an order cancel event.
  * Load a collection using the extracted order increment ids.
  * Update each order's state and status to 'canceled' and the associated status respectively.
  *
  * @param Varien_Event_Observer
  * @return void
  */
 public function handleEbayEnterpriseOrderEventCancel(Varien_Event_Observer $observer)
 {
     $message = trim($observer->getEvent()->getMessage());
     $orderCollection = $this->loadOrdersFromXml($message);
     $eventName = $observer->getEvent()->getName();
     foreach ($orderCollection as $order) {
         $this->orderEventHelper->attemptCancelOrder($order, $eventName);
     }
 }
 /**
  * Processing order rejected event by loading the order using the customer order id
  * from the payload, if we have a valid order in Magento we proceed to attempt
  * to cancel the order.
  * @return self
  */
 public function process()
 {
     $incrementId = trim($this->_payload->getCustomerOrderId());
     if ($incrementId === '') {
         $logMessage = 'Received empty customer order id.';
         $this->_logger->warning($logMessage, $this->_context->getMetaData(__CLASS__));
         return $this;
     }
     $order = Mage::getModel('sales/order')->loadByIncrementId($incrementId);
     if (!$order->getId()) {
         $logData = ['increment_Id' => $incrementId];
         $logMessage = 'Customer order id {increment_id} was not found.';
         $this->_logger->warning($logMessage, $this->_context->getMetaData(__CLASS__, $logData));
         return $this;
     }
     // canceling the order
     $this->_orderEventHelper->attemptCancelOrder($order, $this->_payload->getEventType());
     return $this;
 }