Advertisement
Guest User

Untitled

a guest
Nov 25th, 2019
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.61 KB | None | 0 0
  1. <?php
  2. /*
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 3.5.0.0
  8. * @ Author : DeZender
  9. * @ Release on : 22.06.2018
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. define('ADMINAREA', true);
  15. require '../init.php';
  16. $aInt = new WHMCS\Admin('Configure Payment Gateways');
  17. $aInt->title = $aInt->lang('setup', 'gateways');
  18. $aInt->sidebar = 'config';
  19. $aInt->icon = 'offlinecc';
  20. $aInt->helplink = 'Payment Gateways';
  21. $aInt->requireAuthConfirmation();
  22. $aInt->requiredFiles(array('gatewayfunctions', 'modulefunctions'));
  23.  
  24. if (App::getFromRequest('manage') && App::getFromRequest('gateway')) {
  25. redir('manage=1#m_' . strip_tags(strtolower(App::getFromRequest('gateway'))));
  26. }
  27.  
  28. $GatewayValues = $GatewayConfig = $ActiveGateways = array();
  29. $DisabledGateways = $AllGateways = $noConversion = array();
  30. $result = select_query('tblpaymentgateways', '', '', 'setting', 'ASC');
  31.  
  32. while ($data = mysql_fetch_array($result)) {
  33. $gwv_gateway = $data['gateway'];
  34. $gwv_setting = $data['setting'];
  35. $gwv_value = $data['value'];
  36. $GatewayValues[$gwv_gateway][$gwv_setting] = $gwv_value;
  37. }
  38. $includedmodules = array();
  39. $gatewayInterface = new WHMCS\Module\Gateway();
  40.  
  41. foreach ($gatewayInterface->getList() as $gatewayModuleName) {
  42. if (!in_array($gatewayModuleName, $includedmodules) && $gatewayModuleName != 'index') {
  43. $gatewayInterface->load($gatewayModuleName);
  44. $includedmodules[] = $gatewayModuleName;
  45. $AllGateways[] = $gatewayModuleName;
  46.  
  47. if (isset($GatewayValues[$gatewayModuleName]['type'])) {
  48. $ActiveGateways[] = $gatewayModuleName;
  49. } else {
  50. $DisabledGateways[] = $gatewayModuleName;
  51. }
  52.  
  53. $GatewayConfig[$gatewayModuleName] = $gatewayInterface->getConfiguration();
  54. $noConversion[$gatewayModuleName] = $gatewayInterface->getMetaDataValue('noCurrencyConversion');
  55. }
  56. }
  57. $result = select_query('tblpaymentgateways', '', '', 'order', 'DESC');
  58. $data = mysql_fetch_array($result);
  59. $lastorder = $data['order'];
  60. $action = $whmcs->get_req_var('action');
  61.  
  62. if ($action == 'onboarding' && in_array($gateway, $includedmodules)) {
  63. $gatewayInterface->load($gateway);
  64.  
  65. if ($gatewayInterface->getMetaDataValue('apiOnboarding')) {
  66. echo $gatewayInterface->getOnBoardingRedirectHtml();
  67.  
  68. throw new WHMCS\Exception\ProgramExit();
  69. }
  70. }
  71.  
  72. if ($action == 'activate' && in_array($gateway, $includedmodules)) {
  73. check_token('WHMCS.admin.default');
  74. $gatewayInterface->load($gateway);
  75.  
  76. if ($gatewayInterface->getMetaDataValue('apiOnboarding')) {
  77. echo $gatewayInterface->getOnBoardingRedirectHtml();
  78.  
  79. throw new WHMCS\Exception\ProgramExit();
  80. }
  81.  
  82. delete_query('tblpaymentgateways', array('gateway' => $gateway));
  83. $lastorder++;
  84. $type = 'Invoices';
  85.  
  86. if ($gatewayInterface->functionExists('capture')) {
  87. $type = 'CC';
  88. }
  89.  
  90. insert_query('tblpaymentgateways', array('gateway' => $gateway, 'setting' => 'name', 'value' => $GatewayConfig[$gateway]['FriendlyName']['Value'], 'order' => $lastorder));
  91.  
  92. if ($GatewayConfig[$gateway]['RemoteStorage']) {
  93. insert_query('tblpaymentgateways', array('gateway' => $gateway, 'setting' => 'remotestorage', 'value' => '1'));
  94. }
  95.  
  96. insert_query('tblpaymentgateways', array('gateway' => $gateway, 'setting' => 'type', 'value' => $type));
  97. insert_query('tblpaymentgateways', array('gateway' => $gateway, 'setting' => 'visible', 'value' => 'on'));
  98. logAdminActivity("Gateway Module Activated: '" . $GatewayConfig[$gateway]['FriendlyName']['Value'] . "'");
  99.  
  100. try {
  101. $gatewayInterface->loadSettings();
  102. ...........................................................
  103. ................................
  104. ...........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement