Jump to content

kylevorster

Member
  • Content Count

    37
  • Joined

  • Last visited

  • Days Won

    1

kylevorster last won the day on May 2 2022

kylevorster had the most liked content!

Community Reputation

1 Neutral

About kylevorster

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I figured out what the problem was, the gateway was added to the database with type 'invoice' instead of 'CC' and that caused the problem, if only WHMCS has better documentation ... select * from tblpaymentgateways; gateway | setting | value +--------------+--------------------+ | gateway | type | Invoices should be gateway | setting | value +--------------+--------------------+ | gateway | type | CC - - - Updated - - - Next question would be, is there anyway not to store the full cc number but only the last 4 digits, cause if you create a token then only the token and the cvc gets passed to the gateway, so there's no point in storing the full cc number.
  2. Hey all, I've updated my WHMCS installation from 5 to 6 last night and loaded a new payment gateway that allows for tokenisation. On my local dev copy clients can manage a credit card from the client area but on my live copy there's no such option. I've tried everything but I can not find how to enable that option .. Any advice ? --- update --- It seems like tokenisation ain't working at all, the credit card number and expiry that gets saved but the _storeremote function ain't being called. ---------------
  3. How can I use a language file in a provisioning module. I've tried creating a lang/english.php file in the module directory but it doesn't work when I try and use it in my module. /modules/servers/<mymod>/lang/english.php <?php echo \Lang::trans("special_word"); Any advice ?
  4. Hello, Does anyone know what mod security rules can be enabled without WHMCS breaking. I've thus far found the following rules to break WHMCS but I had to disable mod security completely cause there were others that I had to find and it was just to much work to keep on adding them to the disabled list. '950120', '950109', '960024', '981231', '981173', '981245', '981243', '960009', '981172', '950901', '981257', '973338', '973300', '973304', '973306','958034', '973302', '973326', '973347', '973335', '973334', '973333', '973334', '973333', '973332', '973316', '950001', '959073', '981319'
  5. Never mind all, I've managed what I wanted by adding a extra field to the actions sidebar called removeme and just check if that button is there then run my action_hook. <?php // hooks.php use WHMCS\View\Menu\Item as MenuItem; if (!defined("WHMCS")) { die("This file cannot be accessed directly"); } add_hook('ClientAreaPrimarySidebar', 2, function(MenuItem $primarySidebar) { if(is_null($primarySidebar->getChild('Service Details Overview'))) { return; } if(is_null($primarySidebar->getChild('Service Details Actions')->getChild('Custom Module Button removeme'))) { return; } $menu = $primarySidebar->getChild('Service Details Actions'); $menu->removeChild("Custom Module Button removeme"); $menu = $primarySidebar->getChild('Service Details Overview'); $menu->removeChild("Information"); $menu->addChild('Information', [ 'label' => 'Information', 'uri' => '/clientarea.php?action=' . $_GET['action'] . '&id=' . $_GET['id'], 'order' => 1, ])->setClass(( ! isset($_GET['modop']) ? 'active' : '')); $primarySidebar->getChild('Service Details Actions')->removeChild("Cancel"); }); Regarding it not reading my hooks.php file, it looks like I just add to increase the priority. Hooks Debug: Hook Defined for Point: ClientAreaPrimarySidebar - Priority: 0 - Function Name: cpanel_defineSsoSidebarLinks Hooks Debug: Hook Defined for Point: ClientAreaPrimarySidebar - Priority: 2 - Function Name: (anonymous function) Hopefully all this questions/answers might help someone else
  6. Another question, I'm busy creating a Provisioning module but its not reading the hooks file instead the module. The file is called hooks.php If I add the code to the module file then it works but just refuses in the hooks.php file. Btw I'm using V6.
  7. Hello, Does anyone know how to detect what service group is being used in a hooks file to determine what sidebar to show. <?php // hooks use WHMCS\View\Menu\Item as MenuItem; if (!defined("WHMCS")) { die("This file cannot be accessed directly"); } add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { // detect package service group (dedicated servers for example) ? // would I find that in the global $whmcs ? }); Then does anyone know how to show which link on the sidebar is active, for example if I do the following. <?php // hooks use WHMCS\View\Menu\Item as MenuItem; if (!defined("WHMCS")) { die("This file cannot be accessed directly"); } add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { if ( ! is_null($primarySidebar->getChild('Service Details Actions'))) { $Sidebar = $primarySidebar->getChild('Service Details Actions'); $action = $_GET['action']; $service_id = $_GET['id']; $subaction = $_GET['subaction']; if($subaction == 'actions') { // set Actions link to active } else { $Sidebar->addChild('Actions', [ 'label' => 'Actions', 'uri' => '/clientarea.php?action=' . $action . '&id=' . $service_id . '&subaction=actions', ]); } /* OR */ $Sidebar->addChild('Actions', [ 'label' => 'Actions', 'uri' => '/clientarea.php?action=' . $action . '&id=' . $service_id . '&subaction=actions', '???' => ($subaction == 'actions' ? true : false), ]); } }); Any help would be amazing. Thanks. - - - Updated - - - I'm sorry, I should have read the docs before posting, I see you can set the class using the setClass method http://docs.whmcs.com/classes/classes/WHMCS.View.Menu.Item.html#method_setClass So my only question would be the service type then.
  8. Hey, I've upgraded to WHMCS 6.1 and when I create a note via the remote API and then try and delete it within whmcs it refuses to delete. The user that created the note has API access and the user trying to delete the note has full admin rights .. Am I missing something or is this a bug ?
  9. Hello, How can I access database values from a addon in another page, for example if I create a custom page, how can I access the addon values on that page ? - Kyle
  10. Hello, I'm trying to use custom pages for my gateway template but I'm not sure I'm following the right way todo this, does anyone know of a better way todo this. <?php // template.php function template_config() { $configarray = array ( ); return $configarray; } function template_storeremote($params) { global $smarty; $smarty->assign('foo', 'bar'); return $smarty->display('orderforms/{template}/{gateway}/{file}.tpl'); } function template_3dsecure($params) { global $smarty; $smarty->assign('foo', 'bar'); return $smarty->display('orderforms/{template}/{gateway}/{file}.tpl'); } ?> <?php // callback/template.php include("../../../dbconnect.php"); include("../../../includes/functions.php"); include("../../../includes/gatewayfunctions.php"); include("../../../includes/invoicefunctions.php"); $gatewaymodule = "template"; # Enter your gateway module name here replacing template $GATEWAY = getGatewayVariables($gatewaymodule); if ( ! $GATEWAY["type"]) { $smarty = new Smarty(); $smarty->assign('foo', 'bar'); echo $smarty->display('orderforms/{template}/{gateway}/{file}.tpl'); exit; } // do some staff $smarty = new Smarty(); $smarty->assign('foo', 'bar'); echo $smarty->display('orderforms/{template}/{gateway}/{file}.tpl'); exit; ?> Really hope someone can help.
  11. Good day, I'm busy writing a payment gateway but I require the following fields on the callback page, the fields ain't being sent back from the provider, so at the moment I'm saving them in sessions but I think its a security risk saving this in a session, any other way to do this ? $invoiceid = $_SESSION['mygate']['MerchantReference']; $ClientToken = $_SESSION['mygate']['ClientToken']; $CVC = $_SESSION['mygate']['CVC']; $Amount = $_SESSION['mygate']['Amount'] I set the following using the _3dsecure function $_SESSION['mygate'] = [ 'ClientToken' => $params['gatewayid'], 'CVC' => $params['cccvv'], 'Amount' => $params['amount'], 'MerchantReference' => $params['invoiceid'], ] I'm using _storeremote($params) to store the card details. Does anyone know of any other way to do this ?
  12. My daily cron stops after creating a couple invoices, I run the following commands. /usr/bin/php -q cron.php do_latefees do_invoices do_invoicereminders debug And this was the feedback I got. Invoicing Loop Service ID 36172 - 2008 of 3823 (Time: -0.61 Memory: 13.58) Invoicing Loop Service ID 14993 - 2009 of 3823 (Time: 0.4 Memory: 13.58) root@firefoot:~# ps aux | grep php root 26819 0.0 0.0 4440 620 ? Ss 14:30 0:00 /bin/sh -c cd /v Warning: Missing argument 3 for ModuleCallFunction(), called in /var/www/includes/modulefunctions.php on line 0 and defined in /var/www/includes/modulefunctions.php on line 0 Generated Invoice #460409 (Time: 0.58 Memory: 35.76) Generated Invoice #460410 (Time: -0.71 Memory: 35.76) Generated Invoice #460412 (Time: 0.27 Memory: 35.76) Generated Invoice #460413 (Time: 0.3 Memory: 35.77) Generated Invoice #460415 (Time: 0.28 Memory: 35.77) Generated Invoice #460416 (Time: -0.62 Memory: 35.77) Generated Invoice #460419 (Time: -0.07 Memory: 35.77) Generated Invoice #460421 (Time: 0.29 Memory: 35.77) Generated Invoice #460422 (Time: 0.28 Memory: 35.77) Generated Invoice #460425 (Time: -0.65 Memory: 35.78) Generated Invoice #460427 (Time: 0.36 Memory: 35.78) Generated Invoice #460429 (Time: 0.28 Memory: 35.78) Generated Invoice #460430 (Time: -0.72 Memory: 35.78) Generated Invoice #460432 (Time: 0.45 Memory: 35.78) PHP Fatal error: Cannot redeclare gracefulcorerequiredfileinclude() in /var/www/init.php on line 20 Fatal error: Cannot redeclare gracefulcorerequiredfileinclude() in /var/www/init.php on line 20 Please help.
  13. We're having problems with the view cart page and the existing customer login form. When you click on the existing customer form it does not display the form but it does highlight the button when you click back to the new customer it changing the button to active and then brings up the form. I think its got something to do with the javascript not showing the form by adding the active class. JavaScript jQuery(document).ready(function(){ jQuery("#existingcust").click(function(){ if (jQuery(this).hasClass('active')!=true) { jQuery(".signuptype").removeClass('active'); jQuery(this).addClass('active'); jQuery("#signupfrm").fadeToggle('fast',function(){ jQuery("#loginfrm").fadeToggle('fast'); }); jQuery("#custtype").val("existing"); } }); jQuery("#newcust").click(function(){ if (jQuery(this).hasClass('active')!=true) { jQuery(".signuptype").removeClass('active'); jQuery(this).addClass('active'); jQuery("#loginfrm").fadeToggle('fast',function(){ jQuery("#signupfrm").fadeToggle('fast'); }); jQuery("#custtype").val("new"); } }); }); HTML - Login Form <div class="signupfields{if $custtype eq "existing" && !$loggedin}{else} hidden{/if}" id="loginfrm"> HTML - Existing Customer Form <div class="signupfields{if $custtype eq "existing" && !$loggedin} hidden{/if}" id="signupfrm"> We've made no modifications to the orderform templates.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated