Jump to content

royaljaat111

Member
  • Posts

    13
  • Joined

  • Last visited

About royaljaat111

Recent Profile Visitors

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

royaljaat111's Achievements

Junior Member

Junior Member (1/3)

0

Reputation

  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. 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
  5. 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?
  6. 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]; } });
  7. 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]; } });
  8. 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; } });
  9. It didn't work for me. Do I need to modify name of the file or inside this code?
  10. 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
  11. Welcome to WHMCS.Community royaljaat111! We're glad you're here please take some time to familiarise yourself with the Community Rules & Guidelines and take a moment to introduce yourself to other WHMCS.Community members in the Introduce Yourself Board.

×
×
  • 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