/** * Refund payment * * @return void */ public function refundPayment() { $app = JFactory::getApplication(); $input = $app->input; $ids = $input->get('cid', array(), 'array'); foreach ($ids as $id) { $status = RApiPaymentHelper::refundPayment($id); if ($status) { $app->enqueueMessage(JText::_('COM_REDCORE_PAYMENT_REFUND_PAYMENT_SUCCESS')); } else { $lastLog = RApiPaymentHelper::getLastPaymentLog($id); $app->enqueueMessage(JText::sprintf('COM_REDCORE_PAYMENT_REFUND_PAYMENT_FAILED', $lastLog->message_text), 'error'); } } // Redirect to the list screen $this->setRedirect($this->getRedirectToListRoute($this->getRedirectToListAppend())); }