/**
  *
  * @param Customweb_Subscription_Model_Subscription $subscription
  * @throws Exception
  * @return transaction
  */
 private function createOrder($subscription)
 {
     if (!$subscription->canPay()) {
         throw new Exception('The subscription cannot be authorized.');
     }
     Mage::register('customweb_subscription_recurring_order', true);
     Mage::getSingleton('core/session')->setSubscriptionId($subscription->getId());
     $order = $subscription->createOrder();
     $order->save();
     $subscription->addOrderRelation($order->getId());
     Mage::unregister('customweb_subscription_recurring_order');
     Mage::getSingleton('core/session')->setSubscriptionOrder($order->getId());
     $method = $order->getPayment()->getMethodInstance();
     return $method->createTransaction($order);
 }