Exemplo n.º 1
0
 /**
  * Creates an invoice for the order
  *
  * @throws Exception
  */
 protected function _addInvoice()
 {
     if ($this->getShopgateOrder()->getIsPaid()) {
         parent::_addInvoice();
     } else {
         $info = $this->getShopgateOrder()->getPaymentInfos();
         $invoice = $this->_getPaymentHelper()->createOrderInvoice($this->getOrder());
         $invoice->setIsPaid(false);
         $invoice->setTransactionId($info['txn_id']);
         $invoice->save();
         $this->getOrder()->addRelatedObject($invoice);
     }
 }