hostingarg Posted July 28, 2020 Share Posted July 28, 2020 I sincerely apologize if this question is already posted, but I couldn't find an answer to it.When a customer makes a purchase, the notification arrives, regardless of whether the purchase was fraudulent or genuine.My query is: is there a way to add to the notification of the purchase if the purchase was fraudulent? That is, some means to be able to recognize if the purchase was marked as fraudulent or genuine.Thank you very much 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted July 28, 2020 Share Posted July 28, 2020 (edited) I think you can use FraudOrder hook point and send emails to administrators via SendEmail API. Edited July 28, 2020 by Kian 0 Quote Link to comment Share on other sites More sharing options...
hostingarg Posted July 28, 2020 Author Share Posted July 28, 2020 7 minutes ago, Kian said: I think you can use FraudOrder hook point and send emails to administrators via SendEmail API. Could you give me an example of how the complete hook would look please? Thank you. 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted July 28, 2020 Share Posted July 28, 2020 <?php use WHMCS\Database\Capsule; add_hook('FraudOrder', 1, function($vars) { $admins = Capsule::table('tbladmins')->where('disabled', '=', '0')->pluck('username'); foreach ($admins as $username) { localAPI('SendAdminEmail', array('type' => 'system', 'customsubject' => 'Fraud Order Detected', 'custommessage' => 'Order #' . $vars['orderid'] . ' detected as Fraudulent'), $username); } }); It should work. It sends the notification to all active administrators. 1 Quote Link to comment Share on other sites More sharing options...
hostingarg Posted July 28, 2020 Author Share Posted July 28, 2020 54 minutes ago, Kian said: <?php use WHMCS\Database\Capsule; add_hook('FraudOrder', 1, function($vars) { $admins = Capsule::table('tbladmins')->where('disabled', '=', '0')->pluck('username'); foreach ($admins as $username) { localAPI('SendAdminEmail', array('type' => 'system', 'customsubject' => 'Fraud Order Detected', 'custommessage' => 'Order #' . $vars['orderid'] . ' detected as Fraudulent'), $username); } }); It should work. It sends the notification to all active administrators. Thank you very much!You're the best! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.