✏️ 正在编辑: notification.php
路径:
/home/bpioifn/www/pigmentse/modules/mercanet/notification.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php /** * 1961-2019 BNP Paribas * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) that is available * through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0 * If you are unable to obtain it through the world-wide-web, please send an email * to modules@quadra-informatique.fr so we can send you a copy immediately. * * @author Quadra Informatique <modules@quadra-informatique.fr> * @copyright 1961-2019 BNP Paribas * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ include(dirname(__FILE__).'/../../config/config.inc.php'); include(dirname(__FILE__).'/mercanet.php'); $params = $_POST; $link = new Link(); // If data is missing, we stop the process if (!isset($params['Data']) || !isset($params['Seal'])) { Tools::redirect($link->getModuleLink('mercanet', 'validation', array( 'is_sealed' => false))); } if (!isset($params['Encode'])) { $params['Encode'] = null; } $is_sealed = MercanetApi::verifySeal($params['Data'], $params['Seal']); $source = 'notification.php'; // Decode Data switch ($params['Encode']) { case 'base64': $raw_data = base64_decode($params['Data']); $base64 = true; break; default: $raw_data = $params['Data']; $base64 = false; break; } if (Configuration::get('MERCANET_AUTOMATIC_REDIRECT_PAYMENT')) { sleep(2); } // If the sealed is valid, we create the order / payment and redirect the customer if ((bool)$is_sealed == true) { /* if (MercanetOrderQueue::checkAlreadyExist($raw_data, $source) == false) { // Create Order / Payment $notification = new MercanetNotification(); $notification->notify($params['Data'], $params['Seal'], $source, $base64); } */ if (MercanetReferencePayed::insertReference($raw_data, $source) == true) { // Create Order / Payment if (version_compare(_PS_VERSION_, '1.7.6.0', '>=')) { Tools::redirectLink( $link->getModuleLink( 'mercanet', 'notification', array( 'data' => $params['Data'], 'seal' => $params['Seal'], 'source' => $source, 'base64' => $base64, 'raw' => $raw_data, 'is_sealed' => (bool)$is_sealed ), true ) ); } else { $notification = new MercanetNotification(); $notification->notify($params['Data'], $params['Seal'], $source, $base64); } } } else { $message = 'Seal invalid =>'; $message .= ' Params: '; $message .= implode( ', ', array_map( function ($v, $k) { return $k.'='.$v; }, $params, array_keys($params) ) ); MercanetLogger::log($message, MercanetLogger::LOG_ERROR, MercanetLogger::FILE_DEBUG); }
💾 保存文件
← 返回文件管理器