Jump to content

sonuyos

Member
  • Content Count

    121
  • Joined

  • Last visited

Community Reputation

0 Neutral

About sonuyos

  • Rank
    Member

Recent Profile Visitors

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

  1. Ioncube 12.0 is out with PHP 8.1 Support for almost 16hours, where is our WHMCS PHP 8.1 support at? /s
  2. I have written this code and the print_r output it correct and shows the valid username and password of the service in the - https:// domain. com /billing/ADMIN/orders.php?action=view&id=ORDERID However i want to have it displayed in a table format here - Can anyone help me? I have no idea how to put the HTML code output at that location, or to be honest in any location on the WHMCS admin order page. There are multiple output, depending on the number of orders/service the order page has. Hence why i am using foreach. Location of the place i want output. My code - https://3v4l.org/bFpOT (unable to post here).
  3. I wonder why my code isnt working with cron.
  4. YESSS THAT WORKS. However now, when i try to terminate it from the panel, it works fine and marks invoice cancelled, but if i run cron, it doesnt, shouldnt it mark it cancelled even with cron?
  5. @brian! According to this page - https://developers.whmcs.com/hooks-reference/module/#aftermoduleterminate and this - https://developers.whmcs.com/provisioning-modules/module-parameters/ The module should provide serviceid by defualt and producttype too, but it does not. i am doing something wrong?
  6. No no, you got that wrong, my code works completely, its just that i am unable to pass $serviceid & $producttype from vars. This section does not work. add_hook('AfterModuleTerminate', 1, function($vars) { $serviceid=$vars['serviceid']; $producttype=$vars['producttype'];
  7. <?php if (!defined("WHMCS")) die("This file cannot be accessed directly"); use WHMCS\Database\Capsule; add_hook('AfterModuleTerminate', 1, function($vars) { $serviceid=$vars['serviceid']; $producttype=$vars['producttype']; $invoices=Capsule::table("tblinvoiceitems")->where("relid","$serviceid")->where("type","$producttype")->get(); foreach($invoices as $invoice) { $results = localAPI("GetInvoice",array("invoiceid"=>$invoice->invoiceid,"status"=>"Unpaid")); if ($results["status"]=="Unpaid") { $cancelinvoiceid=$results["invoiceid"]; $results = localAPI("UpdateInvoice",array("invoiceid"=>"$cancelinvoiceid","status"=>"Cancelled")); logactivity("[INVOICECANCELHOOK] has cancelled Invoice ID: $cancelinvoiceid automatically."); } } }); Updated the code a litter bit to make sure it works if serviceid is provided. The code is working now, but still unable to set it to cancel automatically becausse there is way i can pass serviceid variable.
  8. This is my code, it is in WIP, and i am facing issue. Theorotically it works fine, however for some reason the vars are not passing thru, the service id & product type are empty, causing ALL the invoices to get cancelled, anyway to solve this? I do not know what i am doing wrong, it should work. <?php if (!defined("WHMCS")) die("This file cannot be accessed directly"); use WHMCS\Database\Capsule; add_hook('AfterModuleTerminate', 1, function($vars) { $serviceid=$vars['serviceid']; $producttype=$vars['producttype']; $invoices=Capsule::table("tblinvoiceitems")->where("relid","$serviceid")->where("type","$producttype")->get(); foreach($invoices as $invoice) { $results = localAPI("GetInvoice",array("invoiceid"=>$invoice->id); if ($results["status"]=="Unpaid") { $cancelinvoiceid=$results["invoiceid"]; $results = localAPI("UpdateInvoice",array("invoiceid"=>"$cancelinvoiceid","status"=>"Cancelled")); logactivity("[INVOICECANCELHOOK] has cancelled Invoice ID: $cancelinvoiceid automatically."); } } });
  9. New prices are In effect from July 1st 2021.
  10. So i updated WHMCS to latest this week, waited long enough for all the issues to iron out. but now i am facing this issue. I have a custom script that uses variables which is passed on the client area by template. "$template->tpl_vars" and to be able to use this, i had added a code in configuration.php $smarty_security_policy = array( 'system' => array( 'disabled_tags' => [], 'enabled_special_smarty_vars' => array( 'template_object', ), ), ); However in latest update, if i have this added, the site does not work, throws random error like Smarty Error: Syntax error in template "file:/home/USER/public_html/billing/templates/orderforms/standard_cart_twenty_one_point_oh/checkout.tpl" on line 53 "<form method="post" action="{$smarty.server.PHP_SELF}?a=checkout" name="orderfrm" id="frmCheckout">" special variable '$smarty.server' not allowed by security setting How can i make sure that both, the WHMCS and the custom script works here?
  11. Well first of all i am irritated with Paypal. Especially after their latest shenanigans with refund feels being deducted by me. Even when their fraud system fails. And when that one time out of 20th, when it does detect a fraud transaction, it flaunts about it, but what about the other 19 times? Last month i have spent about $50 in just dispute and refund fees. which is ridiculous. Are there any plugins or anything that can prevent it? And also what are the measures and methods you use for ditching this abysmal fees and dispute fees. PS: Dispute Fees are still ok, the refund fees arent. which are ridiculous.
  12. Title. Its sad that even after beta & RCs, me and many others ahve to be scare to upgrade to mainline release.
  13. I have promox vps module from modulesgarden and it is throwing this error. It is weekend so i assume their support is offline. Anyway to sort this? https://prnt.sc/ussijb
×
×
  • 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