Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP5 Decoder for ionCube Encoder)
- *
- * @ Version : 3.5.0.0
- * @ Author : DeZender
- * @ Release on : 22.06.2018
- * @ Official site : http://DeZender.Net
- *
- */
- define('ADMINAREA', true);
- require '../init.php';
- $aInt = new WHMCS\Admin('Configure Payment Gateways');
- $aInt->title = $aInt->lang('setup', 'gateways');
- $aInt->sidebar = 'config';
- $aInt->icon = 'offlinecc';
- $aInt->helplink = 'Payment Gateways';
- $aInt->requireAuthConfirmation();
- $aInt->requiredFiles(array('gatewayfunctions', 'modulefunctions'));
- if (App::getFromRequest('manage') && App::getFromRequest('gateway')) {
- redir('manage=1#m_' . strip_tags(strtolower(App::getFromRequest('gateway'))));
- }
- $GatewayValues = $GatewayConfig = $ActiveGateways = array();
- $DisabledGateways = $AllGateways = $noConversion = array();
- $result = select_query('tblpaymentgateways', '', '', 'setting', 'ASC');
- while ($data = mysql_fetch_array($result)) {
- $gwv_gateway = $data['gateway'];
- $gwv_setting = $data['setting'];
- $gwv_value = $data['value'];
- $GatewayValues[$gwv_gateway][$gwv_setting] = $gwv_value;
- }
- $includedmodules = array();
- $gatewayInterface = new WHMCS\Module\Gateway();
- foreach ($gatewayInterface->getList() as $gatewayModuleName) {
- if (!in_array($gatewayModuleName, $includedmodules) && $gatewayModuleName != 'index') {
- $gatewayInterface->load($gatewayModuleName);
- $includedmodules[] = $gatewayModuleName;
- $AllGateways[] = $gatewayModuleName;
- if (isset($GatewayValues[$gatewayModuleName]['type'])) {
- $ActiveGateways[] = $gatewayModuleName;
- } else {
- $DisabledGateways[] = $gatewayModuleName;
- }
- $GatewayConfig[$gatewayModuleName] = $gatewayInterface->getConfiguration();
- $noConversion[$gatewayModuleName] = $gatewayInterface->getMetaDataValue('noCurrencyConversion');
- }
- }
- $result = select_query('tblpaymentgateways', '', '', 'order', 'DESC');
- $data = mysql_fetch_array($result);
- $lastorder = $data['order'];
- $action = $whmcs->get_req_var('action');
- if ($action == 'onboarding' && in_array($gateway, $includedmodules)) {
- $gatewayInterface->load($gateway);
- if ($gatewayInterface->getMetaDataValue('apiOnboarding')) {
- echo $gatewayInterface->getOnBoardingRedirectHtml();
- throw new WHMCS\Exception\ProgramExit();
- }
- }
- if ($action == 'activate' && in_array($gateway, $includedmodules)) {
- check_token('WHMCS.admin.default');
- $gatewayInterface->load($gateway);
- if ($gatewayInterface->getMetaDataValue('apiOnboarding')) {
- echo $gatewayInterface->getOnBoardingRedirectHtml();
- throw new WHMCS\Exception\ProgramExit();
- }
- delete_query('tblpaymentgateways', array('gateway' => $gateway));
- $lastorder++;
- $type = 'Invoices';
- if ($gatewayInterface->functionExists('capture')) {
- $type = 'CC';
- }
- insert_query('tblpaymentgateways', array('gateway' => $gateway, 'setting' => 'name', 'value' => $GatewayConfig[$gateway]['FriendlyName']['Value'], 'order' => $lastorder));
- if ($GatewayConfig[$gateway]['RemoteStorage']) {
- insert_query('tblpaymentgateways', array('gateway' => $gateway, 'setting' => 'remotestorage', 'value' => '1'));
- }
- insert_query('tblpaymentgateways', array('gateway' => $gateway, 'setting' => 'type', 'value' => $type));
- insert_query('tblpaymentgateways', array('gateway' => $gateway, 'setting' => 'visible', 'value' => 'on'));
- logAdminActivity("Gateway Module Activated: '" . $GatewayConfig[$gateway]['FriendlyName']['Value'] . "'");
- try {
- $gatewayInterface->loadSettings();
- ...........................................................
- ................................
- ...........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement