/** * Create and return new order item based on profile item data and $itemInfo * * @param Varien_Object $itemInfo * @return Mage_Sales_Model_Order_Item */ protected function _getItem($itemInfo) { $paymentType = $itemInfo->getPaymentType(); if (!$paymentType) { throw new Exception("Recurring profile payment type is not specified."); } switch ($paymentType) { case self::PAYMENT_TYPE_REGULAR: return $this->_getRegularItem($itemInfo); case self::PAYMENT_TYPE_TRIAL: return $this->_getTrialItem($itemInfo); case self::PAYMENT_TYPE_INITIAL: return $this->_getInitialItem($itemInfo); default: new Exception("Invalid recurring profile payment type '{$paymentType}'."); } }