Ejemplo n.º 1
0
 /**
  * Execute the Api Accept operation.
  *
  * @return  mixed  RApi object with information on success, boolean false on failure.
  */
 public function apiAccept()
 {
     $app = JFactory::getApplication();
     $payment = $this->getPayment();
     $logData = RApiPaymentHelper::generatePaymentLog(RApiPaymentStatus::getStatusProcessed(), $this->requestData, JText::sprintf('LIB_REDCORE_PAYMENT_LOG_ACCEPT_MESSAGE', $this->extensionName, $this->paymentName));
     // This method can process data from payment request more if needed
     $app->triggerEvent('onRedpaymentRequestAccept', array($this->paymentName, $this->extensionName, $this->ownerName, $this->requestData, &$logData));
     // Save payment log and do not update change for payment
     RApiPaymentHelper::saveNewPaymentLog($logData);
     $redirect = !empty($payment->url_accept) ? $payment->url_accept : JUri::root() . 'index.php?option=' . $payment->extension_name;
     // Redirect to extension Accept URL
     $app->redirect($redirect);
     $app->close();
 }