Jump to content

royaljaat111

Member
  • Posts

    13
  • Joined

  • Last visited

Everything posted by royaljaat111

  1. Just a quick help. When It prevents auto provision, I got this error message on my email: Function Aborted by Action Hook Code (this is a generic message). How can I change this message to my custom message? So that my staff isn't confused with this error. I would like to change to: "Order is placed with Stripe, Kindly activate Manually." Something like that. I hope you understand me well.
  2. Alright, So I have achieved the goal with this code: <?php use WHMCS\Database\Capsule; add_hook('PreModuleCreate', 1, function($vars) { // Get the service ID from the hook $serviceId = $vars['params']['serviceid']; // Fetch the order associated with the service $order = Capsule::table('tblhosting') ->join('tblorders', 'tblhosting.orderid', '=', 'tblorders.id') ->where('tblhosting.id', $serviceId) ->select('tblorders.paymentmethod', 'tblorders.id as orderid') ->first(); // Log the detected payment method for debugging if ($order) { logActivity("Detected payment method: {$order->paymentmethod} for order #{$order->orderid}"); } else { logActivity("Order not found for service ID: {$serviceId}"); } // Check if the payment method is Stripe if ($order && $order->paymentmethod == 'stripe') { // Log activity to indicate auto-setup was prevented logActivity("Module creation prevented for order #{$order->orderid} due to Stripe payment method."); // Return an error message to prevent the module creation return [ 'abortcmd' => true, 'error' => 'Module creation has been aborted because the payment method is Stripe.' ]; } }); But now, When I try to accept the order manually after reviewing the order, it does not let me create the service. I think I have to add more functionality for the accept order. Any help on that thing.
  3. I have tried this code: <?php use WHMCS\Database\Capsule; add_hook('PreModuleCreate', 1, function($vars) { // Get the service ID from the hook $serviceId = $vars['serviceid']; // Log the service ID for debugging purposes logActivity("Service ID: {$serviceId}"); die('Test'); }); Inactivity logs: Service ID: showing blank!
  4. Yes, I am getting a Test on the service page when click on create. So what should I do next? 🙂
  5. Hello, I am sorry, You have misunderstood the concept I need. I want to use the universal hook of whmcs on this location: WHMCSDirectory/includes/hooks/disable_auto_provision_stripe.php I don't want to add a hook for each server module i.e. cpanel, virtualizor etc. I need a solution to have one single hook file which can prevent any auto-provision of any services/domains/servers etc when the client selects the stripe and pays his invoice through stripe. I hope you will understand now. Best Regards
  6. Hello, It doesn't provide any logs in activity logs and also, doesn't prevent auto-provision when paying through Stripe. I disabled and enabled the module again after the hook was placed. What could be the issue?
  7. Hello, I need a solution to disable the auto-provision of services and domains for a particular payment method "Stripe". I need it to review all the orders from Stripe to prevent fraud. I know whmcs offers to disable the automatic setup on the product/service page by default. However, that is not a solution because I want to disable automatic setup for a particular gateway only. I have prepared a hook but it's not working. May someone help me to fix that? <?php use WHMCS\Database\Capsule; add_hook('PreModuleCreate', 1, function($vars) { // Get the service ID from the hook $serviceId = $vars['serviceid']; // Fetch the order associated with the service $order = Capsule::table('tblhosting') ->join('tblorders', 'tblhosting.orderid', '=', 'tblorders.id') ->where('tblhosting.id', $serviceId) ->select('tblorders.paymentmethod', 'tblorders.id as orderid') ->first(); // Check if the payment method is Stripe if ($order->paymentmethod == 'stripe') { // Log activity to indicate auto-setup was prevented logActivity("Module creation prevented for order #{$order->orderid} due to Stripe payment method."); // Abort the module creation (prevent auto-setup) return ['abortcmd' => true]; } });
  8. Hello, Thank you for your response, I have tried this but doesn't work <?php use WHMCS\Database\Capsule; add_hook('PreModuleCreate', 1, function($vars) { // Get the service ID from the hook $serviceId = $vars['serviceid']; // Fetch the order associated with the service $order = Capsule::table('tblhosting') ->join('tblorders', 'tblhosting.orderid', '=', 'tblorders.id') ->where('tblhosting.id', $serviceId) ->select('tblorders.paymentmethod', 'tblorders.id as orderid') ->first(); // Check if the payment method is Stripe if ($order->paymentmethod == 'stripe') { // Log activity to indicate auto-setup was prevented logActivity("Module creation prevented for order #{$order->orderid} due to Stripe payment method."); // Abort the module creation (prevent auto-setup) return ['abortcmd' => true]; } });
  9. Hello, I need a solution to disable an automatic service setup and the automatic domain registration for a particular payment method "Stripe". I need it to review all the orders from stripe to prevent fraud. I know whmcs offers to disable the automatic setup on the product/service page by default. However, that is not a solution because I want to disable automatic setup for a particular gateway only. I have prepared a hook but it's not working. May someone help me to fix that? <?php use WHMCS\Database\Capsule; add_hook('AcceptOrder', 1, function($vars) { // Get the order ID $orderId = $vars['orderid']; // Get the order details $order = Capsule::table('tblorders') ->where('id', $orderId) ->first(); // Check if the payment method is Stripe if ($order->paymentmethod == 'stripe') { // Log activity logActivity("Auto setup prevented for order #{$orderId} using Stripe payment method."); // Update the order status to prevent auto-setup Capsule::table('tblorders') ->where('id', $orderId) ->update(['status' => 'Pending']); // Return false to abort the auto-setup process return false; } });
  10. It didn't work for me. Do I need to modify name of the file or inside this code?
  11. Hello, I was using a reseller on my whmcs but for some reason, I changed the reseller to other company's reseller. The previous company ban my whmcs's IP in Imunify360. So whenever click on modulequeue.php "Module queue Actions" It shows me this error: "158.106.139.110 is protected by Imunify360 We have noticed an unusual activity from your *MY WHMCS IP* and blocked access to this website." In front of one of my clients' service. but there is no link to this ip 158.106.139.110 in server's page any more. Since I have changed the reseller on whmcs already. So I delete that client service which causing the issue but still the error is the same. Screenshot of the error: I have tried retry all but nothing happened. I was trying to find the way to clear module queue list from the database tables in PHPMyAdmin but I am unable to find the table of module queue. Any suggestion will be appreciated. Thanks Regards
×
×
  • 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