function onPaymentNotification(&$statuses) { // adding PagSeguro API require_once 'PagSeguroLibrary/PagSeguroLibrary.php'; // retrieving configurated default log info $filename = JPATH_BASE . '/logs/log_pagseguro.log'; $this->_verifyFile($filename); PagSeguroConfig::activeLog($filename); $order_id = (int) $_REQUEST['invoice']; $dbOrder = $this->getOrder($order_id); $this->loadPaymentParams($dbOrder); if (empty($this->payment_params)) { return false; } $post = $_POST; if (!PagSeguroHelper::isNotificationEmpty($post)) { $notificationType = new PagSeguroNotificationType($post['notificationType']); $strType = $notificationType->getTypeFromValue(); switch ($strType) { case 'TRANSACTION': $this->_doUpdateByNotification($statuses, $post['notificationCode']); break; default: LogPagSeguro::error("Unknown notification type [" . $notificationType->getValue() . "]"); } } else { LogPagSeguro::error("Invalid notification parameters."); } return true; }
function plgVmOnPaymentNotification() { $post = $_POST; if (!PagSeguroHelper::isNotificationEmpty($post)) { $notificationType = new PagSeguroNotificationType($post['notificationType']); $strType = $notificationType->getTypeFromValue(); switch ($strType) { case 'TRANSACTION': $this->_doUpdateByNotification($post['notificationCode']); break; default: LogPagSeguro::error("Unknown notification type [" . $notificationType->getValue() . "]"); } } else { LogPagSeguro::error("Invalid notification parameters."); } }