/** * To assign transaction id and token after capturing payment * * @param Mage_Sale_Model_Order_Invoice $invoice * @param Mage_Sale_Model_Order_Payment $payment * @return Mage_Cybersource_Model_Soap */ public function processInvoice($invoice, $payment) { parent::processInvoice($invoice, $payment); $invoice->setTransactionId($payment->getLastTransId()); $invoice->setCybersourceToken($payment->getLastCybersourceToken()); return $this; }
/** * Check if invoice email can be sent, and send it. * * @param Mage_Sales_Model_Order_Invoice $invoice * @param Mage_Sales_Model_Order_Payment $payment * @return Fontis_EwayAu_Model_Direct */ public function processInvoice($invoice, $payment) { parent::processInvoice($invoice, $payment); try { $storeId = $invoice->getOrder()->getStoreId(); if (Mage::helper('sales')->canSendNewInvoiceEmail($storeId)) { $invoice->save(); $invoice->sendEmail(); } } catch (Exception $e) { Mage::logException($e); } return $this; }